随笔分类 -  codeforces系列

摘要:题意:给出u,v。要求给出一个最短的数组,要求这个数组异或结果为u,和为v。 解析 :所谓xor,相同为0,否则为1。就是一个不进位的二进制加法(这里不理解的建议去看看二进制加法法则,再与此做对比)。 1:u>v。根据上述,不进位的u都比v大,那进位的话会更大,这些数加起来肯定比v大,所以无解,-1 阅读全文
posted @ 2020-03-24 22:26 liyexin 阅读(198) 评论(0) 推荐(0)
摘要:地址:http://codeforces.com/contest/1326 题意:给定n,输出一个长度为n的数字,满足以下条件:1:>0 2:各个位上不出现0 3:不能整除自己的任意一位。 解析:被这题给坑了一下。想不通我的33......7为什么不行,可能太长的话有被7整除的危险,并不能保证万无一 阅读全文
posted @ 2020-03-20 23:58 liyexin 阅读(240) 评论(0) 推荐(0)
摘要:http://codeforces.com/contest/1304 这把心态爆炸哈哈,B题把心思搞得很乱,写着写着受不了就关机了。以后不能这样了,一个普通比赛心态就这么差,谈何比赛? A. Two Rabbits 题意:倆兔子,坐标轴上一只往左一只往右,给出初始坐标和速度问是否能在同一时间相遇。 阅读全文
posted @ 2020-03-16 15:59 liyexin 阅读(81) 评论(0) 推荐(0)
摘要:在csdn那里看到好多人用截图的方式,我也试试~ A: 题意:把第一堆以外的其他堆往第一堆运,规定天数以内第一堆最多是多少 解析:简单模拟即可 #include<iostream> #include<cstdio> #include<stack> #include<cstring> #include 阅读全文
posted @ 2020-03-16 15:58 liyexin 阅读(153) 评论(0) 推荐(0)
摘要:地址:http://codeforces.com/contest/1324 题意:看着挺长的,实际上就这么些东西,俄罗斯方块。操作1:放2*1的块,随便无限放。操作2:非0集体减1。问最后是否能把方块全消除完。 解析:找一个最高的maxx,看其他能否全部变成maxx,由于放的方法是每次+2,那么看每 阅读全文
posted @ 2020-03-13 17:41 liyexin 阅读(244) 评论(0) 推荐(0)
摘要:恢复内容开始 地址:http://codeforces.com/contest/1311 A. Add Odd or Subtract Even 题意:给定ab两个数,每次操作可以将a增加任意一个奇数或是减少任意一个偶数。问最少几次使两个数字相等 解析:分情况讨论即可。a==b,a>b,a<b,一步 阅读全文
posted @ 2020-03-11 20:10 liyexin 阅读(110) 评论(0) 推荐(0)
摘要:地址:http://codeforces.com/contest/1312 题意:给出一个边数为n的等边多边形,问是否可以变成m的等边多边形。条件是同一个中心,共用原顶点。 解析:直接n%m==0即可,这样就是平分了。签到题没得说了。 #include<iostream> #include<cstd 阅读全文
posted @ 2020-03-11 20:01 liyexin 阅读(228) 评论(0) 推荐(0)
摘要:题意:根据第一段,只是让你找到任意一组元素,和为偶数即可。还可以根据OUTPUT最后一句,多种答案,输出任意一种。 解析:随便找嘛,所以如果碰到单个偶数,直接输出,否则找出任意两个奇数输出即可。都没有,就输出-1. #include<iostream> #include<cstdio> #inclu 阅读全文
posted @ 2020-03-08 23:52 liyexin 阅读(178) 评论(0) 推荐(0)
摘要:地址:http://codeforces.com/contest/1305 题意:A题写这么长,实际上意思很简单,给出两组长度相等的数,让你给出排列顺序,保证每一列上下加起来不同。 解析:很水了,小+大=大+小,根据这个,只要上下均按从小到大的顺序排列就可以了。 #include<cstdio> # 阅读全文
posted @ 2020-03-05 23:14 liyexin 阅读(174) 评论(0) 推荐(0)
摘要:http://codeforces.com/contest/1301 Dark is going to attend Motarack’s birthday. Dark decided that the gift he is going to give to Motarack is an array 阅读全文
posted @ 2020-02-17 18:08 liyexin 阅读(249) 评论(0) 推荐(0)
摘要:http://codeforces.com/contest/1303 A: 第一题给一个只有01的字符串,操作是可以删除0,结果要保证1都是挨着的。问最小操作数。 解析:特判,len=1是直接输出0。其他的就是找到第一个为1而且下一位为0的位置,以此往下找,找到第一个为1而且j!=i+1就可以了,减 阅读全文
posted @ 2020-02-14 00:24 liyexin 阅读(236) 评论(0) 推荐(0)
摘要:地址:http://codeforces.com/contest/1296/problem/C C. Yet Another Walking Robot There is a robot on a coordinate plane. Initially, the robot is located a 阅读全文
posted @ 2020-02-09 23:49 liyexin 阅读(206) 评论(0) 推荐(0)
摘要:地址:http://codeforces.com/contest/1291 A题就不写解析了,就是给一个数,是不是本身满足这个条件或者删除某些数字来达到这个条件:奇数,各个位上的数字加起来是偶数。 #include<iostream> #include<cstdio> #include<cstrin 阅读全文
posted @ 2020-02-05 22:12 liyexin 阅读(156) 评论(0) 推荐(0)
摘要:地址http://codeforces.com/contest/799 A. Carrot Cakes In some game by Playrix it takes t minutes for an oven to bake k carrot cakes, all cakes are ready 阅读全文
posted @ 2020-01-10 17:16 liyexin 阅读(317) 评论(1) 推荐(0)
摘要:链接:http://codeforces.com/contest/1265 A. Beautiful String A string is called beautiful if no two consecutive characters are equal. For example, "ababc 阅读全文
posted @ 2019-12-10 21:37 liyexin 阅读(215) 评论(0) 推荐(0)
摘要:Codeforces Round #603 (Div. 2) A. Sweet Problem A. Sweet Problem time limit per test 1 second memory limit per test 256 megabytes input standard input 阅读全文
posted @ 2019-12-06 19:11 liyexin 阅读(210) 评论(0) 推荐(0)
摘要:https://codeforces.com/problemset/problem/797/B time limit per test 1 second memory limit per test 256 megabytes input standard input output standard 阅读全文
posted @ 2019-09-27 20:54 liyexin 阅读(444) 评论(0) 推荐(0)
摘要:本题地址: https://codeforces.com/contest/1215/problem/B 本场比赛A题题解:https://www.cnblogs.com/liyexin/p/11535519.html B. The Number of Products time limit per 阅读全文
posted @ 2019-09-23 19:15 liyexin 阅读(326) 评论(0) 推荐(0)
摘要:恢复内容开始 output standard output The final match of the Berland Football Cup has been held recently. The referee has shown n yellow cards throughout the 阅读全文
posted @ 2019-09-17 17:19 liyexin 阅读(446) 评论(0) 推荐(0)
摘要:地址: https://vjudge.net/problem/27861/origin Ilya plays a card game by the following rules. A player has several cards. Each card contains two non-nega 阅读全文
posted @ 2019-09-12 16:46 liyexin 阅读(253) 评论(0) 推荐(1)