随笔分类 -  CF

摘要:1 /* 2 CF586D. Phillip and Trains 3 http://codeforces.com/problemset/problem/586/D 4 搜索 5 */ 6 #include 7 #include 8 #include 9 using namespace std; 10 const int Nmax=110; 11 char map[4]... 阅读全文
posted @ 2017-04-27 11:44 BBBob 阅读(820) 评论(0) 推荐(0)
摘要:1 /* 2 CF410div2 B. Mike and strings 3 http://codeforces.com/contest/798/problem/B 4 字符串 暴力 5 题意:给你n个串,每次操作可以将某个串的第一个字符放到最后去, 6 问最少的次数,使得所有字符串都相同 7 思路:先将所有字符串复制成二倍,然后暴力枚举要变成的串 8 注意数组都要... 阅读全文
posted @ 2017-04-23 10:34 BBBob 阅读(247) 评论(0) 推荐(0)
摘要:1 /* 2 CF410div2 A. Mike and palindrome 3 http://codeforces.com/contest/798/problem/A 4 水题 5 */ 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 ... 阅读全文
posted @ 2017-04-23 09:42 BBBob 阅读(223) 评论(0) 推荐(0)
摘要:1 /* 2 CF410div2 D. Mike and distribution 3 http://codeforces.com/contest/798/problem/D 4 构造 5 题意:给出两个数列a,b,求选出n/2+1个数对,使得其和的二倍大于各自的数列 6 思路:对数列a进行排序,因为可以选一半加1个,所以最大的那个我们选出来 7 然后在... 阅读全文
posted @ 2017-04-23 09:34 BBBob 阅读(246) 评论(0) 推荐(0)
摘要:1 /* 2 CF798 C. Mike and gcd problem 3 http://codeforces.com/contest/798/problem/C 4 数论 贪心 5 题意:如果一个数列的gcd值大于1,则称之为美丽数列 6 给出数列a,可以将a_i 和 a_(i+1)换为其差和其和 7 如果可以变为美丽数列,输出YES并输出最少的变换次数... 阅读全文
posted @ 2017-04-22 02:29 BBBob 阅读(2282) 评论(0) 推荐(0)
摘要:1 /* 2 CF789B. Masha and geometric depression 3 http://codeforces.com/contest/789/problem/B 4 水题 5 各种特判,贼烦 6 */ 7 #include 8 #include 9 #include 10 #include 11 #include ... 阅读全文
posted @ 2017-03-30 12:02 BBBob 阅读(1500) 评论(0) 推荐(0)
摘要:1 /* 2 CF789A. Anastasia and pebbles 3 http://codeforces.com/contest/789/problem/A 4 水题 5 题意:有两个背包,每次分别可取k个物品,要求每次背包中的物品都是一种 6 问要取多少次。 7 对于每种物品,都要取ceil(n/k)次,因此只要加起来再除以2就是答案 8 */ 9 #i... 阅读全文
posted @ 2017-03-30 12:01 BBBob 阅读(868) 评论(0) 推荐(0)
摘要:1 /* 2 CF789C. Functions again 3 http://codeforces.com/contest/789/problem/C 4 水题 5 题意:求数组中的连续和的最大值 6 */ 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 //... 阅读全文
posted @ 2017-03-30 11:55 BBBob 阅读(543) 评论(0) 推荐(0)
摘要:1 /* 2 CF617E. XOR and Favorite Number 3 http://codeforces.com/contest/617/problem/E 4 莫队算法 5 题意:求l,r区间内异或和为k的对数 6 用times记录某异或值在当前区间中的个数 7 */ 8 #include 9 #include 10 #include 11 #i... 阅读全文
posted @ 2017-03-28 20:39 BBBob 阅读(400) 评论(0) 推荐(0)
摘要:1 /* 2 CF15C. Industrial Nim 3 http://codeforces.com/problemset/problem/15/C 4 数论 博弈论 尼姆博弈 5 6 典型的尼姆博弈,答案就是所有数的异或值 7 然而在1e16的数据范围下直接异或肯定会T 8 考虑以一个能被4整除的数开始的连续4n个数的异或和为0 9 所以只需找到其余的值,... 阅读全文
posted @ 2017-03-27 16:26 BBBob 阅读(296) 评论(0) 推荐(0)
摘要:1 /* 2 CF786A - Berzerk 3 http://codeforces.com/contest/786/problem/A 4 博弈论 5 直接搜出NP状态图。记得要记忆化剪枝。 6 * 7 */ 8 #include 9 #include 10 //#define tle 11 #ifdef tle 12 //#defi... 阅读全文
posted @ 2017-03-24 17:53 BBBob 阅读(405) 评论(0) 推荐(0)
摘要:1 /* 2 CF787A - The Monster 3 http://codeforces.com/contest/787/problem/A 4 数学 扩展欧几里得 5 注意x或y为0的时候要特判 6 并且结果要大于b和d 7 */ 8 #include 9 int ex_gcd(int a,int b,int &x,int &y)//solve x,y i... 阅读全文
posted @ 2017-03-24 14:44 BBBob 阅读(375) 评论(0) 推荐(0)
摘要:1 /* 2 http://codeforces.com/problemset/problem/449/C 3 cf 449 C. Jzzhu and Apples 4 数论+素数+贪心 5 */ 6 #include 7 #include 8 using namespace std; 9 const int Nmax=100005; 10 int is_prime[Nma... 阅读全文
posted @ 2017-03-24 13:22 BBBob 阅读(303) 评论(0) 推荐(0)
摘要:1 /* 2 cf396B. On Sum of Fractions 3 http://codeforces.com/problemset/problem/396/B 4 数论+裂项求和+素数筛+gcd 5 */ 6 #include 7 #include 8 #include 9 using namespace std; 10 const int N... 阅读全文
posted @ 2017-03-24 13:21 BBBob 阅读(849) 评论(0) 推荐(0)
摘要:1 /* 2 cf369E. ZS and The Birthday Paradox 3 http://codeforces.com/contest/711/problem/E 4 抽屉原理+快速幂+逆元+勒让德定理+费马小定理+欧拉定理+数论 5 题解:https://amoshyc.github.io/ojsolution-build/cf/cf369/pe.html 6 7... 阅读全文
posted @ 2017-03-24 13:19 BBBob 阅读(213) 评论(0) 推荐(0)
摘要:题目在这里>_< 发现这场比赛在网上没有完整的题解,甚至连题目代码都没人贴出来(大概是因为题目太水了吧。。。)。所以宝宝就来写个题解,也就当作成长记录了233333 A. Window 题意很简单,给出n组x,y,求x*y的值 1 #include <cstdio> 2 #include <algo 阅读全文
posted @ 2016-11-01 09:54 BBBob 阅读(688) 评论(0) 推荐(1)