[CF1054C]Candies Distribution】的更多相关文章

题目:Candies Distribution 传送门:http://codeforces.com/problemset/problem/1054/C 分析: 方法一: 1)类似拓扑排序的做法. 2)当$L_i,R_i$均为$0$时,这个数就是当前最大的数,可以移除并且去掉他带来的影响,即左边的$R_i$减一,右边得$L_i$减一. 3)当$L_i,R_i$均为$0$时,就当这个点入度为$0$,移除影响就相当于去掉与其相邻的边. #include <bits/stdc++.h> using n…
[题目] C. Candies Distribution [描述] n个小朋友排排坐吃糖糖,小朋友从左到右编号1到n.每个小朋友手上有一定数量的糖.对于第i个小朋友来说,编号比他小的小朋友中有li个小朋友拥有的糖比他多,编号比他大的小朋友中有ri个小朋友拥有的糖比他多.已知每个小朋友手上至少有1颗糖.最多有n颗糖,求一种可能的每个小朋友手上的糖的数量的情形,输出YES和一种情形:如果不存在这样的可能,则输出NO. 数据范围:1<=n<=1000,0<=li,ri<=n [思路] 对…
A. Elevator or Stairs? 签. #include <bits/stdc++.h> using namespace std; ]; int main() { while (scanf("%d%d%d", &x, &y, &z) != EOF) { ; i < ; ++i) scanf("%d", t + i); ] + * t[]; ]; puts(a <= b ? "YES" :…
Candies Time Limit: 1500MS   Memory Limit: 131072K Total Submissions: 22177   Accepted: 5936 Description During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse's class a large b…
Candies 题目链接: http://acm.hust.edu.cn/vjudge/contest/122685#problem/J Description During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse's class a large bag of candies and had fl…
Candies Time Limit: 1500MS   Memory Limit: 131072K Total Submissions: 20067   Accepted: 5293 Description During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large b…
题目链接:http://poj.org/problem?id=3159 Description During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag of candies and had flymouse distribute them. All the k…
Candies Time Limit: 1500MS   Memory Limit: 131072K Total Submissions: 25776   Accepted: 7033 Description During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large b…
转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud Candies Time Limit: 1500MS   Memory Limit: 131072K Description During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’…
Description During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag of candies and had flymouse distribute them. All the kids loved candies very much and ofte…