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 ...
随机推荐
- C++中二维数组作为函数参数
在平时,我们经常会遇到将整个数组作为函数参数的情况,一维数组的情况,就是用数组名当形参和实参,传递的是数组的首地址.二维数组我们用的也很多,但是总是有各种问题,今天我总结一下 有个很重要的一点,字符串 ...
- μC/OS-III---I笔记3---时间管理
时间管理相关函数,其实深入根本的理解就是一些对时间任务相关变量,数据结果进行修改的函数这样方便对应任务查找延时等时间相关的任务有没有到期.前面的时间相关的函数是这些操作的基 1.延时函数 OsTIme ...
- AirPods Max 出厂激活是怎么回事
AirPods Max 出厂激活是怎么回事 话说出厂激活是怎么检测出来的 refs xgqfrms 2012-2020 www.cnblogs.com 发布文章使用:只允许注册用户才可以访问! 原创文 ...
- element-ui & babel-plugin-component config bug
element-ui & babel-plugin-component config bug vue-cli bad babel.config.js module.exports = { pr ...
- ES2015 (ES6) 新特性: 20 个
ES2015 (ES6) 新特性 http://babeljs.io/docs/learn-es2015/ Learn ES2015 A detailed overview of ECMAScript ...
- Android 如何设置 WebView 的屏幕占比
Android 如何设置 WebView 的屏幕占比 由于 Android 适用于具有各种屏幕尺寸和像素密度的设备,因此您在设计网页时应将这些因素纳入考虑范围,以便您的网页始终以合适的尺寸显示. We ...
- Parcel all in one
Parcel all in one Parcel https://parceljs.org/ # cli $ yarn global add parcel-bundler $ npm install ...
- js 实现简单的parseInt和parseFloat
function myParseInt(str: string): number { let result = NaN; for (let i = 0; i < str.length; i++) ...
- vue v-io 父子组件双向绑定多个数据
vue-io-directive 可以减少使用emit,组件自带的v-model好像也只能设置一个 安装 npm i vue-io-directive 使用 import Vue from 'vue' ...
- mui上拉刷新
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...