【43.26%】【codeforces 732C】Sanatorium】的更多相关文章

time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Vasiliy spent his vacation in a sanatorium, came back and found that he completely forgot details of his vacation! Every day there was a breakfas…
题目链接 可以发现 十进制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 Vasya is currently at a car rental service, and he wants to reach cinema. The film he has bought a ticket for starts in t minutes. There is a str…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Gerald got a very curious hexagon for his birthday. The boy found out that all the angles of the hexagon are equal to . Then he measured the len…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output There is a polyline going through points (0, 0) – (x, x) – (2x, 0) – (3x, x) – (4x, 0) – - - (2kx, 0) – (2kx + x, x) – -. We know that the polyli…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Wilbur is playing with a set of n points on the coordinate plane. All points have non-negative integer coordinates. Moreover, if some point (x,…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output The tram in Berland goes along a straight line from the point 0 to the point s and back, passing 1 meter per t1 seconds in both directions. It me…
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…
[题目链接]:http://codeforces.com/contest/797/problem/C [题意] 一开始,给你一个字符串s:两个空字符串t和u; 你有两种合法操作; 1.将s的开头字符加到t后面; 2.将t的最后一个字符加到u的后面去 要求最后使得s和t字符串变成空串; 并且得到的u的字符串的字典序最小; [题解] i层循环顺序枚举s字符串的每一个字符; 然后把这第i个字符s[i]加入到t的后面去->用一个栈来模拟; 然后维护栈顶的元素和s中剩下的字符串里面字典序最小的字母;->…
[题目链接]: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] 然后做…