上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 52 下一页
摘要: http://codeforces.com/contest/361/problem/C这道题倒着一次,然后正着一次,在正着的一次的时候判断合不合法就可以。 1 #include 2 #include 3 #include 4 using namespace std; 5 const int i... 阅读全文
posted @ 2014-08-28 19:27 null1019 阅读(211) 评论(0) 推荐(0) 编辑
摘要: http://codeforces.com/contest/361/problem/B 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int n,k; 7 8 int main() 9 {10 while(s... 阅读全文
posted @ 2014-08-27 20:57 null1019 阅读(144) 评论(0) 推荐(0) 编辑
摘要: http://codeforces.com/contest/359/problem/E题意:要关掉所有房间的灯,一个步骤要么开灯,要么关灯,要么向有灯的方向前进一格。输出一种关掉所有灯的方案。不能关掉所有灯输出NO往前搜索时点灯,后退时关灯。 1 #include 2 #include 3 #i... 阅读全文
posted @ 2014-08-27 16:56 null1019 阅读(163) 评论(0) 推荐(0) 编辑
摘要: http://codeforces.com/contest/359/problem/D题意:给你n个数,然后找出在[l,r]中有一个数a[j],l 2 #include 3 #include 4 #define maxn 300100 5 using namespace std; 6 7 in... 阅读全文
posted @ 2014-08-27 09:23 null1019 阅读(148) 评论(0) 推荐(0) 编辑
摘要: http://codeforces.com/contest/359/problem/C先求出分子的公因子,然后根据分子上会除以公因子会长生1,然后记录1的个数就可以。 1 #include 2 #include 3 #include 4 #define maxn 200000 5 #defin... 阅读全文
posted @ 2014-08-26 21:27 null1019 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int a[100010]; 7 int main() 8 { 9 int n,k;10 scanf("%d%d",&n,&k);11 for(i... 阅读全文
posted @ 2014-08-26 18:07 null1019 阅读(107) 评论(0) 推荐(0) 编辑
摘要: http://codeforces.com/contest/358/problem/D题意:ai代表相邻的两个野兔都没有吃食物情况下的快乐系数,bi代表的是在相邻的两个野兔中有一个吃到食物的快乐系数,ci代表的是相邻的两个野兔都迟到事物的快乐系数,给你n个野兔的快乐系数,求最大快乐系数。dp[i][... 阅读全文
posted @ 2014-08-26 15:10 null1019 阅读(122) 评论(0) 推荐(0) 编辑
摘要: http://codeforces.com/contest/358/problem/C将最大的放在stack里面,第二大的放在queue中,第三大的放在deck里面。然后模拟就可以了。 1 #include 2 #include 3 #include 4 #include 5 using n... 阅读全文
posted @ 2014-08-26 09:50 null1019 阅读(307) 评论(0) 推荐(0) 编辑
摘要: http://codeforces.com/contest/358/problem/B先按照题意说的构造一个字符串s,然后与对比的字符串T比较,看看在字符串T中顺序查找有没有字符串S的所有字符,有输出yes,否则输出no. 1 #include 2 #include 3 #include 4 ... 阅读全文
posted @ 2014-08-25 20:03 null1019 阅读(123) 评论(0) 推荐(0) 编辑
摘要: http://codeforces.com/contest/357/problem/D题意:给你两个数n和m,表示两个字符串的循环次数,然后给出两个字符串,求出其相同位置字符不同的个数。先求出两个字符串长度的最大公约数和最小公倍数,然后求出在最小公倍数范围内的不同字符的个数,后面的和前面的一样,最终... 阅读全文
posted @ 2014-08-25 18:13 null1019 阅读(111) 评论(0) 推荐(0) 编辑
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 52 下一页