7-27 Codeforces Round #499 (Div. 2)】的更多相关文章

Codeforces Round #499 (Div. 2) https://codeforces.com/contest/1011 A #include <bits/stdc++.h> using namespace std; ]; string s; int main(){ ; sort(a,a+n); ,p=-;i<n&&j<k;i++){ <a[i])r+=a[i],j++,p=a[i]; } cout<<(j==k?r:-); } B #…
Codeforces Round #499 (Div. 1) 这场本来想和同学一起打\(\rm virtual\ contest\)的,结果有事耽搁了,之后又陆陆续续写了些,就综合起来发一篇题解. B.Rocket 极其简单的一道交互题,有些位置会说反的,那么就选一个数来询问直接选出所有的这样的位置 显然,选择\(\rm 1\)和\(\rm m\)都可以,选择完之后直接二分就行了 代码: #include<cstdio> #include<iostream> #include<…
Codeforces Round #499 (Div. 1) https://codeforces.com/contest/1010 为啥我\(\rm Div.1\)能\(A4\)题还是\(\rm specialist....\) A. Fly 二分答案,送分题. #include<bits/stdc++.h> using namespace std; void read(int &x) { x=0;int f=1;char ch=getchar(); for(;!isdigit(ch…
Codeforces Round #499 (Div. 1) F. Tree 题目链接 \(\rm CodeForces\):https://codeforces.com/contest/1010/problem/F Solution 设\(v_i\)表示第\(i\)个点的果子数,设\(b_i=v_i-\sum_{x\in son}v_x\),显然依题意要满足\(b_i\geqslant 0\). 根据差分的性质我们可以得到\(\sum b_i=x\). 假设我们硬点树上剩下了\(m\)个点,则…
C. Fly 链接:http://codeforces.com/group/1EzrFFyOc0/contest/1011/problem/C 题型:binary search .math. 题意:总共有n个星球,飞船从地球起飞经过n-2个星球(在每个星球上做降落.起飞的动作)到达火星,在火星上同样降落起飞,然后直接返回地球做降落.每个星球起飞所需的燃料质量为ai,降落所需要的燃料质量为bi.飞船本身载重为m,附加燃料质量为所求值.问至少需要多少质量的燃料使得地球能做完整的往返运动,精度为1e-…
题目: http://codeforces.com/contest/1011/problem/D This is an interactive problem. Natasha is going to fly to Mars. Finally, Natasha sat in the rocket. She flies, flies... but gets bored. She wishes to arrive to Mars already! So she decides to find som…
题目 http://codeforces.com/contest/1011/problem/C Natasha is going to fly on a rocket to Mars and return to Earth. Also, on the way to Mars, she will land on n−2n−2 intermediate planets. Formally: we number all the planets from 11 to nn. 11 is Earth, n…
CF链接  http://codeforces.com/contest/1011/problem/A Natasha is going to fly to Mars. She needs to build a rocket, which consists of several stages in some order. Each of the stages is defined by a lowercase Latin letter. This way, the rocket can be de…
C. Fly time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Natasha is going to fly on a rocket to Mars and return to Earth. Also, on the way to Mars, she will land on n−2n−2 intermediate planet…
Natasha is planning an expedition to Mars for nn people. One of the important tasks is to provide food for each participant. The warehouse has mm daily food packages. Each package has some food type aiai . Each participant must eat exactly one food p…