Codeforces Round #601 (Div. 2) ---- 比赛传送门 周二晚因为身体不适鸽了,补题补题 A // http://codeforces.com/contest/1255/problem/A /* 签到题 简单的贪心题 本考虑过是否有先小于再加上去会更小的情况 但两种情况恰好步数是一样的 */ #include<iostream> #include<cstdio> #include<cmath> using namespace std; int…
#define HAVE_STRUCT_TIMESPEC #include<bits/stdc++.h> using namespace std; vector<char>ans; ][]; int main(){ ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ';++i) ans.emplace_back(i); for(int i='A';i<='Z';++i) ans.emplace_back(i…
A. Combination Lock time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output Scrooge McDuck keeps his most treasured savings in a home safe with a combination lock. Each time he wants to put there…
A. Joysticks time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output Friends are going to play console. They have two joysticks and only one charger for them. Initially first joystick is charged at…
https://codeforces.com/contest/1121/problem/D 题意 给你一个m(<=5e5)个数的序列,选择删除某些数,使得剩下的数按每组k个数以此分成n组(n*k<=m),存在只要一组满足和目标集合s(|s|<=k)匹配(即集合中存在的数,组内一定存在) 题解 重点:找出至少一组满足要求的数 假设[l,r]内满足要求,还需要满足:\((l-1)/k*k+(m-r)/k*k>=k*(n-1)\),可以用双指针,对于每个l可以处理出最小的r满足要求 这样…
A. Snacktower 题目连接: http://codeforces.com/contest/767/problem/A Description According to an old legeng, a long time ago Ankh-Morpork residents did something wrong to miss Fortune, and she cursed them. She said that at some time n snacks of distinct s…
传送门 A. Changing Volume 签到. Code /* * Author: heyuhhh * Created Time: 2019/11/19 22:37:33 */ #include <bits/stdc++.h> #define MP make_pair #define fi first #define se second #define sz(x) (int)(x).size() #define all(x) (x).begin(), (x).end() #define…
链接:http://codeforces.com/contest/404/problem/B B. Marathon time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Valera takes part in the Berland Marathon. The marathon race starts at the stadium…
http://codeforces.com/contest/714/problem/C 题目大意:有t个询问,每个询问有三种操作 ①加入一个数值为a[i]的数字 ②消除一个数值为a[i]的数字 ③给一个字符串s,s中分别表示0和1,0表示目前该位为偶数,1表示目前该位为奇数.然后询问目前数组中和s每一位能匹配的个数.如果数组中目前的该数字比s的len要短,那么我们就在s的左边一直加0.如果数组中的目前的数字比s的len长,那么就在该数组的左边一直加0就好了.问能和s匹配的有几个,并输出 思路:我…
C. Bus time limit per test: 2 seconds memory limit per test: 256 megabytes input: standard input output: standard output A bus moves along the coordinate line Ox from the point x = 0 to the point x = a. After starting from the point x = 0, it reaches…