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…
题目链接 可以发现 十进制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 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 Little girl Alyona is in a shop to buy some copybooks for school. She study four subjects so she wants to have equal number of copybooks for each…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups,…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Vanya has a scales for weighing loads and weights of masses w0,?w1,?w2,?-,?w100 grams where w is some integer not less than 2 (exactly one weight…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output The winter in Berland lasts n days. For each day we know the forecast for the average air temperature that day. Vasya has a new set of winter tir…
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 test1 second memory limit per test256 megabytes inputstandard input outputstandard output A function is called Lipschitz continuous if there is a real constant K such that the inequality |f(x) - f(y)| ≤ K·|x - y| holds for all . We'll…
[题目链接]:http://codeforces.com/contest/755/problem/E [题意] 给你n个节点; 让你在这些点之间接若干条边;构成原图(要求n个节点都联通) 然后分别求出原图和补图(补图也要求联通)的直径r1和r2 然后要求min(r1,r2)==k; 让你求出符合要求的原图的m条边; [题解] 有个结论; 如果图G的直径超过了3,则它的补图的直径会比3小; 且k=1的时候,是无解的; 因为k=1就说明一张图上只有一条边; n=2的时候,另外一张图上没边,最小值为0…