CodeForces 730G Car Repair Shop (暴力)】的更多相关文章

题意:给定 n 个工作的最好开始时间,和持续时间,现在有两种方法,第一种,如果当前的工作能够恰好在最好时间开始,那么就开始,第二种,如果不能,那么就从前找最小的时间点,来完成. 析:直接暴力,每次都先去看看能不能在最好时间完成,如果不能,就去找最小的时间点. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #incl…
BUPT 2017 summer training (for 16) #1F 题意 依次有n (1 ≤ n ≤ 200) 个车要修理,每个车希望在s[i]时刻开始修理,时长d[i],如果s[i]后面没有那么多空的时间,那么就选最小的可行的起点.\(s_i, d_i (1 ≤ s_i ≤ 10^9, 1 ≤ d_i ≤ 5·10^6)\) 题解 模拟,先看从s[i]时刻开始修理,和之前i-1个是否冲突.如果冲突,就枚举每个s[j]+d[j]时刻开始,看是否冲突,再从中选择最小的时刻. 代码 #in…
Hidden Code 题目连接: http://codeforces.com/gym/100015/attachments Description It's time to put your hacking skills to the test! You've been called upon to help crack enemy codes in the current war on... something or another. Anyway, the point is that yo…
A. ArielTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100685/problem/A Description King Triton really likes watching sport competitions on TV. But much more Triton likes watching live competitions. So Triton decides to set up…
G. #TheDress Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100637/problem/G Description After landing on planet i1c5l people noticed that blue and black clothes are quite popular among the locals. Each aboriginal has at least…
Couple Cover Time Limit: 3000MS   Memory Limit: 524288KB   64bit IO Format: %I64d & %I64u Description 方宝宝有n个篮球,每个篮球上写有一个值ai.他第一次从n个篮球中取出1个,不放回.第二次再在剩余的篮球中取出一个. (每个球被取概率相同).如果这两个球上的值的乘积大于等于p,他会变得高兴,然后请大家吃饭.否则方宝宝会不高兴, 然后暴食暴饮变得更胖. 当然为了方宝宝的健康(被请吃饭),我想取一个…
D. Jerry's Protest time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output Andrew and Jerry are playing a game with Harry as the scorekeeper. The game consists of three rounds. In each round, Andr…
B. Shopping 题目连接: http://www.codeforces.com/contest/665/problem/B Description Ayush is a cashier at the shopping center. Recently his department has started a ''click and collect" service which allows users to shop online. The store contains k items.…
F - Laurenty and Shop Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 586B Description A little boy Laurenty has been playing his favourite game Nota for quite a while and is now very hu…
题目链接: http://codeforces.com/contest/651/problem/D D. Image Preview time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasya's telephone contains n photos. Photo number 1 is currently opened on…