cf 865 B. Ordering Pizza】的更多相关文章

B. Ordering Pizza It's another Start[c]up finals, and that means there is pizza to order for the onsite contestants. There are only 2 types of pizza (obviously not, but let's just pretend for the sake of the problem), and all pizzas contain exactly S…
C. Ordering Pizza It's another Start[c]up finals, and that means there is pizza to order for the onsite contestants. There are only 2 types of pizza (obviously not, but let's just pretend for the sake of the problem), and all pizzas contain exactly S…
C - Ordering Pizza CodeForces - 867C C - Ordering Pizza 这个是最难的,一个贪心,很经典,但是我不会,早训结束看了题解才知道怎么贪心的. 这个是先假设每个人都可以吃到他喜欢的,就是先求出答案,然后按照b-a 排序,分别放入两个优先队列里面, 如果b>a 那就吃第二块,否则就吃第一块,求出num,注意优先队列按照从小到达排序. num1记录第一块吃的数量,num2记录第二块吃的数量. num1%=s,num2%=s  如果num1+num2的数…
题意: n个人吃披萨,总共有两种披萨,每种披萨都是有S块,给出每个人要吃的块数,吃第一种披萨能获得的happy值,吃第二种披萨能获得的happy值,问你,在购买的披萨数最少的情况下能获得的最大的总的happy值是多少(披萨可以买任意多个,吃不完也行 2333333) Examples Input 3 123 5 74 6 75 9 5 Output 84 Input 6 107 4 75 8 812 5 86 11 63 3 75 9 6 Output 314 思路:首先肯定是每个人都吃happ…
[链接]h在这里写链接 [题意]     给你参赛者的数量以及一个整数S表示每块披萨的片数.     每个参数者有3个参数,si,ai,bi;     表示第i个参赛者它要吃的披萨的片数,以及吃一片第一种披萨增加的幸福感,     以及吃一片第二种披萨增加的幸福感.     两种披萨都能任意数量地订购.     但是总数num有一个上限.     就是S*num>=∑si     且num最小.     也就是说相当于给你一个num;     让你求两种披萨各要买多少个a,b(a+b==num)…
Codeforces Round #437 (Div. 2) codeforces 867 A. Between the Offices(水) 题意:已知白天所在地(晚上可能坐飞机飞往异地),问是否从西雅图飞到旧金山次数更多. 题解:只要判断第一天和最后一天状态即可. #include<cstdio> #include<cstring> #include<algorithm> using namespace std; ; int n; char s[N]; int ma…
CF Rd478 Div2 A Aramic script 题意:给定几个字符串,去重后,求种类 思路:直接map乱搞 #include<bits/stdc++.h> using namespace std; string b; bool vis[100005]; map<string, int> M; int main() { int n; scanf("%d", &n); int ans = 0; while(n--) { memset(vis, 0…
Problem A Between the Offices 水题,水一水. #include<bits/stdc++.h> using namespace std; int n; ]; int main() { cin>>n; ,cnt2=; scanf("%s",s); ;i<n-;i++) { ]=='F') cnt1++; ]=='S') cnt2++; } if(cnt1>cnt2) puts("YES"); else p…
关于 下载地址:点我 哔哩哔哩视频:哔哩哔哩 信息收集 网卡:vmnet8:IP在192.168.131.1/24 ➜ ~ ip a show dev vmnet8 5: vmnet8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000 link/ether 00:50:56:c0:00:08 brd ff:ff:ff:ff:ff:ff inet 192…
  Pizza Anyone?  You are responsible for ordering a large pizza for you and your friends. Each of them has told you what he wants on a pizza and what he does not; of course they all understand that since there is only going to be one pizza, no one is…