随笔分类 -  比赛--Codeforces

摘要:A题 分析:注意异或以后可能会大于2e6,所以数组应该开到4e6。还有一种巧妙的解法就是用异或的性质,b^a^b=a,所以可以看出必然都是偶数对。 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "s 阅读全文
posted @ 2017-10-10 17:31 wolf940509 阅读(241) 评论(0) 推荐(1)
摘要:A题 分析:暴力 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "string" 5 using namespace std; 6 const int maxn=100+10; 7 int vis[ 阅读全文
posted @ 2017-09-14 22:04 wolf940509 阅读(170) 评论(0) 推荐(0)
摘要:A题 分析:按题意比较二者之间的大小关系即可 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 using namespace std; 5 int s,v1,v2,t1,t2; 6 int main() 7 { 8 c 阅读全文
posted @ 2017-08-01 16:16 wolf940509 阅读(112) 评论(0) 推荐(0)
摘要:A题 分析:水题,模拟一下顺时针和逆时针情况就好了 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "string" 5 #include "vector" 6 using namespace std 阅读全文
posted @ 2017-07-31 10:08 wolf940509 阅读(126) 评论(0) 推荐(0)
摘要:A题 分析:直接看n/k的奇偶性 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 using namespace std; 5 long long n,k; 6 int main() 7 { 8 cin>>n>>k; 阅读全文
posted @ 2017-07-25 11:14 wolf940509 阅读(131) 评论(0) 推荐(0)
摘要:A题 分析:遇到1就统计有几个连续的,遇到0若连续的多于一个就输出后面的0 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "string" 5 #include "vector" 6 using n 阅读全文
posted @ 2017-07-24 20:44 wolf940509 阅读(111) 评论(0) 推荐(0)
摘要:A题 分析:SB题,列一个式子搞定 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "string" 5 using namespace std; 6 long long n,k; 7 int mai 阅读全文
posted @ 2017-06-30 14:18 wolf940509 阅读(116) 评论(0) 推荐(0)
摘要:A题 分析:开始从v0开始,每天增加a,然后超过v1就从v1开始 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "string" 5 using namespace std; 6 int c,v0, 阅读全文
posted @ 2017-06-28 09:14 wolf940509 阅读(130) 评论(0) 推荐(0)
摘要:A题 分析:注意两个点之间的倍数差,若为偶数则为YES,否则为NO 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "string" 5 #include "cmath" 6 using namesp 阅读全文
posted @ 2017-06-17 10:48 wolf940509 阅读(154) 评论(0) 推荐(0)
摘要:A题 分析:傻逼题,两个数的差不大于1输出任意一个,否则输出2 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "cmath" 5 using namespace std; 6 int main() 阅读全文
posted @ 2017-05-07 00:21 wolf940509 阅读(116) 评论(0) 推荐(0)
摘要:A题 分析:把串反转,判不一样的个数,不同个数恰好为2个或者为0个且串的长度为奇数就输出YES,否则为NO 1 #include "iostream" 2 #include "cstdio" 3 #include "cmath" 4 #include "cstring" 5 using namesp 阅读全文
posted @ 2017-04-25 10:56 wolf940509 阅读(144) 评论(0) 推荐(0)
摘要:A题 分析:直接统计装完每一份需要多少个袋子即可 1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 using namespace std; 5 const int maxn=100000+10; 6 int a[max 阅读全文
posted @ 2017-03-31 13:32 wolf940509 阅读(145) 评论(0) 推荐(0)
摘要:A题 分析:把多面体和面数一一对应即可 1 #include<iostream> 2 #include<map> 3 #include<cstring> 4 #include<cstdio> 5 using namespace std; 6 int main() 7 { 8 int T; 9 whi 阅读全文
posted @ 2017-03-18 10:11 wolf940509 阅读(82) 评论(0) 推荐(0)
摘要:打得还不错的一场CF,题目质量也很高,今后还要继续努力 A题: 题意:给定一个数k,让其乘一个最小的数,使乘得以后的数要不被10整除,要不减去r以后被10整除,求这个最小的数 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 阅读全文
posted @ 2016-10-24 13:30 wolf940509 阅读(237) 评论(0) 推荐(0)
摘要:Ranting重新回到蓝的一场比赛 Problem A 题意:月亮的大小是按照这样的顺序排列的0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 然后给 阅读全文
posted @ 2016-09-28 13:21 wolf940509 阅读(152) 评论(0) 推荐(0)
摘要:这是一场非常需要总结的比赛,交了3题,最后终测的时候3题全部没过,一下掉到了绿名,2333 Problem A 题意:给定区间[l1,r1],[l2,r2],然后给定一个整数k,求区间当中相交的元素,k这个点不可算 分析:画图即可得出答案,注意两个l1和r2,以及r1和l2刚好重合的情况,赛场上就是 阅读全文
posted @ 2016-09-22 10:50 wolf940509 阅读(145) 评论(0) 推荐(0)
摘要:打得最烂一场Codeforces,多次都错题,无限WA。。。 A题: 题意:给定n个橘子的大小,大小超过b的丢掉,不足d的补充进来,同时超过d的部分去掉,问要去掉几次 分析:直接模拟即可 1 #include <iostream> 2 #include <cstdio> 3 #include <cs 阅读全文
posted @ 2016-08-26 07:46 wolf940509 阅读(188) 评论(0) 推荐(0)
摘要:A题:题意:给定国际象棋king的坐标,求能向几个方向移动分析:处理一下边界情况,其他的都是8 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <string> 5 #include <vector> 阅读全文
posted @ 2016-08-23 07:53 wolf940509 阅读(143) 评论(0) 推荐(0)
摘要:A题: 题意:给定一些数,给定一些往左走和往右走的操作,问是否能够相遇,如果相遇请求出相遇时间 分析:对于相邻两个数,如果大的往左,小的往右就能够相遇,否则不能相遇,在求出所有相遇当中的第一次相遇即可 1 #include <iostream> 2 #include <cstdio> 3 #incl 阅读全文
posted @ 2016-07-29 07:43 wolf940509 阅读(168) 评论(0) 推荐(0)
摘要:A题: 题意:给定一些数,然后每两个组成一对,要求每对的和的大小相同,输出这样的组合 分析:直接模拟就行 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <string> 5 #include <ve 阅读全文
posted @ 2016-07-26 10:10 wolf940509 阅读(158) 评论(0) 推荐(0)