Hamburgers】的更多相关文章

C. Hamburgers time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Polycarpus loves hamburgers very much. He especially adores the hamburgers he makes with his own hands. Polycarpus thinks that…
B题又耽误时间了...人太挫了.... C. Hamburgers time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Polycarpus loves hamburgers very much. He especially adores the hamburgers he makes with his own hands. Pol…
Polycarpus loves hamburgers very much. He especially adores the hamburgers he makes with his own hands. Polycarpus thinks that there are only three decent ingredients to make hamburgers from: a bread, sausage and cheese. He writes down the recipe of…
Hamburgers http://codeforces.com/problemset/problem/371/C time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Polycarpus loves hamburgers very much. He especially adores the hamburgers he makes…
题目链接 Hamburgers 二分答案,贪心判断即可. #include <bits/stdc++.h> using namespace std; #define REP(i,n) for(int i(0); i < (n); ++i) #define LL long long char str[1010]; LL len; LL b, c, s, nb, nc, ns, pb, pc, ps; LL money; bool judge(LL x){ LL mb = x * b; LL…
Polycarpus loves hamburgers very much. He especially adores the hamburgers he makes with his own hands. Polycarpus thinks that there are only three decent ingredients to make hamburgers from: a bread, sausage and cheese. He writes down the recipe of…
题目传送门 /* 题意:一个汉堡制作由字符串得出,自己有一些原材料,还有钱可以去商店购买原材料,问最多能做几个汉堡 二分:二分汉堡个数,判断此时所花费的钱是否在规定以内 */ #include <cstdio> #include <algorithm> #include <cmath> using namespace std; typedef long long ll; ; const int INF = 0x3f3f3f3f; char ham[MAXN]; ll n…
链接:https://ac.nowcoder.com/acm/contest/338/H来源:牛客网 题目描述 Kuangyeye is a dalao of the ACM school team of Hunan University. His favorite food are hamburgers. One day, Kuangyeye came to the KFC(or maybe McDonald) and saw n hamburgers on the counter.The w…
http://codeforces.com/contest/371/problem/C 二分枚举最大汉堡包数量就可以. #include <cstdio> #include <cstring> #include <algorithm> using namespace std; ]; int n1,n2,n3; int p1,p2,p3; __int64 m; int t1,t2,t3; bool ok(__int64 x) { __int64 ans=; ) ans+=…
<题目链接> 题目大意: 给以一段字符串,其中只包含"BSC"这三个字符,现在有一定量免费的'B','S','C‘,然后如果想再买这三个字符,就要付出相应的价格.现在总共有tot元,问你最多能够组成几个这样的字符串. 解题分析: 开始还以为是模拟,但是看到总价的范围,达到了1e12,并且模拟的情况非常复杂.最后用二分答案求解. #include <cstdio> #include <cstring> using namespace std; type…