模拟 首先可以求出 0 和 1 的个数 之后按照01 10 的个数贪心安排 细节太多 错的都要哭了 #include<bits/stdc++.h> using namespace std; int main(){ int a,b,c,d; while(~scanf("%d %d %d %d",&a,&b,&c,&d)) { int suc = 1; int t1,t2; t1 = sqrt(2*a); t2 = sqrt(2*d); t1 +…
D. Recover the String time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output For each string s consisting of characters '0' and '1' one can define four integers a00, a01, a10 and a11, where axy is…
B. Recover the String 题目连接: http://www.codeforces.com/contest/708/problem/B Description For each string s consisting of characters '0' and '1' one can define four integers a00, a01, a10 and a11, where axy is the number of subsequences of length 2 of…
2017-08-25 15:32:14 writer:pprp 题目: B. Rectangles time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given n × m table. Each cell of the table is colored white or black. Find the numbe…
·题目:D. Interactive LowerBound ·英文题,述大意:       有一个长度为n(n<=50000)的单链表,里面的元素是递增的.链表存储在一个数组里面,给出长度n.表头在数组的下标和一个值w.题目要求求出链表中大于等于w值的元素中的最小元素.注意,这道题是一道interactive.由于链表是未知的,最多可以进行1999个询问,询问形式:?i.表示询问数组下标为i,询问后,会得到一个答案组(val,Next),表示询问的元素是val,链表下一位所在的数组下标是Next…
#include <iostream> using namespace std; ]; int main() { int n, b, d; cin >> n >> b >> d; ; i <= n; i++) { cin >> a[i]; } , tmp = ; ; i <= n; i++) { if (a[i] > b) { continue; } tmp += a[i]; if (tmp > d) { tmp = ;…
虽然打的时候是深夜但是状态比较好 但还是犯了好多错误..加分场愣是打成了降分场 ABC都比较水 一会敲完去看D 很快的就想出了求0和1个数的办法 然后一直wa在第四组..快结束的时候B因为低级错误被hack了...做完B想出了D的正解企图绝杀..然而还是失败了.. 想了想还是由于自己不够认真吧..手速做完前三题 看着能涨分的名次就不太努力的做D了..中间还水了一下群..浪费了很多时间 导致最后没有能够完成D A n个数 大于b被抛弃 不然就加入容器 如果容器中的和大于d 清理容器 直接模拟就好…
Description Vasya takes part in the orienteering competition. There are n checkpoints located along the line at coordinates x1, x2, ..., xn. Vasya starts at the point with coordinate a. His goal is to visit at least n - 1 checkpoint in order to finis…
Description Kolya is going to make fresh orange juice. He has n oranges of sizes a1, a2, ..., an. Kolya will put them in the juicer in the fixed order, starting with orange of size a1, then orange of size a2 and so on. To be put in the juicer the ora…
rating又掉下去了.好不容易蓝了.... A..没读懂题,wa了好几次,明天问队友补上... B. Checkpoints 题意:一条直线上n个点x1,x2...xn,现在在位置a,求要经过任意n-1个点的最小路程 题解:分类讨论,乱搞搞总会出来的,我大概写的很笨…… #include <bits/stdc++.h> using namespace std; typedef long long ll; ]; ll cal(ll x, ll a, ll z) { +(z-a) , (z-a)…