CodeForces 21 A+B】的更多相关文章

                                                     Jabber ID 判断邮箱地址格式是否正确..一把心酸泪...跪11+,,看后台才过.. 注意给定的每个条件都要判断.. char a[105]; int fun(char a) { if((a>='0'&&a<='9')||(a>='a'&&a<='z')||(a>='A'&&a<='Z')) return 1;…
Educational Codeforces Round 21  A. Lucky Year 个位数直接输出\(1\) 否则,假设\(n\)十进制最高位的值为\(s\),答案就是\(s-(n\mod s)\) view code #pragma GCC optimize("O3") #pragma GCC optimize("Ofast,no-stack-protector") #include<bits/stdc++.h> using namespac…
D. Array Division time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output Vasya has an array a consisting of positive integer numbers. Vasya wants to divide this array into two non-empty consecuti…
A. Lucky Year time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output Apart from having lots of holidays throughout the year, residents of Berland also have whole lucky years. Year is considered lu…
After several latest reforms many tourists are planning to visit Berland, and Berland people understood that it's an opportunity to earn money and changed their jobs to attract tourists. Petya, for example, left the IT corporation he had been working…
Vasya has an array a consisting of positive integer numbers. Vasya wants to divide this array into two non-empty consecutive parts (the prefix and the suffix) so that the sum of all elements in the first part equals to the sum of elements in the seco…
Problem A Lucky Year 题目传送门[here] 题目大意是说,只有一个数字非零的数是幸运的,给出一个数,求下一个幸运的数是多少. 这个幸运的数不是最高位的数字都是零,于是只跟最高位有关,只保留最高位,然后加一求差就是答案. Code /** * Codeforces * Problem#808A * Accepted * Time:15ms * Memory:0k */ #include<iostream> #include<cstdio> #include<…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output You are given n numbers a1, a2, -, an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We wan…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Mr. Funt now lives in a country with a very specific tax laws. The total income of mr. Funt during this year is equal to n (n ≥ 2) burles and th…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Innokentiy likes tea very much and today he wants to drink exactly n cups of tea. He would be happy to drink more but he had exactly n tea bags,…