D. Vanya and Computer Game Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/492/problem/D Description Vanya and his friend Vova play a computer game where they need to destroy n monsters to pass a level. Vanya's character pe…
D. Vanya and Computer Game time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vanya and his friend Vova play a computer game where they need to destroy n monsters to pass a level. Vanya's cha…
D. Vanya and Computer Game time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vanya and his friend Vova play a computer game where they need to destroy n monsters to pass a level. Vanya's cha…
D. Vanya and Computer Game time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vanya and his friend Vova play a computer game where they need to destroy n monsters to pass a level. Vanya's cha…
D. Vanya and Computer Game time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vanya and his friend Vova play a computer game where they need to destroy n monsters to pass a level. Vanya's cha…
D. Vanya and Computer Game time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vanya and his friend Vova play a computer game where they need to destroy n monsters to pass a level. Vanya's cha…
http://codeforces.com/contest/492/problem/D 有时候感觉人sb还是sb,为什么题目都看不清楚? x per second, y per second... 于是我们二分second即可. 而且对每个monster都有伤害.... #include <cstdio> #include <cstring> #include <cmath> #include <string> #include <iostream&g…
Vanya and his friend Vova play a computer game where they need to destroy n monsters to pass a level. Vanya's character performs attack with frequency x hits per second and Vova's character performs attack with frequency y hits per second. Each chara…
[链接] 我是链接,点我呀:) [题意] 题意 [题解] 第一个人攻击一次需要1/x秒 第二个人攻击一次需要1/y秒 这两个数字显然都是小数. 我们可以二分最后用了多少时间来攻击. 显然这个是有单调性的,攻击时间越多的话,攻击的次数也就越多. 假设二分出来攻击的时间是mid 那么攻击的次数就是 mid/(1/x) + mid/(1/y) 但是这样显然二分出来的也是一个小数. 我们完全没有办法根据二分出来的东西判断它到底是谁的倍数. 因此我们可以这样. 我们把第一个人攻击一次和第二个人攻击一次所需…
A. Vanya and Cubes 题意: 给你n个小方块,现在要搭一个金字塔,金字塔的第i层需要 个小方块,问这n个方块最多搭几层金字塔. 分析: 根据求和公式,有,按照规律直接加就行,直到超过n. #include <cstdio> int main() { int n; scanf("%d", &n); , cnt = ; while(n > sum) { cnt++; sum += cnt * (cnt + ) / ; } if(sum > n…