--------【训练赛】
训练赛记录
Dream-chasing ant
鄙人水平不高,建立博客初心只是想留一份回忆给自己。
展开
-
Educational Codeforces Round 93 (Rated for Div. 2)ABCD
A. Bad Triangle题意: 问是否有不能组成三角形的情况思路:因为是有序的,所以用最小的两个和最大的组合查看是否是三角形即可传送门#include<bits/stdc++.h>using namespace std;const int maxn=5e4+100;int t;int a[maxn];int main(){ scanf("%d",&t); while(t--){ int n;scanf("%d",&n); for(int i原创 2020-08-15 20:31:57 · 181 阅读 · 1 评论 -
CodeForces - 125ABC
文章目录A - Measuring Lengths in Baden CodeForces - 125AB - Simple XML CodeForces - 125BC - Hobbits' Party CodeForces - 125CA - Measuring Lengths in Baden CodeForces - 125A进制转换,但要注意一个细节,n最后等于2时,y要加1,y等于12,x要加1传送门#include<bits/stdc++.h>using namesp原创 2020-08-14 14:29:45 · 211 阅读 · 0 评论 -
Codeforces Round #664 (Div. 2)ABCD
文章目录A. Boboniu Likes to Color BallsB. Boboniu Plays ChessC. Boboniu and Bit OperationsA. Boboniu Likes to Color Balls传送门题意:给出r个红球,g个绿球,b个蓝球,w个白球。每消耗红、绿、蓝球各1个,白球数量增加3个。最后问能不能组成一个回文串思路:如果球数只有一个奇数次或者没有奇数次球,那么能组成回文串。当进行一次消耗红、绿、蓝球各1个,白球数量增加3个后,球数都各自由奇变偶,由偶原创 2020-08-13 21:36:56 · 98 阅读 · 0 评论 -
智算之道2020复赛题目
#include<bits/stdc++.h>using namespace std;typedef long long ll;const int maxn=2e3+10;ll dp[maxn];struct node{ int x,y;}a[maxn];bool cmp(const node&a,const node&b){ if(a.x!=b.x) return a.x<b.x; else a.y<b.y;}int main(){ ..原创 2020-08-12 10:28:36 · 168 阅读 · 0 评论 -
Codeforces Round #662 (Div. 2)AB
文章目录A. Rainbow Dash, Fluttershy and Chess ColoringB. Applejack and StoragesA. Rainbow Dash, Fluttershy and Chess Coloring传送门规律题。适当的时候也要大胆猜测#include<bits/stdc++.h>using namespace std;int t;int main(){ scanf("%d",&t); while(t--){ int n原创 2020-08-10 11:19:35 · 85 阅读 · 0 评论 -
Codeforces Round #661 (Div. 3)ABCD
文章目录前言A. Remove SmallestB. Gifts FixingC. Boats CompetitionD. Binary String To Subsequences前言捋一下ABC的思路,补出D题A. Remove Smallest#include<bits/stdc++.h>using namespace std;const int maxn=100;int a[maxn],t;int main(){ scanf("%d",&t); while原创 2020-08-08 21:31:14 · 93 阅读 · 0 评论 -
Codeforces Round #660 (Div. 2)AB
文章目录ABA传送门题意:定义了一个x,x是两个不同的素数相乘,n是由4个不同的数相加得到的,其中3个是素数,1个为正整数。思路:小于31肯定不符合条件。固定3个x,让第四个数不与这三个数相同即可。再给三个重复的特殊情况即可#include<bits/stdc++.h>using namespace std;int t;int num=30;int main(){ scanf("%d",&t); while(t--){ int n;scanf("%d",&原创 2020-08-04 21:18:47 · 577 阅读 · 0 评论 -
Educational Codeforces Round 92 (Rated for Div. 2)ABC
文章目录AB——Array WalkC. Good StringA传送门这道题注意的就是l<=x<y<=r,l<=LCM(x,y)<=r.那么我们就让x=l就可以了,lcm(x,2x)==2x,让其lcm尽可能小#include<bits/stdc++.h>using namespace std;int t;int main(){ scanf("%d",&t); while(t--){ int x,y;scanf("%d%d",原创 2020-08-04 17:22:17 · 77 阅读 · 0 评论 -
CodeForces - 53ABCD
文章目录ABCD传送门这道题要注意什么是字典序就可以了。字典序:显然的做法是先按照第一个字母、以 a、b、c……z 的顺序排列;如果第一个字母一样,那么比较第二个、第三个乃至后面的字母。如果比到最后两个单词不一样长(比如,sigh 和 sight),那么把短者排在前。A#include<bits/stdc++.h>using namespace std;const int maxn=300;string s,s1;int n;string a[maxn];bool ok原创 2020-07-11 16:43:36 · 110 阅读 · 0 评论 -
CodeForces - 525ABC
文章目录ABC传送门A奇数位置是钥匙类型,偶数位置是门类型,如果是相同字母那么这把钥匙就可以开门,若不同就不能开门。问最少要自备多少钥匙。这道题的关键就是即使当前钥匙和门不能匹配,但钥匙可以存起来,以后使用#include<bits/stdc++.h>using namespace std;int n;string a;int sum;int s[200];int main(){ scanf("%d",&n); cin>>a; for(int原创 2020-07-11 10:27:29 · 91 阅读 · 0 评论 -
CodeForces - 136
文章目录ABC传送门AA题桶排序暴力也可以,n很小#include<bits/stdc++.h>using namespace std;const int maxn=200;int a[maxn],s[maxn],n;int main(){ scanf("%d",&n); for(int i=1;i<=n;i++) { scanf("%d",&a[i]); s[a[i]]=i; } for(int i=1;i<=n;i++)原创 2020-07-08 17:13:26 · 121 阅读 · 0 评论 -
CodeForces - 522
文章目录ABA我的思路是,现将字母都换成小写。由于n很小,所以可以直接暴力,挨个找出。#include<bits/stdc++.h>using namespace std;string a[300],b[300];int n;int sum;int main() { cin>>n; for(int i=1;i<=n;i++) { string c; cin>>a[i]>>c>>b[i]; } for(原创 2020-07-06 22:19:41 · 114 阅读 · 0 评论 -
CodeForces - 1327ABC
文章目录A - Sum of Odd Integers CodeForces - 1327AB - Princesses and Princes CodeForces - 1327BC - Game with Chips CodeForces - 1327C时间:2020 03 26传送门这次比赛又做崩了,下次如果wa了的话,3分钟后在提交第二次A - Sum of Odd Integ...原创 2020-03-26 22:20:34 · 115 阅读 · 0 评论 -
20200323(ABC)
文章目录A - Xenia and Divisors CodeForces - 342AC - Cupboard and Balloons CodeForces - 342C传送门今天比赛有点崩A - Xenia and Divisors CodeForces - 342A一共就三种情况,我这么写或许是有点麻烦。还有是要注意,用node定义map,node的变量都需要重载排个序#...原创 2020-03-23 22:24:59 · 112 阅读 · 0 评论 -
20200321(ABC)
文章目录A - Joysticks CodeForces - 651AB - Beautiful Paintings CodeForces - 651BC - Watchmen CodeForces - 651C传送门A - Joysticks CodeForces - 651A这道题的题意是有两个操纵杆,它们分别有电量,每分钟一个充1%,一个降2%,两个操纵杆最多能撑几分钟(一个操纵杆到...原创 2020-03-21 21:45:05 · 85 阅读 · 0 评论 -
20200320(DEF)
文章目录A - Bishwock CodeForces - 991D传送门A - Bishwock CodeForces - 991D这题说实话费了我好大功夫,参考了一些题解,都没有把模拟这道题最重要的一环说的很明白,那就是贪心,需要把朝左的先加,然后在算向右的#include<bits/stdc++.h>using namespace std;const int ma...原创 2020-03-21 09:37:33 · 86 阅读 · 0 评论 -
20200319(ABC)
文章目录A - If at first you don't succeed... CodeForces - 991AB - Getting an A CodeForces - 991BC - Candies CodeForces - 991C传送门A - If at first you don’t succeed… CodeForces - 991A容斥原理但小心数据,因为题目中a、b、...原创 2020-03-19 22:19:46 · 304 阅读 · 0 评论 -
20200314(ABC)
传送门文章目录A - Display Size CodeForces - 747AB - Mammoth's Genome Decoding CodeForces - 747BA - Display Size CodeForces - 747A这道题思路很清晰,就是求因子的差最小#include<bits/stdc++.h>using namespace std;int...原创 2020-03-18 08:21:53 · 60 阅读 · 0 评论 -
20200306(ABC)
文章目录A - Codehorses T-shirts CodeForces - 1000AC - Covered Points Count CodeForces - 1000C传送门A - Codehorses T-shirts CodeForces - 1000A题意:给了去年一些尺寸的字符号,给了今年一些尺寸的字符号,问最少有多少修改,使去年的字符号全部变成今年的字符号。**思路:*...原创 2020-03-10 21:42:19 · 96 阅读 · 0 评论 -
20200309(ABC)
文章目录A - Balloons CodeForces - 998AB - Cutting CodeForces - 998BC - Convert to Ones CodeForces - 998C传送门A - Balloons CodeForces - 998A题意:a和b在玩游戏,他们买了n个泡泡盒子,每个泡泡盒子有a[i]个泡泡。问有没有一种情况:a、b至少都有一个盒子,但泡泡的数...原创 2020-03-10 15:59:45 · 322 阅读 · 0 评论 -
20200303(ABC)
传送门文章目录A - Case of the Zeros and Ones CodeForces - 556AB - Case of Fake Numbers CodeForces - 556BC - Case of Matryoshkas CodeForces - 556CA - Case of the Zeros and Ones CodeForces - 556A#include<...原创 2020-03-06 22:07:29 · 55 阅读 · 0 评论 -
20200301(ABC)
文章目录A - Inna and Choose OptionsB - Inna and New Matrix of Candies传送门A - Inna and Choose Options这道题就是一个模拟题#include<bits/stdc++.h>using namespace std;const int maxn=20;char a[maxn][maxn];i...原创 2020-03-01 22:32:47 · 91 阅读 · 0 评论 -
20200228(ABC)
文章目录A - Shell Game CodeForces - 777AB - Game of Credit Cards CodeForces - 777BC - Alyona and Spreadsheet CodeForces - 777CA - Shell Game CodeForces - 777A这道题要找到规律,否则暴力就会超时。周期是6#include<bits/std...原创 2020-02-29 10:09:50 · 91 阅读 · 0 评论 -
UCF Local Programming Contest 2015
文章目录A. Find the TwinsB. Medal RankingC. Brownies vs. Candies vs. CookiesD. Lemonade StandE. Rain GaugeA. Find the Twins#include<cstdio>#include<iostream>#include<algorithm>using...原创 2020-02-27 23:14:33 · 234 阅读 · 0 评论 -
20200226(ABC)
文章目录A - Two ProblemsB - Game on PaperC - Photographer传送门A - Two Problems抠细节一定要考虑特殊的值和特殊的情况#include<bits/stdc++.h>using namespace std;int x,t,a,b,da,db;bool ok=false;int main(){ scanf("...原创 2020-02-27 17:04:05 · 136 阅读 · 0 评论 -
20200224(ABC)
文章目录A - Rank List CodeForces - 166AC - Median CodeForces - 166C传送门A - Rank List CodeForces - 166A题目大意是有一个比赛。有n个队伍,根据他们的问题数量和总罚点球时间进行排名。数据相同仍有先后顺序,问第K名,数据相同有几个。这道题的题意,比赛时也是没有理解清楚#include<bits/s...原创 2020-02-27 16:05:22 · 106 阅读 · 0 评论 -
20200222(ABC)
文章目录A - Card Game CodeForces - 106AB - Choosing Laptop CodeForces - 106BC - Buns CodeForces - 106C传送门A - Card Game CodeForces - 106A理解题意非常重要第一套牌如果是王牌,第二套牌不是王牌,一定输出YES第一套牌不是王牌,第二套牌是王牌,一定输出NO如果两种套...原创 2020-02-25 22:26:07 · 71 阅读 · 0 评论 -
20200220(ABC)
文章目录A - Petya and JavaB - Petya and Countryside传送门A - Petya and Java这道题的题意是判断数是byte、short、int、long、Bingter的范围(1)首先这个数不能用long long 输入,所以想到了字符串或者字母(2)然后题目也给出了范围,想到可以用字典序来比较两个字符串的大小(3)1245和2按照字典序是2...原创 2020-02-22 11:39:59 · 92 阅读 · 0 评论 -
SDNU_ACM_ICPC_2020_Winter_Practice_4th [Reproduced]
文章目录B - So Easy!C - Reading comprehension HDU - 4990H - TriangleI - Birthday ParadoxK - Reverse a SubstringL - Game with Telephone NumbersM - Alarm Clocks EverywhereB - So Easy!思路:共轭矩阵的构造C - Readin...原创 2020-02-05 09:26:05 · 137 阅读 · 0 评论 -
凉脾的比赛
文章目录A - DRM MessagesB - Game of ThrownsA - DRM Messages这道题主要是找两个字符串的有种联系#include<cstdio>#include<iostream>#include<cstring>using namespace std;int sum,sum_;int main(){ strin...原创 2020-01-22 17:41:03 · 80 阅读 · 0 评论 -
2019年山东师范大学停训赛
文章目录1001 Zeckendorf(规律)1003 Interstellar1006 柳予欣的舔狗行为(暴力)1007.柳予欣和她女朋友的购物计划1008 柳予欣不想挂科1009 柳予欣的女朋友们在分享水果(签到)1010.FFFFFunctions1001 Zeckendorf(规律)这道题首先要知道斐波那契数列是什么再一个得知道斐波那契数列到最后数目非常大,long long 的...原创 2020-01-19 17:21:48 · 195 阅读 · 0 评论 -
2019年广东工业大学新生赛
文章目录A-原初的信纸B-骑士的对决C-秘密的议会D-城市的税金A-原初的信纸这道题用到了快排#include<iostream>#include<algorithm>using namespace std;const int maxn=1e4+10;int s[maxn];int t;int n;int main(){ cin>>t...原创 2020-01-18 17:46:17 · 761 阅读 · 0 评论 -
凉肝的比赛
文章目录B - Just Eat It!B - Just Eat It!这道题是个经典的DP题。求连续最大子段和(1)如何理解 当前子序碰到 a[i]<0 加不加到子序中(2)如果将a[i]加入到sum中,sum仍然>0,那么加入是有意义的,否则没有意义,即是加入a[i] ,a[i]<0使得sum减小,但我们已经记录上一个sum作为最大的自序和,并且加入a[i]后,a[...原创 2020-01-17 09:42:22 · 88 阅读 · 0 评论 -
凉心的比赛(一)
凉心的比赛(一)线段的包含关系线段的包含关系这题我看很像之前贪心专项里的一个题,我自己独立做出来了,比赛时没看先用结构体存储数据,用sort对l排序,再用个栈判断r是否符合。#include<iostream>#include<cstdio>#include<algorithm>#include<stack>using namespa...原创 2020-01-15 16:58:01 · 87 阅读 · 0 评论