2012年5月13日

acm 血泪教训

摘要: http://icpc.ahu.edu.cn/OJ/Problem.aspx?id=231#include <iostream> #include <algorithm> using namespace std; int arr[10005]; unsigned long long Fun(int N) { sort(arr, arr + N); unsigned long long ans = 0; for (int i = 0; i < N - 1; i++) { ans += (arr[i + 1] - arr[i]) * (i + 1) * (N - i 阅读全文

posted @ 2012-05-13 19:11 c语言源码 阅读(217) 评论(0) 推荐(0) 编辑

java线程系列---java5中的线程池

摘要: public class ThreadPoolsTest {public static void main(String[] args) {//ExecutorService threadpools = Executors.newFixedThreadPool(3);//固定线程池//ExecutorService threadpools = Executors.newCachedThreadPool();//缓冲线程池,来多少就开多少线程ExecutorService threadpools = Executors.newSingleThreadExecutor();//单个线程池,死掉了就 阅读全文

posted @ 2012-05-13 14:18 c语言源码 阅读(159) 评论(0) 推荐(0) 编辑

poj 4044

摘要: 很水,但还是WA了好几次#include<cstdio> #include<string.h> #include<algorithm> using namespace std; int cmp(int a,int b){ return a>b; } int cmp2(int a,int b){ if(a%10==b%10) return a<b; return a%10<b%10; } int n,m; int dp[31]; int main(){ int i,j,t,T,a,b,x[31],y[31]; //freopen(" 阅读全文

posted @ 2012-05-13 00:15 c语言源码 阅读(149) 评论(0) 推荐(0) 编辑

导航