02 2015 档案

摘要://CodeForces 404B 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 using namespace std; 6 const __int64 N = 1e6... 阅读全文
posted @ 2015-02-25 00:04 AC_Phoenix 阅读(127) 评论(0) 推荐(0)
摘要://CodeForces 404A 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 using namespace std; 6 char mat[310][310]; 7... 阅读全文
posted @ 2015-02-25 00:03 AC_Phoenix 阅读(290) 评论(0) 推荐(0)
摘要://CodeForces 405B 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 using namespace std; 6 char str[3010]; 7 int... 阅读全文
posted @ 2015-02-25 00:02 AC_Phoenix 阅读(151) 评论(0) 推荐(0)
摘要://CodeForces 405A 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 using namespace std; 6 int ans[110], n; 7 8... 阅读全文
posted @ 2015-02-25 00:01 AC_Phoenix 阅读(254) 评论(0) 推荐(0)
摘要://CodeForces 407B 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 using namespace std; 6 const __int64 mod = 1... 阅读全文
posted @ 2015-02-25 00:00 AC_Phoenix 阅读(436) 评论(0) 推荐(0)
摘要://CodeForces 407A 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 using namespace std; 6 int square[1010]; 7 s... 阅读全文
posted @ 2015-02-24 23:59 AC_Phoenix 阅读(148) 评论(0) 推荐(0)
摘要://CodeForces 408B 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 using namespace std; 6 int n1[30], n2[30]; 7... 阅读全文
posted @ 2015-02-24 23:58 AC_Phoenix 阅读(150) 评论(0) 推荐(0)
摘要://CodeForces 408A 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 using namespace std; 6 int n, k[110], tmp, r... 阅读全文
posted @ 2015-02-24 23:57 AC_Phoenix 阅读(269) 评论(0) 推荐(0)
摘要://CodeForces 413C 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 #include "vector" 6 using namespace std; 7 i... 阅读全文
posted @ 2015-02-24 18:18 AC_Phoenix 阅读(171) 评论(0) 推荐(0)
摘要://CodeForces 413B 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 #include "vector" 6 using namespace std; 7 i... 阅读全文
posted @ 2015-02-24 18:17 AC_Phoenix 阅读(181) 评论(0) 推荐(0)
摘要://CodeForces 413A 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 #include "vector" 6 using namespace std; 7 i... 阅读全文
posted @ 2015-02-24 18:16 AC_Phoenix 阅读(234) 评论(0) 推荐(0)
摘要://CodeForces 412E 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 #include "vector" 6 using namespace std; 7 c... 阅读全文
posted @ 2015-02-24 18:15 AC_Phoenix 阅读(138) 评论(0) 推荐(0)
摘要://CodeForces 412D 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 #include "vector" 6 using namespace std; 7 i... 阅读全文
posted @ 2015-02-24 18:14 AC_Phoenix 阅读(223) 评论(0) 推荐(0)
摘要://CodeForces 412C 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 #include "vector" 6 using namespace std; 7 v... 阅读全文
posted @ 2015-02-24 18:13 AC_Phoenix 阅读(182) 评论(0) 推荐(0)
摘要://CodeForces 412B 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 #include "vector" 6 using namespace std; 7 i... 阅读全文
posted @ 2015-02-24 18:12 AC_Phoenix 阅读(217) 评论(0) 推荐(0)
摘要://CodeForces 412A 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 #include "vector" 6 using namespace std; 7 i... 阅读全文
posted @ 2015-02-24 18:11 AC_Phoenix 阅读(160) 评论(0) 推荐(0)
摘要://CodeForces 411C 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 #include "vector" 6 using namespace std; 7 i... 阅读全文
posted @ 2015-02-24 18:09 AC_Phoenix 阅读(192) 评论(0) 推荐(0)
摘要://CodeForces 411B 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 #include "vector" 6 using namespace std; 7 i... 阅读全文
posted @ 2015-02-24 18:08 AC_Phoenix 阅读(210) 评论(0) 推荐(0)
摘要://CodeForces 411A 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 #include "vector" 6 using namespace std; 7 c... 阅读全文
posted @ 2015-02-24 18:06 AC_Phoenix 阅读(139) 评论(0) 推荐(0)
摘要://GCIS 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 using namespace std; 6 int dp[510], Max; 7 int s1[510],... 阅读全文
posted @ 2015-02-22 17:09 AC_Phoenix 阅读(169) 评论(0) 推荐(0)
摘要://先贴一发错误的代码,dp[层数][方向]//因为是对不完整的方案计数了... 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 using namespace std; ... 阅读全文
posted @ 2015-02-20 20:04 AC_Phoenix 阅读(546) 评论(0) 推荐(0)
摘要://搜啊搜...//因为我们每次搜索的起点都是一样的,但是数组的第一个元素不同,所以可以手工算出下一个点,从起点的下一点开始搜 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" ... 阅读全文
posted @ 2015-02-18 17:53 AC_Phoenix 阅读(525) 评论(2) 推荐(0)
摘要://继续水一道树形dp 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 #include "cmath" 6 using namespace std; 7 __int64 ... 阅读全文
posted @ 2015-02-18 15:45 AC_Phoenix 阅读(187) 评论(0) 推荐(0)
摘要://再水一发树形dp 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 using namespace std; 6 int dp[6010][2]; 7 bool vis[... 阅读全文
posted @ 2015-02-18 13:42 AC_Phoenix 阅读(154) 评论(0) 推荐(0)
摘要://好久没水题了,水一发记忆化好了= ̄ω ̄= 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 #include "cmath" 6 using namespace std;... 阅读全文
posted @ 2015-02-17 22:50 AC_Phoenix 阅读(211) 评论(0) 推荐(0)
摘要://思路:通过博弈的思想设计出状态,dp[w][b] 表示当公主面对 w 只白鼠和 b 只黑鼠时获胜的概率 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 using na... 阅读全文
posted @ 2015-02-17 21:54 AC_Phoenix 阅读(140) 评论(0) 推荐(0)
摘要://分析:明显的树形关系,题目描述的是一棵高 n + 1的完全二叉树,则 dp[树层号][team号](规定最底层为 0 层,层数朝节点的方向依次递增),推一下就好了//稍微需要想一下的是比赛双方的选取,下面给出两种方法//#1 枚举起点划分team区间 1 #include "iostream" ... 阅读全文
posted @ 2015-02-17 18:58 AC_Phoenix 阅读(153) 评论(0) 推荐(0)
摘要://dp[i][state]//状态转移方程的选取:题目的意思是,从点 i 优先考虑到达 i + A 点的情况,若不能到达 i + A 点,则考虑到达 i + A + 1 点的情况...以此类推,直到考虑完到达 i + B 点的情况。对于最坏的情况,每一个点都有 B - A + 1 个后继点,所以由... 阅读全文
posted @ 2015-02-17 16:52 AC_Phoenix 阅读(224) 评论(0) 推荐(0)
摘要://下面是错误代码... 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 #include "cmath" 6 using namespace std; 7 const d... 阅读全文
posted @ 2015-02-13 23:05 AC_Phoenix 阅读(157) 评论(0) 推荐(0)
摘要://poj 2151 概率dp 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 using namespace std; 6 double dp[33][33]; 7 i... 阅读全文
posted @ 2015-02-13 20:55 AC_Phoenix 阅读(139) 评论(0) 推荐(0)
摘要://CodeForces 385C素数朴素筛法,穷尽数的素数因子 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 using namespace std; 6 const ... 阅读全文
posted @ 2015-02-12 18:49 AC_Phoenix 阅读(669) 评论(0) 推荐(0)
摘要://CodeForces 234F 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 using namespace std; 6 const int INF = 0x3f3... 阅读全文
posted @ 2015-02-12 17:34 AC_Phoenix 阅读(249) 评论(0) 推荐(0)
摘要://CodeForces 232B//原先 T 了的代码 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 using namespace std; 6 const int ... 阅读全文
posted @ 2015-02-11 18:43 AC_Phoenix 阅读(230) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2015-02-11 17:24 AC_Phoenix 阅读(10) 评论(0) 推荐(0)
摘要://CodeForces314C//分析:相当于求给定序列的不降子序列的个数,从一个空序列开始将得到的不降子序列不断的延长是典型的做法,则dp[i]表示以第 i 个元素结尾的序列//思路:O(n^2) 的做法,dp[i] = sum(dp[j]]) (a[j] = 1; i -= lowbit(i)... 阅读全文
posted @ 2015-02-11 17:10 AC_Phoenix 阅读(182) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2015-02-10 23:15 AC_Phoenix 阅读(3) 评论(0) 推荐(0)
摘要://CodeForce18D - Seller Bob 1 #include"iostream" 2 #include"cstdio" 3 #include"cstring" 4 #include"algorithm" 5 using namespace std; 6 int num[2010][7... 阅读全文
posted @ 2015-02-10 18:21 AC_Phoenix 阅读(151) 评论(0) 推荐(0)
摘要://CodeForces 132C之前 wa 在 test 16 上的写法今天突发奇想改了改竟然过了......也就是说我这么找的状态也是可以的?!!! 1 #include"iostream" 2 #include"cstdio" 3 #include"cstring" 4 #include"al... 阅读全文
posted @ 2015-02-08 16:16 AC_Phoenix 阅读(222) 评论(0) 推荐(0)
摘要://CodeForces 264B//分析:在数列上的 dp,选取前缀集合的大小作为下标很容易构造出一个 O(n^2) 的 dp,i > j,if(ans[i]与ans[j]之间具有相同的素因子) dp[i] = max(dp[j]+1),不过 n 有100000那么大,于是继续优化,dp[i]表示... 阅读全文
posted @ 2015-02-06 15:36 AC_Phoenix 阅读(181) 评论(0) 推荐(0)
摘要://CodeForces 132C 1 #include"iostream" 2 #include"cstdio" 3 #include"cstring" 4 #include"algorithm" 5 using namespace std; //状态可达dp,其实 bool dp[110]... 阅读全文
posted @ 2015-02-05 18:51 AC_Phoenix 阅读(350) 评论(0) 推荐(1)
摘要://CodeChef RRMATRIX//分析:(x-1)*m+y == (y-1)*n+x ==> (x-1)*(m-1) == (y-1)*(n-1) ==> (x-1) == (y-1)*(n-1)/(m-1);(n-1)/(m-1)约分后分母还剩余一个(m-1)/gcd(n-1,m-1),(... 阅读全文
posted @ 2015-02-04 16:58 AC_Phoenix 阅读(216) 评论(0) 推荐(0)
摘要://poj 3666//分析:只是在2005年集训队论文黄源河提到的题目上略微有一点点变化 1 #include"iostream" 2 #include"cstdio" 3 using namespace std; 4 const int maxn = 2100; 5 int v[maxn],l[... 阅读全文
posted @ 2015-02-02 21:47 AC_Phoenix 阅读(356) 评论(0) 推荐(0)
摘要://poj 3016 K-Monotonic//分析:与2005年集训队论文黄源河提到的题目类似,给定序列a,求一序列b,b不减,且sigma(abs(ai-bi))最小。//思路:去除左偏树(大根堆)一半的节点(向上取整),让左偏树的根节点上存放中位数;每个左偏树的根节点表示一个等值区间//在本题... 阅读全文
posted @ 2015-02-01 21:31 AC_Phoenix 阅读(575) 评论(1) 推荐(0)