GYM 101673J(模拟)
本来我就模拟和搜索恐惧症,场上乍一看调度来调度去的真的吓得没敢写。然鹅赛后听说别的队写得贼短就写了写,真的不难……嘤嘤嘤
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
struct Others {
int usage, recovery, start;
}p[10];
int Jim[10][2], ans;
int main() {
for (int i = 0; i < 10; ++i) {
scanf("%d %d", &Jim[i][0], &Jim[i][1]);
}
for (int i = 0; i < 10; ++i) {
scanf("%d %d %d", &p[i].usage, &p[i].recovery, &p[i].start);
}
for (int i = 0; i < 30; ++i) {
int now = i % 10, &t = p[now].start;
if (ans >= t) {
t = (ans - t) / (p[now].usage + p[now].recovery) * (p[now].usage + p[now].recovery) + t;
if (t + p[now].usage > ans) ans = t + p[now].usage;
t += p[now].usage + p[now].recovery;
}
if (t < ans + Jim[now][0]) t = ans + Jim[now][0];
ans += Jim[now][0] + Jim[now][1];
}
printf("%d\n", ans - Jim[9][1]);
return 0;
}
// 5 5 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
// 2 2 1
// 8 3 0
// 1 1 0
// 1 1 0
// 1 1 0
// 1 1 0
// 1 1 0
// 1 1 0
// 1 1 0
// 1 1 0
GYM 101673J(模拟)的更多相关文章
- C - Boss Gym - 101473C (模拟)
题目链接:https://cn.vjudge.net/contest/287775#problem/C 题目大意:给你n个人,然后m条关系,会有k次询问,每一次询问包括两种类型,第一种类型是交换两个人 ...
- Galactic Collegiate Programming Contest Gym - 101572G 模拟
#include<bits/stdc++.h> using namespace std; int n,m; struct node { int id; int slove; int pen ...
- 【模拟】ECNA 2015 I What's on the Grille? (Codeforces GYM 100825)
题目链接: http://codeforces.com/gym/100825 题目大意: 栅栏密码.给定N(N<=10),密钥为一个N*N的矩阵,'.'代表空格可以看到,'X'代表被遮挡,还有密 ...
- 【模拟】NEERC15 G Generators(2015-2016 ACM-ICPC)(Codeforces GYM 100851)
题目链接: http://codeforces.com/gym/100851 题目大意: n个序列.每个序列有4个值x,a,b,c,之后按照x=(a*x+b)%c扩展无穷项. 求每个序列各取一个数之后 ...
- 【模拟】NEERC15 J Jump(2015-2016 ACM-ICPC)(Codeforces GYM 100851)
题目链接: http://codeforces.com/gym/100851 题目大意: 系统里生成一个字符串C,一开始告诉你字符串的长度N(偶数).接着你需要在n+500次内猜出这个字符串是什么. ...
- 【模拟】NEERC15 E Easy Problemset (2015-2016 ACM-ICPC)(Codeforces GYM 100851)
题目链接: http://codeforces.com/gym/100851 题目大意: N个人,每个人有pi个物品,每个物品价值为0~49.每次从1~n顺序选当前这个人的物品,如果这个物品的价值&g ...
- 【模拟】NEERC15 A Adjustment Office (2015-2016 ACM-ICPC)(Codeforces GYM 100851)
题目链接: http://codeforces.com/gym/100851 题目大意: 一个N*N的矩阵A,Ai,j=i+j,Q次操作,每次分两种,R r取出第r行还未被取的所有数,并输出和.C c ...
- 【模拟】BAPC2014 G Growling Gears (Codeforces GYM 100526)
题目链接: http://codeforces.com/gym/100526 http://acm.hunnu.edu.cn/online/?action=problem&type=show& ...
- Gym 100952C&&2015 HIAST Collegiate Programming Contest C. Palindrome Again !!【字符串,模拟】
C. Palindrome Again !! time limit per test:1 second memory limit per test:64 megabytes input:standar ...
随机推荐
- Android JNI技术介绍【转】
本文转载自:http://blog.csdn.net/yangwen123/article/details/8085833 JNI是JavaNative Interface 的缩写,通过JNI,Jav ...
- FFmpeg滤镜代码级分析
http://blog.chinaunix.net/uid-26000296-id-3322071.html 前一篇文章<为FFmpeg添加自定义滤镜>详细讲述了FFmpeg的滤镜添加步骤 ...
- Windows服务的快速搭建与调试(C#图解)
Windows服务的快速搭建与调试(C#图解) 目录 一.什么是Windows 服务? 二.创建Windows 服务与安装/卸载批处理. 三.调试Windows 服务. 正文 一.什么是Windo ...
- 封装class类为jar包提供给其他项目使用
一.完成class类的编写与测试工作 二.完善javadoc注释,生成自己的API 注释要按照标准要求进行 Project -- generate javadoc
- CKEDITOR 默认最大化
createEditor("newsEditer"); //创建一个editer //editer 最大化 CKEDITOR.instances["newsEditer& ...
- CodeForces - 840D:(主席树求出现区间出现次数大于某值的最小数)
Once, Leha found in the left pocket an array consisting of n integers, and in the right pocket q que ...
- BZOJ_1044_[HAOI2008]木棍分割_二分答案+DP+单调队列
BZOJ_1044_[HAOI2008]木棍分割_二分答案+DP Description 有n根木棍, 第i根木棍的长度为Li,n根木棍依次连结了一起, 总共有n-1个连接处. 现在允许你最多砍断m个 ...
- linux 查看某进程 并杀死进程 ps grep kill
Linux 中使用top 或 ps 查看进程使用kill杀死进程 1.使用top查看进程: $top 进行执行如上命令即可查看top!但是难点在如何以进程的cpu占用量进行排序呢? cpu占用量排序执 ...
- bzoj 2836 魔法树——树链剖分
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=2836 树剖裸题.然而WA.RE了好久…… 原来是跳 top 的那个地方! top 不相等的时 ...
- 使用Node.js实现简单的网络爬取
由于最近要实现一个爬取H5游戏的代理服务器,隧看到这么一篇不错的文章(http://blog.miguelgrinberg.com/post/easy-web-scraping-with-nodejs ...