【CF edu 30 A. Chores】】的更多相关文章

time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Luba has to do n chores today. i-th chore takes ai units of time to complete. It is guaranteed that for every the conditionai ≥ ai - 1 is me…
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Merge sort is a well-known sorting algorithm. The main function that sorts the elements of array a with indices from [l, r) can be implement…
time limit per test 1 second memory limit per test  256 megabytes input standard input output standard output Ivan is playing a strange game. He has a matrix a with n rows and m columns. Each element of the matrix is equal to either 0 or 1. Rows and…
time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given a string s consisting only of characters 0 and 1. A substring [l, r] of s is a string slsl + 1sl + 2... sr, and its length equa…
E. Colored Balls time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output There are n boxes with colored balls on the table. Colors are numbered from 1 to n. i-th box contains ai balls, all of which…
Time limit per test1 second memory limit per test 256 megabytes input standard input output standard output For a given positive integer n denote its k-rounding as the minimum positive integer x, such that x ends with k or more zeros in base 10 and i…
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Leha somehow found an array consisting of n integers. Looking at it, he came up with a task. Two players play the game on the array. Players…
[链接]h在这里写链接 [题意] 给你n个数字; 让你在其中找出三个数字i,j,k(i<=j<=k); 使得p*a[i]+q*a[j]+r*a[k]最大; [题解] /*     有一个要求i<=j<=k;     也就是说系数之间的下标是有关系的.     枚举第一个位置的下标i;         则第二个人j         i<=j<n         枚举中间那个人的位置在哪.     求出前i个位置,第一个人能获得的最大值是多少     求出后n-i个位置,第…
[链接]h在这里写链接 [题意] 在这里写题意 [题解] /* Be careful. 二重循环枚举 */ [错的次数] 0 [反思] 在这了写反思 [代码] #include <bits/stdc++.h> using namespace std; int n; string s[110]; int main() { //freopen("F:\\rush.txt", "r", stdin); scanf("%d", &n)…
题目链接:http://codeforces.com/problemset/problem/676/B 题意:一个n层的平面酒杯金字塔,如图,每个杯子的容量相同.现在往最顶部的一个杯子倒 t 杯酒,求流动结束后有多少个杯子被装满. 思路:每个局部的两代三个杯子的流动过程是一致的,因此可以用递归来模拟求解. 具体为:设add(cur, i, l)执行“往第 i 个杯子倒cur量的酒”,附加信息: i 位于第 l 层.若执行完剩余了surplus量的酒,则往 i 的下一层左右两侧的杯子各倒surpl…