周赛Problem 1108: 蛋糕(二分)】的更多相关文章

1108: 蛋糕 Time Limit: 1 Sec  Memory Limit: 128 MB Submit: 17  Solved: 4 Description 杨神打代码打得有点疲倦,于是他想要开始做蛋糕.若某一种蛋糕需要有n种材料,然后每种材料需要ai 克,杨神手里有每种材料bi克,而且因为杨神有多年积蓄的神奇粉末,每一克神奇粉末可以代替任何一种材料1克.然后他仙子啊纠结,自己的这些材料加上神奇粉末,最多可以做多少个蛋糕.就靠你们了. Input 有多组数据不超过110组. 每组数据第一…
Problem 1021: 分蛋糕 Time Limits:  1000 MS   Memory Limits:  65536 KB 64-bit interger IO format:  %lld   Java class name:  Main Description 今天欧文出新品,筱丽学姐请实验室大家吃蛋糕体积为m,mm,m为整数,她将蛋糕平分成了mm块,每块体积为11,但她要求每个人吃nknk块,每种情况下nn相同,且相同的kk的个数小于nn,n≠1,k≠0n≠1,k≠0,即可以从mm…
Problem You are waiting in a long line to get a haircut at a trendy barber shop. The shop has B barbers on duty, and they are numbered 1 through B. It always takes the kth barber exactly Mk minutes to cut a customer's hair, and a barber can only cut…
Problem 1025: Hkhv love spent money Time Limits:  1000 MS   Memory Limits:  65536 KB 64-bit interger IO format:  %lld   Java class name:  Main Description Hkhv喜欢花钱,尤其是给他girl friend花钱.现在有n天,每天他花了ai元(i在1到n之间). 他现在想知道第i天到第j天之间哪天花费的钱最少,输出最少的钱. Input 输入一个…
Problem F Time Limit : 3000/1000ms (Java/Other)   Memory Limit : 32768/32768K (Java/Other) Total Submission(s) : 54   Accepted Submission(s) : 6 Font: Times New Roman | Verdana | Georgia Font Size: ← → Problem Description 在网络课程上,我学到了很多有关IP的知识.IP全称叫网际…
题目链接 思路 想到了,但是木写对啊....代码 各种bug,写的乱死了.... 输出最靠前的,比较折腾... #include <cstdio> #include <cstring> #include <algorithm> #include <iostream> #include <cmath> #include <map> using namespace std; #define N 501000 #define LL __in…
#include<iostream> #include<vector> #include<algorithm> using namespace std; struct GT_cls //创建函数对象 { public: GT_cls():a(t){} bool operator()(int x) { return x>a; } private: int a; }; int main() { int T,N,M; cin>>T; ; i<T; i+…
http://wikioi.com/problem/1108/ 这题有点变态,因为他根本没有策略! 还是说这题不是实时的?反正这题很变态,是在一个时间段同时消除所有的行列斜边,同一时间!!!!!! 所以直接模拟找出所有这些行列就行了. #include <cstdio> #include <cstring> #include <cmath> #include <string> #include <iostream> #include <al…
题目:http://poj.org/problem?id=3273 二分枚举,据说是经典题,看了题解才做的,暂时还没有完全理解.. #include <stdio.h> #include <string.h> int n, m; ]; bool judge(int x) { , cnt = ; ; i < n; i++) { if(money + a[i] <= x) money += a[i]; else { money = a[i]; cnt++; } } if(c…
题目链接:http://hihocoder.com/contest/hiho37/problem/1 , 简单二分. 算法: 题目即为求一个无序数组数组中第k小的数,由于数据量太大,排序是会超时的. 采用提示的算法,即对于选定的Mid,以a[Mid]为支点进行一趟快排,这样比a[Mid]小的数都在Mid之前,比a[Mid]大的数在Mid之后.这时有如下三种情况: 若k<Mid,则有第k小的数一定在a[L..Mid-1]之中,令R = Mid - 1 若k=Mid,则a[Mid]就是我们要找的数…