随笔分类 -  Codeforces

摘要://比赛时的代码感觉写得真心难看......Orz,还有一堆低级错误贴出来晒晒吧Problem A CodeForces 329A Purification2A 1 #include "bits/stdc++.h" 2 using namespace std; 3 char mat[110][1... 阅读全文
posted @ 2015-03-29 20:22 AC_Phoenix 阅读(215) 评论(0) 推荐(0)
摘要://还是too young,因为没初始化len_name, len_str wa了一发 1 #include "bits\stdc++.h" 2 using namespace std; 3 char name[1010], str[1000010]; 4 5 int main() 6 { 7 ... 阅读全文
posted @ 2015-03-28 21:02 AC_Phoenix 阅读(333) 评论(0) 推荐(0)
摘要:1 #include "bits\stdc++.h" 2 using namespace std; 3 int n, T; 4 double c; 5 int ans[200010]; 6 7 int m, p; 8 9 int main()10 {11 scanf("%d%d%lf"... 阅读全文
posted @ 2015-03-28 20:36 AC_Phoenix 阅读(204) 评论(0) 推荐(0)
摘要:1 #include "bits/stdc++.h" 2 using namespace std; 3 char mat[110][110]; 4 int m, n; 5 6 int main() 7 { 8 scanf("%d%d", &m, &n); 9 int i, j;1... 阅读全文
posted @ 2015-03-28 19:27 AC_Phoenix 阅读(304) 评论(0) 推荐(0)
摘要://思路:因为题目是要求求出所有可能被选完的 dish,所以当之前乘客所选 dish 不确定时,将所有 dish 的数量均减一(做法是记录下来不确定的 dish 的数量);当出现第一个顾客 QAQ(不开心) 的时候,说明在他之前至少有一个 dish 已经被选完了,这时候就需要利用不确定的 dish ... 阅读全文
posted @ 2015-03-27 23:10 AC_Phoenix 阅读(244) 评论(0) 推荐(0)
摘要://戳这里:522D思路:为了简化问题我们先确定区间的右端,则需要先从右端最靠左的区间开始处理;处理某个区间时,我们将元素从 1 的位置处理到这个区间的右端(得到每个元素在其右侧最近相同元素的距离),然后只需要从这个区间的左端遍历到右端就能得到这个区间内的解。如果熟悉树状数组性质的话可以方便的把这个... 阅读全文
posted @ 2015-03-18 15:35 AC_Phoenix 阅读(329) 评论(0) 推荐(0)
摘要://戳这里:522B//Problem tags 上竟然有人贴 data structures...保存最大的两个 h[i] 不就好了么...... 1 #include "iostream" 2 #include "cstdio" 3 using namespace std; 4 int n, w... 阅读全文
posted @ 2015-03-12 20:31 AC_Phoenix 阅读(272) 评论(0) 推荐(0)
摘要://戳这里:522A 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 #include "map" 6 using namespace std; 7 int n; 8 ma... 阅读全文
posted @ 2015-03-12 20:09 AC_Phoenix 阅读(207) 评论(0) 推荐(0)
摘要:戳这里:520D//贪心的做法比较明显:取出方格中的数从左往右排列形成一个 m 进制的数,前者想要数最大,则每次取符合条件的最大的数,后者想要数最小,则每次取符合条件的最小的数。//做法也比较暴力:在整个剩余的数形成的集合中两人每次贪心取数,那么就相当于是对剩余的数形成的集合进行搜索,考虑到极端情况... 阅读全文
posted @ 2015-03-12 18:15 AC_Phoenix 阅读(197) 评论(0) 推荐(0)
摘要://521D//有三种升级技能的策略:1、=; 2、+=;3、*=。最优的升级顺序显然是先使用策略1,再策略2,再策略3//赋值变加(对于每一种技能只考虑增益最大的赋值操作),加变乘(对于每一种技能优先考虑增益最大的加法),在不超过总升级方案的前提下,排序后选出 m 种所乘系数最大的升级方案。因为再... 阅读全文
posted @ 2015-03-08 17:06 AC_Phoenix 阅读(294) 评论(0) 推荐(0)
摘要://520C - DNA Alignment 1 #include "iostream" 2 #include "cstdio" 3 using namespace std; 4 const __int64 mod = 1e9 + 7; 5 int n; 6 char str[100010]; 7 ... 阅读全文
posted @ 2015-03-03 23:46 AC_Phoenix 阅读(198) 评论(0) 推荐(0)
摘要://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 阅读(128) 评论(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 阅读(152) 评论(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 阅读(255) 评论(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 阅读(438) 评论(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 阅读(149) 评论(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 阅读(152) 评论(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 阅读(270) 评论(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 阅读(172) 评论(0) 推荐(0)