题目链接: E. ZS and The Birthday Paradox. time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output ZS the Coder has recently found an interesting concept called the Birthday Paradox. It states that giv…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output ZS the Coder has recently found an interesting concept called the Birthday Paradox. It states that given a random set of 23 people, there is aro…
time limit per test1 second memory limit per test512 megabytes inputstandard input outputstandard output A boy named Ayrat lives on planet AMI-1511. Each inhabitant of this planet has a talent. Specifically, Ayrat loves running, moreover, just runnin…
题目链接 可以发现 十进制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 Polycarp has interviewed Oleg and has written the interview down without punctuation marks and spaces to save time. Thus, the interview is now a…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output After Vitaly was expelled from the university, he became interested in the graph theory. Vitaly especially liked the cycles of an odd length in w…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middl…
time limit per test5 seconds memory limit per test512 megabytes inputstandard input outputstandard output This task is very simple. Given a string S of length n and q queries each query is on the format i j k which means sort the substring consisting…
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 test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Petr wants to make a calendar for current month. For this purpose he draws a table in which columns correspond to weeks (a week is seven consequ…