voidfunc(void){inta,b; cin >> a >> b;if(a >= b) cout << a <<'\n';else{intans = (2*a - b); cout << (ans >=0? ans :0) <<'\n'; } } B 思路 因为只知道每组数目, 但不知道对应关系. 所以每次对不确定为00的按钮点击一次, 直到一次不出货. 那么可以用二分查找分界点, ...
#include <bits/stdc++.h> #define M 10001 #define N 100001 typedef long long ll; typedef std::pair<int, int> pii; int T, n; struct Pair { int x, y, sum; friend bool operator < (Pair p1, Pair p2) { if (p1.sum != p2.sum) return p1.sum < p2.sum; return std::min(...
Codeforces Round 980 div2 个人题解(A~D) Dashboard - Codeforces Round 980 (Div. 2) - Codeforces 火车头 #define _CRT_SECURE_NO_WARNINGS 1#include<algorithm>#include<array>#include<bitset>#include<cmath>#include<cstdio>#include<cstdlib>#include<cstring>#include<chrono>#include<fstream>#include...
Codeforces Round980 (Div2 A-D讲解) https://www.bilibili.com/video/BV1dPyaYiEtc/ Codeforces Round 981 (Div. 3) 题目讲解 (ABCDEFG) CF2033 https://www.bilibili.com/video/BV1Jty2YjEAe/ Codeforces Round 983 Div2 (A-D讲解) https://www.bilibili.com/video/BV1uDSfYmExZ/ Codeforces Round ...
App Codeforces Round 1005(Div.2)晚开打了,但是 1.5h AK rk27!OI 比赛实况第四十二期。 1067 2 52:06 App Codeforces Round 961 (Div. 2) 题目讲解 (CF1995 ABCD) 4688 3 01:55:50 App Codeforces Round 1004 (Div. 1) 1273 1 53:46 App Codeforces Round 988 (Div. 3) 题目讲解 ABCDEGF (...
Before contestCodeforces Round 1006 (Div. 3)23:18:54Register now » → Streams Codeforces Round 1006 Solution Discussion By aryanc403 Before stream 25:38:52 View all → → Top rated #UserRating 1 tourist 3856 2 jiangly 3747 3 orzdevinwang 3706 4 jqdai0815 3682 5 ksun48 3591...
Codeforces Round #627题解 A题: 我们发现如果任意两个奇偶性不同都不行,因为只要奇偶相同,都能够通过加2操作得到 #include<iostream>#include<queue>#include<map>#include<vector>#include<cstdio>#include<algorithm>#include<stack>#include<cstring>usingnamespacestd;...
Codeforces Round #480 (Div. 2)题解 C - Posterized 混沌的贪心。 从左往右遍历一遍,对于位置i,如果a[i]的分组被确定了,那么我们直接输出它所在的分组,否则我们从a[i]开始,递减往下找,设找到的第一个元素为x,如果x所在的Group能容得下a[i],那就容纳下a[i],将[x+1,a[i]]都和y分到一组。否则...
1352A-SumOfRoundNumbers.cpp 1352B-SameParitySummands.cpp 1352C-KthNotDivisibleByN.cpp 1352D-AliceBobAndCandies.cpp 1352E-SpecialElements.cpp 1352F-BinaryStringReconstruction.cpp 1352G-SpecialPermutation.cpp 1353A-MostUnstableArray.cpp 1353B-TwoArraysAndSwaps.cpp 1353C-BoardMoves.cpp ...
Codeforces Round #382 (Div. 2) 题目链接 AAA 题意: 有一个字符串然后给你起始位置G,终止位置T,然后中间可能还有障碍#,你一次只能走k步,问你能否走到终点位置。 思路: 模拟即可。 B 题意 现在有两座城市,n名富豪,每座城市需要d1,d2名富豪。第iii名富豪有aia_iai的财富。每座城市的财富值定义为...