2019 GDUT Rating Contest I : Problem A. The Bucket List
题面:
A. The Bucket List
FJ has a storage room containing buckets that are sequentially numbered with labels 1, 2, 3, and so on. In his current milking strategy, whenever some cow (say, cow i) starts milking (at time si), FJ runs to the storage room and collects the bi buckets with the smallest available labels and allocates these for milking cow i.
题目描述:
题目分析:




1 #include <cstdio>
2 #include <cstring>
3 #include <iostream>
4 using namespace std;
5 int n, s[105], b[105], t[105];
6 int bk[1005]; //桶
7
8 int main(){
9 memset(bk, 0, sizeof(bk));
10 cin >> n;
11 for(int i = 0; i < n; i++){
12 cin >> s[i] >> t[i] >> b[i];
13 }
14
15 for(int i = 0; i < n; i++){
16 for(int k = s[i]; k <= t[i]; k++){
17 bk[k] += b[i];
18 }
19 }
20
21 int maxn = 0;
22 for(int i = 0; i <= 1000; i++){
23 if(bk[i] > maxn){
24 maxn = bk[i];
25 }
26 }
27
28 cout << maxn << endl;
29 return 0;
30 }
2019 GDUT Rating Contest I : Problem A. The Bucket List的更多相关文章
- 2019 GDUT Rating Contest II : Problem F. Teleportation
题面: Problem F. Teleportation Input file: standard input Output file: standard output Time limit: 15 se ...
- 2019 GDUT Rating Contest III : Problem D. Lemonade Line
题面: D. Lemonade Line Input file: standard input Output file: standard output Time limit: 1 second Memo ...
- 2019 GDUT Rating Contest I : Problem H. Mixing Milk
题面: H. Mixing Milk Input file: standard input Output file: standard output Time limit: 1 second Memory ...
- 2019 GDUT Rating Contest I : Problem G. Back and Forth
题面: G. Back and Forth Input file: standard input Output file: standard output Time limit: 1 second Mem ...
- 2019 GDUT Rating Contest III : Problem E. Family Tree
题面: E. Family Tree Input file: standard input Output file: standard output Time limit: 1 second Memory ...
- 2019 GDUT Rating Contest III : Problem C. Team Tic Tac Toe
题面: C. Team Tic Tac Toe Input file: standard input Output file: standard output Time limit: 1 second M ...
- 2019 GDUT Rating Contest III : Problem A. Out of Sorts
题面: 传送门 A. Out of Sorts Input file: standard input Output file: standard output Time limit: 1 second M ...
- 2019 GDUT Rating Contest II : Problem G. Snow Boots
题面: G. Snow Boots Input file: standard input Output file: standard output Time limit: 1 second Memory ...
- 2019 GDUT Rating Contest II : Problem C. Rest Stops
题面: C. Rest Stops Input file: standard input Output file: standard output Time limit: 1 second Memory ...
随机推荐
- URLSearchParams & shape URL params
URLSearchParams https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams var paramsString = ...
- Vue SSR in Action
Vue SSR in Action https://ssr.vuejs.org/ https://ssr.vuejs.org/api/ https://ssr.vuejs.org/guide/data ...
- WebRTC 信令服务器
WebRTC 信令服务器 node.js & V8 libuv socket.io https://socket.io/ node-static SSR https://github.com/ ...
- Flutter & UI system & GUI & API & SDK
Flutter & UI system & GUI & API & SDK https://book.flutterchina.club/chapter14/flutt ...
- svg opacity & fill-opacity & stroke-opacity
svg opacity & fill-opacity & stroke-opacity opacity = ill-opacity + stroke-opacity https://s ...
- js jsonParse
mdn const rx_one = /^[\],:{}\s]*$/; const rx_two = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g; // 匹配 ...
- 心之所向·智慧绽放丨NGK区块链赋能实体经济论坛圆满落幕
据外媒报导,近日,由NGK主办的"NGK区块链赋能实体经济论坛"于英国伦敦的威斯敏斯特中央大厅圆满落幕.大会现场到来了NGK北美市场领导人.区块链行业的专业人士.NGK英国社区代表 ...
- Python算法_盛最多水的容器(04)
给你 n 个非负整数 a1,a2,...,an,每个数代表坐标中的一个点 (i, ai) .在坐标内画 n 条垂直线,垂直线 i 的两个端点分别为 (i, ai) 和 (i, 0).找出其中的两条线, ...
- 死磕Spring之IoC篇 - 文章导读
该系列文章是本人在学习 Spring 的过程中总结下来的,里面涉及到相关源码,可能对读者不太友好,请结合我的源码注释 Spring 源码分析 GitHub 地址 进行阅读 Spring 版本:5.1. ...
- nginx判断状态脚本
A是nginx行数 为0则启动nginx 启动失败则杀死keepalived进程