C cpp #include<bits/stdc++.h>usingnamespacestd;constintN=2e5+5;intw[N];intmain(){intk, n; cin>>k>>n;for(inti=1; i<=n; i++) cin>>w[i];intres=0;for(inti=1; i<=n; i++){if(i==1) res=max(res, w[1]+k-w[n]);elseres=max(res, w[i]-w[i-1]);}cout<<k...
AtCoder Beginner Contest 090 题目链接:https://abc090.contest.atcoder.jp/ A题题解:水题..直接输出左上对角线即可。 AC代码: B题题意:求给...AtCoder Beginner Contest 164题解 题目链接 A.Sheep and Wolves 题意: s个羊,w个狼,羊如果多是安全的,否则是不安全的s个羊,w个狼,羊如果多是安全的...
AtCoder Beginner Contest 160题解 第一次打atcoder,感觉beginner场和cfdiv3难度差不多,就是A-E难度和F差距有点大,而且居然#ifndef ONLINE_JUDGE读写入文件会RE,白给了2发罚时 A. 题意:给一个长度为6的字符串当第3位和第4位相同并且第5位和第6位相同时输出Yes否则输出No 题解:字符串模拟题 View Code ...
AtCoder Beginner Contest 160--E - Red and Green Apples(贪心),ABC160-E-RedandGreenApples#include<bits/stdc++.h>usingnamespacestd;typedeflonglongll;intmain(){llX,Y,A,B,C;cin>>X>>Y>>A>>B>>C;vector<ll>...
AtCoder Beginner Contest 160–E - Red and Green Apples 题目传送门 #include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll X,Y,A,B,C; cin>>X>>Y>>A>>B>>C; vector<ll>a(A),b(B),c(C); for(int i=0;i<A;i++) cin>>a[i]; for(int i=0;...
·AtCoder Beginner Contest (ABC) 这是最频繁且最简单的入门赛,通常情况下每月至少举行2次。2019年4月27日(含)之前,每场比赛共4题,时长100分钟,满分1000分且Rating超过1199的选手不计Rating值。自2019年5月19日起改版升级为6道题目,时长不变,满分2100分且Rating值超过1999的选手不计Rating值。改版之后比赛质量...
AtCoder Beginner Contest 100 完整解题报告 题目链接 https://beta.atcoder.jp/contests/abc100/tasks A题 #include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; cout << ((a <= 8 && b <= 8) ? "Yay!" : ":(") << endl;...
Did you enjoy the AtCoder Beginner Contest 128? A Japanese editorial is already out, but unfortunately there is no English editorial, so I translated it into English experimentally. Note that this is an unofficial one; AtCoder has no responsibility for this editorial. Also, I didn't do ...
AtCoder Beginner Contest 160 F - Distributing Integers (树的拓扑序数量,换根 DP) Jackle XCPC铁牌,啥也不会 atcoder.jp/contests/abc 题意 给定一棵 n 个结点的数,你要做如下操作: 先把1 写在k 号点 然后依次把 2,3,...,n 这些数写到某个选择的结点上,这个结点必须和已经被写过数字的点相连...
G - Mediator(启发式合并 + lca) A - Past ABCs #include<bits/stdc++.h>usingnamespacestd;voidsolve(){strings;cin>>s;if(s[3]>='4'||s.substr(3)=="316"||s.substr(3)=="000"||(s[3]=='3'&&s[4]>='5'))cout<<"No\n";elsecout<<"Yes\n";}intmain(){ios::sync_with_stdio...