一. 原题链接 https://codeforces.com/contest/1494/problem/B   二. 题意 + 题解: 没看懂题目, 懵了好久, 先狡辩一下当时误解的句子, 英语是硬伤了, 呜呜 exactly U cells in the top row are black; //意为 : 最上行恰好有U个黑块 Note that you can color zero cells black and leave every cell white. // 意为 : 你可以一个方格…
CF Round #551 (Div. 2) D 链接 https://codeforces.com/contest/1153/problem/D 思路 不考虑赋值和贪心,考虑排名. 设\(dp_i\)是子树i中的i是第dp_i大的(相同大小放在后面). \(opt=1,dp_u=max(dp[v])(v\in G)\) \(opt=0,dp_u=\sum\limits _{v\in G}{dp[v]}\) dp[1]是1到k中第dp[1]大的,就是k-dp[1]+1 然后\(ans=k-dp[…
前言:没想到那么快就打了第二场,题目难度比CF Round #509 (Div. 2)这场要难些,不过我依旧菜,这场更是被\(D\)题卡了,最后\(C\)题都来不及敲了..最后才\(A\)了\(3\)题,幸好\(Rating\)没掉. A. Benches Description 有\(n\)个位置,给出每个位置上原本有\(a[i]\)个人.现有\(m\)个人,把他们安排到这\(n\)个位置上,设安排完后位置上人数最多的位置有\(k\)个人,求最大的\(k\)和最小的\(k\). Solutio…
CF Round #524 Div.2 - 竞赛题解 不容易CF有一场下午的比赛,开心的和一个神犇一起报了名 被虐爆--前两题水过去,第三题卡了好久,第四题毫无头绪QwQ Codeforces 传送门 Tab, 先写了ABC题,后面的之后再补 QwQ 『解析』 A-Petya and Origami 读懂题意就会做--根据题意可以求出3种"sheet"各自需要的数量,然后每一种的数量除以k向上取整后求和就是答案. B-Margarite and the best present 简单的…
题目传送门 /* 题意:给出一系列读者出行的记录,+表示一个读者进入,-表示一个读者离开,可能之前已经有读者在图书馆 构造:now记录当前图书馆人数,sz记录最小的容量,in数组标记进去的读者,分情况讨论一下 */ /************************************************ * Author :Running_Time * Created Time :2015-8-6 0:23:37 * File Name :B.cpp *****************…
题目传送门 /* 水题:这题唯一要注意的是要用double,princess可能在一个小时之内被dragon赶上 */ #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> #include <vector> #include <map> using namespace std; ; const int INF = 0x3f3f3f3f;…
CF Round #600 (Div 2) 解题报告(A~E) A:Single Push 采用差分的思想,让\(b-a=c\),然后观察\(c\)序列是不是一个满足要求的序列 #include<bits/stdc++.h> using namespace std; const int maxn = 1e5 + 10; int T, n; int a[maxn], b[maxn]; int c[maxn]; int main() { cin >> T; while(T--) { s…
题目链接,点击一下 Round#273 Div.2 ================== problem A Initial Bet ================== 很简单,打了两三场的cf第一次在10分钟内过题 判平均数,且注意b为正 #include<iostream> using namespace std; int main() { ,n; ; i < ; i++) { cin>>n; res += n; } ; == && b) cout<…
前言:第一次打\(CF\),因为经验不足以及英语水平很烂,即便在机房大佬的带领下也是花了好久才读懂题目..\(A\)题直到\(11\)分钟才\(A\),题目一共才做了\(4\)题,太菜了.. A. Heist Description 有\(n\)个正整数,设最小的数为\(minn\),最大的数为\(maxn\),求\(minn\sim maxn\)的正整数连续区间里有多少数不属于这\(n\)个正整数. Solution 显然答案就是\(maxn-minn-n+1\) #include<cstdi…
Brain's Photos 题目链接: http://codeforces.com/contest/707/problem/A Description Small, but very brave, mouse Brain was not accepted to summer school of young villains. He was upset and decided to postpone his plans of taking over the world, but to becom…