time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Today Pari and Arya are playing a game called Remainders. Pari chooses two positive integer x and k, and tells Arya k but not x. Arya have to fin…
题目链接 可以发现 十进制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 test1 second memory limit per test256 megabytes inputstandard input outputstandard output Gennady is one of the best child dentists in Berland. Today n children got an appointment with him, they lined up in front of his office. All chi…
[题目链接]:http://codeforces.com/contest/807/problem/D [题意] 给出n个人的比赛信息; 5道题 每道题,或是没被解决->用-1表示; 或者给出解题的所用的时间; (每道题的分数与解决率有关,越高,分越低); 然后有个人想利用这个特点,注册很多个账号; 试图改变每道题的解决率,以期让自己的分数大于某个人; 如果这个人没有解决某道题的话; 那些新加入的人也不能解决那道题. 问最少需要注册多少个账号才能让你的分数大于某个人; [题解] 顺序枚举加入了多少…
[题目链接]:http://codeforces.com/problemset/problem/821/E [题意] 一开始位于(0,0)的位置; 然后你每次可以往右上,右,右下3走一步; (x+1,y+1),(x+1,y),(x+1,y-1) 然后有n条横线,限制你在横线与x轴之间; 问你从(0,0)到(k,0)有多少种行走方案; k可以很大; 保证横线是连续的,即一条横线完,马上接另外一条横线; [题解] 如果不考虑那么大的横坐标的话; 用最简单的DP 设f[i][j]表示到(i,j)这个点…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Little Alyona is celebrating Happy Birthday! Her mother has an array of n flowers. Each flower has some mood, the mood of i-th flower is ai. The…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Amr loves Chemistry, and specially doing experiments. He is preparing for a new interesting experiment. Amr has n different types of chemicals. E…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output After seeing the "ALL YOUR BASE ARE BELONG TO US" meme for the first time, numbers X and Y realised that they have different bases, which co…
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output People do many crazy things to stand out in a crowd. Some of them dance, some learn by heart rules of Russian language, some try to become a…
time limit per test4 seconds memory limit per test256 megabytes inputstandard input outputstandard output PolandBall has such a convex polygon with n veritces that no three of its diagonals intersect at the same point. PolandBall decided to improve i…