Road to Post Office 题意: 一个人要从0走到d,可以坐车走k米,之后车就会坏,你可以修或不修,修要花t时间,坐车单位距离花费a时间,走路单位距离花费b时间,问到d的最短时间. 题解: 首先要分成k段,k段的总长是ovmod,每一段可以选择修车坐车或选择走路,(只有第一段的时候不用修车),最后在加上剩下的那些路的时间,剩下的是mod,(可以选择修车坐车或选择走路)最后min答案就好了.但其中还有一种情况要注意,就是前ovmod也可以选择坐车之后不修走着,所以这种要特殊处理下.…
D. Road to Post Office time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasiliy has a car and he wants to get from home to the post office. The distance which he needs to pass equals to d ki…
D. Road to Post Office time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasiliy has a car and he wants to get from home to the post office. The distance which he needs to pass equals to d ki…
D. Road to Post Office time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasiliy has a car and he wants to get from home to the post office. The distance which he needs to pass equals to d ki…
比赛链接:http://codeforces.com/contest/702 A. Maximum Increase A题求连续最长上升自序列. [暴力题] for一遍,前后比较就行了. #include <algorithm> #include <iostream> #include <cstdlib> #include <cstring> #include <cstdio> #include <vector> #include &…
D. Road to Post Office time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasiliy has a car and he wants to get from home to the post office. The distance which he needs to pass equals to d ki…
C. Cellular Network time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output You are given n points on the straight line — the positions (x-coordinates) of the cities and m points on the same line…
A. Maximum Increase time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given array consisting of n integers. Your task is to find the maximum length of an increasing subarray of the gi…
C. Cellular Network time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output You are given n points on the straight line — the positions (x-coordinates) of the cities and m points on the same line…
C. Cellular Network time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output You are given n points on the straight line — the positions (x-coordinates) of the cities and m points on the same line…