CodeForces 371C Hamburgers】的更多相关文章

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…
题目链接 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…
<题目链接> 题目大意: 给以一段字符串,其中只包含"BSC"这三个字符,现在有一定量免费的'B','S','C‘,然后如果想再买这三个字符,就要付出相应的价格.现在总共有tot元,问你最多能够组成几个这样的字符串. 解题分析: 开始还以为是模拟,但是看到总价的范围,达到了1e12,并且模拟的情况非常复杂.最后用二分答案求解. #include <cstdio> #include <cstring> using namespace std; type…
#include<stdio.h> int main() { char s[200]; __int64  r,nb,ns,nc,pb,ps,pc,i,sum,tob,tos,toc; while(scanf("%s",s)!=EOF) { scanf("%I64d%I64d%I64d",&nb,&ns,&nc); scanf("%I64d%I64d%I64d",&pb,&ps,&pc);…
Codeforces 371C : Hamburgers #include<bits/stdc++.h> using namespace std; char B='B',S='S',C='C'; string t; int nb,ns,nc,pb,ps,pc,len; long long r1; map<char,int> m; bool check(long long m1) { ; if(m1*m[B]>nb) need+=(m1*m[B]-nb)*pb; if(m1*m…
题目传送门 /* 题意:一个汉堡制作由字符串得出,自己有一些原材料,还有钱可以去商店购买原材料,问最多能做几个汉堡 二分:二分汉堡个数,判断此时所花费的钱是否在规定以内 */ #include <cstdio> #include <algorithm> #include <cmath> using namespace std; typedef long long ll; ; const int INF = 0x3f3f3f3f; char ham[MAXN]; ll n…
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…
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…
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…
上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题.. 今天,我们来扒一下cf的题面! PS:本代码不是我原创 1. 必要的分析 1.1 页面的获取 一般情况CF的每一个 contest 是这样的: 对应的URL是:http://codeforces.com/contest/xxx 还有一个Complete problemset页面,它是这样的:…