【37.21%】【codeforces 721B】Passwords】的更多相关文章

time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Vanya is managed to enter his favourite site Codehorses. Vanya uses n distinct passwords for sites at all, however he can't remember which one e…
题目链接 可以发现 十进制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> #…
题目链接: B. Passwords time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vanya is managed to enter his favourite site Codehorses. Vanya uses n distinct passwords for sites at all, however he can…
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 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 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 Mr. Funt now lives in a country with a very specific tax laws. The total income of mr. Funt during this year is equal to n (n ≥ 2) burles and th…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Innokentiy likes tea very much and today he wants to drink exactly n cups of tea. He would be happy to drink more but he had exactly n tea bags,…
[题目链接]:http://codeforces.com/problemset/problem/757/D [题意] 给你一个01串; 让你分割这个01串; 要求2切..n+1切; 对于每一种切法 所切成的各个部分的二进制,转成十进制之后;假设里面最大的数为m; 问1..m这些数字都出现的切法有多少种; [题解] 可以算一下对于1个75位的数字来说; 最多只可能连续出现 从 1..20 你可以算一下1..20这20个数字的二进制形式恰好占74个; 不能再多一个数字了,因为21的二进制形式的长度肯…
[题目链接]:http://codeforces.com/problemset/problem/757/E [题意] 给你q个询问; 每个询问包含r和n; 让你输出f[r][n]; 这里f[0][n]是n分解成两个数u,v的乘积的个数; 这里u和v互质; 而f[r][n]当r>0时,有个递推式; [题解] 那个递推式等价于 即n的所有因子x的f[r][x]的和; 这里需要知道; f[0][n]=2n的不同质因子个数 且容易得到 当a和b互质的时候,f[0][a*b]=f[0][a]*f[0][b…