04 2016 档案

摘要://容斥原理,c[i]表示i当前要算的次数,复杂度和第二层循环相关 O(nlogn~n^2) LL in_exclusion(int n,int *c) { for(int i=0;i<=n;i++) c[i]=1; //不一定是这样初始化,要算到的才初始化为1 LL ans=0; for(int 阅读全文
posted @ 2016-04-18 22:35 cdongyang 阅读(1938) 评论(0) 推荐(0)
摘要:1 /* 2 1 3 126 223092870 4 210 330 390 462 510 546 570 690 714 770 798 858 910 966 1122 1155 1190 1254 1326 1330 1365 1430 1482 1518 1610 1785 1794 18 阅读全文
posted @ 2016-04-07 23:34 cdongyang 阅读(247) 评论(0) 推荐(0)
摘要:1 #include <stdio.h> 2 #include <algorithm> 3 #define MAX 100000 4 #define LL long long 5 #define unsigned U 6 //using namespace std; 7 int cas=1,T; 8 阅读全文
posted @ 2016-04-06 20:59 cdongyang 阅读(412) 评论(0) 推荐(0)