【37.50%】【codeforces 732D】Exams】的更多相关文章

time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Vasiliy has an exam period which will continue for n days. He has to pass exams on m subjects. Subjects are numbered from 1 to m. About every day…
题目链接 可以发现 十进制4 对应 二进制100 十进制16 对应 二进制10000 十进制64 对应 二进制1000000 可以发现每多两个零,4的次幂就增加1. 用string读入题目给定的二进制数字,求出其长len,当len为奇数时,第一位为1,后面的位数如果都为0,则输出len,如果有一个不为0,则输出len+1: 当len为偶数时,则输出len.(之所以这样输出是因为题目给定4的次幂是从0开始的) #include<iostream> #include<string> #…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Andrewid the Android is a galaxy-famous detective. He is now investigating the case of vandalism at the exhibition of contemporary art. The main…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output In Absurdistan, there are n towns (numbered 1 through n) and m bidirectional railways. There is also an absurdly simple road network - for each…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Recently Anton found a box with digits in his room. There are k2 digits 2, k3 digits 3, k5 digits 5 and k6 digits 6. Anton's favorite integers ar…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output You are given n numbers a1, a2, -, an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We wan…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Local authorities have heard a lot about combinatorial abilities of Ostap Bender so they decided to ask his help in the question of urbanization…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output There are n servers in a laboratory, each of them can perform tasks. Each server has a unique id - integer from 1 to n. It is known that during…
[题目链接]:http://codeforces.com/contest/509/problem/C [题意] 给你一个数组b[i] 要求一个严格升序的数组a[i]; 使得a[i]是b[i]各个位上的数的和; 并且a[n]最小; [题解] 每次处理的时候; 算出b[i]-b[i-1]的值 设为d 如果d>0 则从个位开始,不断地加1,直到d变成0; 如果个位变成9了,就加到十位,(这个时候个位的数字9不变,因为在低位,数字大一些,可以为后面高位的数字"分压",后面的数字就能小一些…
[题目链接]:http://codeforces.com/contest/760/problem/D [题意] 去旅行,有3种类型的乘车票; 第一种:只能旅行一次20元 第二种:按时间计算,90分钟内能无限量旅行,50元 第三种:按时间计算,1440分钟内能无限量旅行,120元 每次旅行只消耗一分钟; 给你n次旅行开始的时间(顺序); 让你求出第1到第i次旅行的这些旅行最少需要花费多少钱f[i]; (每次都重新计算) 输出f[i]-f[i-1]; [题解] 动态规划; 设f[i]表示第1..到第…