cf492C Vanya and Exams】的更多相关文章

CF492C Vanya and Exams 有了Pascal题解,来一波C++题解呀qwq.. 简单的贪心题 按b[i]从小到大排序,一个一个学科写直到达到要求即可 #include<cstdio> #include<algorithm> using namespace std; struct number { long long a,b; bool operator <(const number &x)const { return b<x.b; } } a[…
C. Vanya and Exams time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vanya wants to pass n exams and get the academic scholarship. He will get the scholarship if the average grade mark for al…
C. Vanya and Exams Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/492/problem/C Description Vanya wants to pass n exams and get the academic scholarship. He will get the scholarship if the average grade mark for all the ex…
C. Vanya and Exams time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vanya wants to pass n exams and get the academic scholarship. He will get the scholarship if the average grade mark for al…
C. Vanya and Exams time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vanya wants to pass n exams and get the academic scholarship. He will get the scholarship if the average grade mark for al…
题目链接:http://codeforces.com/problemset/problem/492/C 题目意思:给出 3 个整数:n,  r,  avg.然后有 n 行,每行有两个数:第 i 行有 ai 和 bi.表示如果写 bi 篇文章那么可以在 ai 这个分数上增加 1 分.可以增加好多次,但是前提是加完得到的分数不能超过 r.要使得 n 个exam 的分数平均分至少达到avg时需要写的最少文章是多少篇. 解决方法很简单,贪心即可. 我们当然希望写的文章越少越好,所以先对文章从小到大排序.…
A. Vanya and Cubes time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vanya got n cubes. He decided to build a pyramid from them. Vanya wants to build the pyramid as follows: the top level of…
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…
Vanya and Exams CodeForces - 492C Vanya wants to pass n exams and get the academic scholarship. He will get the scholarship if the average grade mark for all the exams is at least avg. The exam grade cannot exceed r. Vanya has passed the exams and go…
A. Vanya and Cubes time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vanya got n cubes. He decided to build a pyramid from them. Vanya wants to build the pyramid as follows: the top level of…