· Codeforces Round 977 (Div. 2, based on COMPFEST 16 - Final Round) A-C1 · Codeforces Round #767 (Div. 2) 小结 阅读排行: · SuperSocket 2.0 的发布标志着.NET Socket 服务器框架迈入了一个全新的时代 · 全网最全!1500+ 免费、美观的前端网页模板,建站神器(包括HTML、Vue、Angular、Re...
Codeforces Round 977 (Div. 2, based on COMPFEST 16 - Final Round) A - C2 FakeDuck 臭打ACM的 来自专栏 · Codeforces日志 4 人赞同了该文章 A. Meaning Mean void solve() { int n; std::cin >> n; std::vector<int> a(n); for (int i = 0; i < n; i++) { std::cin >> a...
C1. Adjust The Presentation (Easy Version) 通过观察可以发现,比如 a 数组是 1, 2, 3, b 数组是 1 2 3 . . ., ... 是表示写什么都行,只要是 a 中出现过的数字,那么就一定可以,换句话说,就是只要 b 数组一开始能按照 a 数组中的数字顺序走一轮,那么就一定可以,为什么?额,草稿纸上模拟了几个...
x;cin>>n>>x;vector<ll>a(n);for(auto&x:a)cin>>x;map<int,multiset<ll>>mp;for(autoy:a)mp[y%x].insert(y);ll ans=0;while(true){intf=ans%x;if(mp.find(f)==mp.end()ormp[f].empty()or*mp[f].begin()>ans){cout<<ans<<'\n';return...
Codeforces Round 977 (Div. 2, based on COMPFEST 16 - Final Round) 致敬传奇调题王 HDK 本场最难崩评论 A.Meaning Mean 给定一个序列 a,每次选择 i,j (i≠j),使得其缩成一个值为 ⌊ai+aj2⌋ 的数,直至剩余一个数,求最终答案的最大值 一开始想的是最小化 ⌊ai+aj2⌋ 的损失,后来...
Tutorial of Codeforces Round 977 (Div. 2, based on COMPFEST 16 - Final Round) compfest, cpc -217 ArvinCiu 5 months ago 92 Comments (92) Write comment? Aria_Math 5 months ago, # | +27 Brute force in O(nm2)O(nm2) can pass problem D. Submission → Reply jeroenodb 5 ...
#include<iostream>#include<cstring>#include<vector>#includeusingnamespacestd;usingLL=longlong;template<constintT>structModInt{conststaticintmod=T;intx;ModInt(intx=0):x(x%mod){}ModInt(longlongx):x(int(x%mod)){}intval(){returnx;}ModIntoperator+(constModInt&a)const{intx0=x+a.x;retur...
Codeforces Round 902 (Div. 2, based on COMPFEST 15 - Final Round) A. Goals of Victory 题意: 思路: 代码: B. Helmets in Night Light 题意: 思路: 代码: C. Joyboard 题意: 思路: 代码: D. Effects of Anti Pimples 代码: __EOF__ 本文作者: du463 本文链接: https://www.cnblogs....
Codeforces Round 982 (Div. 2) A-D1题解 Journ...发表于小白打co... Educational Codeforces Round 134 (Rated for Div. 2) A - E 闲言这次个人感觉AB两题过得比之前快,C WA了一发,过了;D WA两发,没过。就润去睡觉了。 代码附在后面 A容易分析出题中的情况有1~4个字母(不同的) 1个,答案显然...
将以上思路提交后,发现 wa on 6,原来还有一个细节没有考虑到。 1 1 3 3 1 3 1 3 虽然1 和3 看上去(在一开始)都可以随意取,但是最终 1 的颜色和 3 的颜色必须一致。 做以下考虑:曾经在同一序列(队列)中的,最终必须取同一颜色,这可以用并查集维护,每次将新加元素和队首元素连边就行了。 代码 代码待...