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 ...
随机推荐
- rrweb 用户操作录制和还原
rrweb 用户操作录制和还原 demos https://www.rrweb.io/replay refs https://www.rrweb.io/ xgqfrms 2012-2020 www.c ...
- document.URL vs window.location.href All In One
document.URL vs window.location.href All In One document.URL 与 window.location.href 两者有啥区别 document. ...
- fibonacci all in one
fibonacci all in one fibonacci sequence https://www.mathsisfun.com/numbers/fibonacci-sequence.html f ...
- no code form generator
no code form generator 无代码,表单生成器 H5 Drag & Drop UI => codes click copy demo https://www.forms ...
- uniapp设置不同的主题(Theme)
App.vue: <style lang="stylus"> @css { html { --primary: blue; --bg-image: url(https: ...
- RocketMq灰皮书(一)------选型&RocketMQ名词
RocketMq灰皮书(一)------选型&RocketMQ名词 一. MQ选型对比 目前业内常用的MQ框架有一下几种: Kafka RabbitMQ RocketMQ 除此之外,还有Act ...
- 云原生系列5 容器化日志之EFK
上图是EFK架构图,k8s环境下常见的日志采集方式. 日志需求 1 集中采集微服务的日志,可以根据请求id追踪到完整的日志: 2 统计请求接口的耗时,超出最长响应时间的,需要做报警,并针对性的进行调优 ...
- Mybatis-05 注解开发
Mybatis-05 注解开发 注解开发 注解的核心是反射机制 面向接口编程的根本原因:解耦,可拓展,提高复用,分层开发中.上层不用管具体的实现,大家都遵守共同的标准,使得开发变得容易,规范性好. 1 ...
- docker镜像常用操作的基本命令
1.拉取/下载镜像 docker pull 镜像名称 (可以从网易云镜像中心获取要下载的镜像) 2.查看已经下载的镜像 docker images 3.删除本地镜像 docker rmi ...
- Docker 搭建nexus私服
一.概述 有三种专门的Maven仓库管理软件可以用来帮助大家建立私服:Apache基金会的Archiva.JFrog的Artifactory和Sonatype的Nexus.而Nexus是当前最流行的M ...