[codeforces 360]A. Levko and Array Recovery 试题描述 Levko loves array a1, a2, ... , an, consisting of integers, very much. That is why Levko is playing with array a, performing all sorts of operations with it. Each operation Levko performs is of one of…
题目:http://codeforces.com/contest/360/problem/E 官方题解与证明:http://codeforces.com/blog/entry/9529 一条可以调整的边的边权要么是 l [ i ] 要么是 r[ i ] . 先把所有可调整边设成 r[ i ] ,然后看看有没有一条可调整的边 (x,y)满足 dis1[x]<=dis2[x] 且其边权还是 r[ i ]:如果有,就把它改成 l [ i ]. 改完一条边之后就再做一遍 dij( ) ,然后再改:直到没…
Descripe: 贪心,贪在哪里呢…… 给你初始速度,结尾速度,行驶秒数,每秒速度可变化的范围,问你行驶秒数内最远可以行驶多少距离 Solution: 贪心,我是否加速,就是看剩下的时间能不能减到原始给定的结尾速度 #include <iostream> using namespace std; int main() { int v1,v2; int t,d; while(cin>>v1>>v2) { cin>>t>>d; int ret =…
Professor GukiZ is concerned about making his way to school, because massive piles of boxes are blocking his way. In total there are n piles of boxes, arranged in a line, from left to right, i-th pile (1 ≤ i ≤ n) containing ai boxes. Luckily, m stude…
题目链接: 传送门 Kefa and Company time limit per test:2 second memory limit per test:256 megabytes Description Kefa wants to celebrate his first big salary by going to restaurant. However, he needs company. Kefa has n friends, each friend will agree to…