time limit per test3 seconds memory limit per test256 megabytes inputstandard input outputstandard output Kostya is a genial sculptor, he has an idea: to carve a marble sculpture in the shape of a sphere. Kostya has a friend Zahar who works at a care…
题目链接 可以发现 十进制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 a case of frauds who make fake copies of the famous Stolp's gears, pu…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Chloe, the same as Vladik, is a competitive programmer. She didn't have any problems to get to the olympiad like Vladik, but she was confused by…
time limit per test4 seconds memory limit per test256 megabytes inputstandard input outputstandard output Peppa the Pig was walking and walked into the forest. What a strange coincidence! The forest has the shape of a rectangle, consisting of n rows…
time limit per test4 seconds memory limit per test512 megabytes inputstandard input outputstandard output Vanya got bored and he painted n distinct points on the plane. After that he connected all the points pairwise and saw that as a result many tri…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Kyoya Ootori has a bag with n colored balls that are colored with k different colors. The colors are labeled from 1 to k. Balls of the same colo…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Anton loves transforming one permutation into another one by swapping elements for money, and Ira doesn't like paying for stupid games. Help them…
[题目链接]:http://codeforces.com/contest/510/problem/C [题意] 给你n个字符串; 问你要怎么修改字典序; (即原本是a,b,c..z现在你可以修改每个字母在字典序中的位置了); 才能使得这n个字符串是字典序升序的; [题解] 对于第i个字符串; 让他和第i+1..n个字符串比较->j; 找到第一个不同的位置pos; 然后 必然是要 s[i][pos]< s[j][pos]的: 拓扑排序! 即s[i][pos]建一条边指向s[j][pos] 然后做…
[题目链接]:http://codeforces.com/contest/807/problem/B [题意] 你在另外一场已经结束的比赛中有一个排名p; 然后你现在在进行另外一场比赛 然后你当前有一个分数x; 以及另外一个分数y,表示如果要拿第一需要的分数; 你可以通过hack使得分数x大于分数y; 然后你最后的分数x会决定你那个排名p能不能在已经结束的那场比赛中拿到奖品; 问你技能拿到奖品,又能在这场比赛中夺冠;至少需要hack成功多少次(失败的不需要输出); (hack规则和cf的一样)…