Pasha and Tea】的更多相关文章

B. Pasha and Tea Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/557/problem/B Description Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and…
B. Pasha and Tea time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w millilit…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups,…
Pasha and Tea time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters…
题目链接:http://codeforces.com/problemset/problem/557/B 题目意思:有 2n 个茶杯,规定第 i 个茶杯最多只能装 ai 毫升的水.现在给出 w 毫升的水,需要把这 w 毫升(可以不用光)的水倒入到这 2n 个茶杯中,使得分给 n 个男的每个水杯的水恰好是 n 个女的2倍(注意,n 个男的水杯装的水是一样的,n 个女也是).现在问的是,怎样使得 2n 个杯装的水最多,求出这个值. ***********************************…
题 题意 总共有 w 克蛋糕,2n 个盘子,第 i 个盘子容量为 ai ,n 个女孩和 n 个男孩,男孩得到的是女孩得到的蛋糕的两倍,求他们得到蛋糕的最大值. 分析 把盘子从小到大排序,然后 女生得到的蛋糕总量是 n*min(最小的盘子,第n+1小的盘子/2,w/(3n)). 答案就是女生得到的蛋糕的3倍. 代码 #include<cstdio> #include<algorithm> using namespace std; int n,a[1000005]; double w,…
B. Pasha and Tea time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w millilit…
我仅仅想说还好我没有放弃,还好我坚持下来了. 最终变成蓝名了,或许这对非常多人来说并不算什么.可是对于一个打了这么多场才好不easy加分的人来说,我真的有点激动. 心脏的难受或许有点是由于晚上做题时太激动了,看别人过得那么快自己也紧张了. 后来看到有非常多大神给我的建议是,刚開始学习的人,手速并非唯一重要的关键,掌握算法,一步步系统的完好它才是最重要的. 所以这一回也没有太紧张,也没有做一题看一下排名. 然后居然第一次进了前1000.rating一下子加了220多. 希望这是一个好的开端,我还想…
A. Ilya and Diplomas 思路:水题了, 随随便便枚举一下,分情况讨论一下就OK了. code: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <algorithm> #include <iostream> #include <cstring> #include <cmath> #define inf 1000000…
A. Ilya and Diplomas time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Soon a school Olympiad in Informatics will be held in Berland, n schoolchildren will participate there. At a meeting of…