【42.59%】【codeforces 602A】Two Bases】的更多相关文章

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…
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=102271#problem/C Description 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 complicated their relati…
题目链接 可以发现 十进制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 Galya is playing one-dimensional Sea Battle on a 1 × n grid. In this game a ships are placed on the grid. Each of the ships consists of b consecu…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Amr lives in Lala Land. Lala Land is a very beautiful country that is located on a coordinate line. Lala Land is famous with its apple trees grow…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Just to remind, girls in Arpa's land are really nice. Mehrdad wants to invite some Hoses to the palace for a dancing party. Each Hos has some wei…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Oh…
[题目链接]:http://codeforces.com/contest/776/problem/E [题意] f(n)是小于n的不同整数对(x,y)这里x+y==n且gcd(x,y)==1的个数; g(n)是n的所有因子的f值的和; 然后让你求一个递推式 [题解] x的欧拉函数为phi(x) 则f(n)=phi(n); 欧拉函数的定义是,小于这个值且与这个值互质的数的个数->phi(n); 可以证明每一个与n互质的数x对应了一个整数对(x,y)且x+y==n且gcd(x,y)==1; 然后有个…
[题目链接]:http://codeforces.com/contest/793/problem/D [题意] 给你n个点, 这n个点 从左到右1..n依序排; 然后给你m条有向边; 然后让你从中选出k个点. 这k个点形成的一条路径; 且在路径中,一个被访问过的点不会经过两次或以上; 比如从1->3(1和3被访问过) 然后再从3->4(1,3,4都被访问过) 再从4->2(这时会又经过3号节点,而3号节点之前被访问过,所以不合法) 这就不是合法的; [题解] 每次走完之后都有一个接下来能…
[题目链接]:http://codeforces.com/contest/807/problem/B [题意] 你在另外一场已经结束的比赛中有一个排名p; 然后你现在在进行另外一场比赛 然后你当前有一个分数x; 以及另外一个分数y,表示如果要拿第一需要的分数; 你可以通过hack使得分数x大于分数y; 然后你最后的分数x会决定你那个排名p能不能在已经结束的那场比赛中拿到奖品; 问你技能拿到奖品,又能在这场比赛中夺冠;至少需要hack成功多少次(失败的不需要输出); (hack规则和cf的一样)…