
Codeforces
文章平均质量分 57
spongewxy
这个作者很懒,什么都没留下…
展开
-
1A Theatre Square
#include #include #include #include #include #include using namespace std;int main() { //freopen("aa.in", "r", stdin); int n, m, a; cin >> n >> m >> a; cout << 1LL*(n/a+(n%a原创 2015-05-21 15:27:19 · 490 阅读 · 0 评论 -
4A Watermelon
#include #include #include #include #include #include using namespace std;int main() { int n; cin >> n; if(n % 2 == 0 && n > 2) { cout << "YES" << endl; } else {原创 2015-05-21 15:28:04 · 423 阅读 · 0 评论 -
158B - Taxi
#include #include #include #include #include #include #include using namespace std;int cnt[5];int main() { memset(cnt, 0, sizeof(cnt)); int n, x; int ans = 0; scanf("%d", &n原创 2015-05-21 15:41:11 · 731 阅读 · 0 评论 -
231A Team
#include #include #include #include #include #include #include using namespace std;int main() { int ans = 0; int n, a, b, c; cin >> n; for(int i = 0; i < n; ++i) { ci原创 2015-05-21 15:48:57 · 609 阅读 · 0 评论 -
158A Next Round
#include #include #include #include #include #include using namespace std;const int maxn = 60;int arr[maxn];int main() { int ans = 0; int n, k; cin >> n >> k; for(int i = 1;原创 2015-05-21 15:28:44 · 472 阅读 · 0 评论 -
118A String Task
#include #include #include #include #include #include #include using namespace std;int main() { string str; string ans = ""; cin >> str; int len = str.length(); for(int i原创 2015-05-21 15:29:46 · 508 阅读 · 0 评论 -
50A Domino piling
#include #include #include #include #include #include #include using namespace std;int main() { int m, n; cin >> m >> n; cout << m*n/2 << endl; return 0;}原创 2015-05-21 15:29:41 · 438 阅读 · 0 评论 -
116A - Tram
#include #include #include #include #include #include #include using namespace std;int main() { int ans = 0; int tot = 0; int n, a, b; cin >> n; for(int i = 0; i < n; ++i原创 2015-05-21 16:08:52 · 439 阅读 · 0 评论 -
71A Way Too Long Words
#include #include #include #include #include #include #include using namespace std;int main() { //freopen("aa.in", "r", stdin); int n; string str; cin >> n; while(n--) {原创 2015-05-21 15:29:15 · 827 阅读 · 0 评论 -
282A - Bit++
注意:C语言字符数组必须预留出一个‘\0’的位置。#include #include #include #include #include #include #include using namespace std;int main() { char op[5]; int n; int ans = 0; cin >> n; w原创 2015-05-21 16:01:23 · 249 阅读 · 0 评论 -
131A - cAPS lOCK
#include #include #include #include #include #include #include using namespace std;int main() { string str; int cnt = 0; cin >> str; int len = str.length(); for(int i = 0原创 2015-05-21 16:32:49 · 731 阅读 · 0 评论 -
96A - Football
#include #include #include #include #include #include #include using namespace std;int main() { string str; bool flag = false; cin >> str; int len = str.length(); for(int原创 2015-05-21 16:42:02 · 345 阅读 · 0 评论 -
266A - Stones on the Table
#include #include #include #include #include #include #include using namespace std;int main() { string str; int n; cin >> n >> str; int id = 0, ans = 0, pre = -1; while(i原创 2015-05-21 16:58:53 · 429 阅读 · 0 评论 -
133A - HQ9+
#include #include #include #include #include #include #include using namespace std;int main() { string str; cin >> str; int len = str.length(); bool flag = false; for(int原创 2015-05-21 17:06:27 · 728 阅读 · 0 评论 -
112A - Petya and Strings
#include #include #include #include #include #include #include using namespace std;int main() { string a, b; cin >> a >> b; int l1 = a.length(); int l2 = b.length(); int原创 2015-05-21 17:21:28 · 561 阅读 · 0 评论 -
339A - Helpful Maths
#-*- coding: utf-8 -*-str = raw_input()cnt = [ 0 for i in range(4) ]for i in range(len(str)): if str[i] == '1': cnt[1] += 1 elif str[i] == '2': cnt[2] += 1 elif str[i]原创 2015-05-21 17:37:01 · 546 阅读 · 0 评论 -
281A - Word Capitalization
#-*- coding: utf-8 -*-s = raw_input()l = []if ord(s[0]) >= ord('a') and ord(s[0]) <= ord('z'): l.append(chr(ord(s[0])-ord('a')+ord('A')))else: l.append(s[0])for i in range(1, len(s)):原创 2015-05-21 17:45:01 · 505 阅读 · 0 评论 -
160A - Twins
#include #include #include #include #include #include #include using namespace std;const int maxn = 110;int arr[maxn];int main() { int sum = 0, t = 0; int n; scanf("%d", &n);原创 2015-05-21 17:55:24 · 495 阅读 · 0 评论 -
82A - Double Cola
#include #include #include #include #include #include #include using namespace std;string ans[5] = { "Sheldon", "Leonard", "Penny", "Rajesh", "Howard" };int main() { int n; int x =原创 2015-05-21 18:13:10 · 641 阅读 · 0 评论 -
148A - Insomnia cure
#include #include #include #include #include #include #include using namespace std;int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b);}int lcm(int a, int b) { return a / gcd原创 2015-05-21 18:29:00 · 500 阅读 · 0 评论 -
236A - Boy or Girl
#include #include #include #include #include #include #include using namespace std;const int maxn = 30;int cnt[maxn];int main() { string str; memset(cnt, 0, sizeof(cnt)); cin >原创 2015-05-21 18:36:51 · 530 阅读 · 0 评论 -
551B ZgukistringZ
Professor GukiZ doesn't accept string as they are. He likes to swap some letters in string to obtain a new one.GukiZ has strings a, b, and c. He wants to obtain stringk by swapping some letters原创 2015-06-18 17:29:35 · 1171 阅读 · 0 评论 -
CF 551D GukiZ and Binary Operations
We all know that GukiZ often plays with arrays. Now he is thinking about this problem: how many arrays a, of length n, with non-negative elementsstrictly less then 2l meet the following condit原创 2015-06-18 22:14:58 · 722 阅读 · 0 评论 -
551C GukiZ hates Boxes
Professor GukiZ is concerned about making his way to school, because massive piles of boxes are blocking his way.In total there are n piles of boxes, arranged in a line, from left to right,i-th原创 2015-06-18 21:13:39 · 732 阅读 · 0 评论 -
119A - Epic Game
#include #include #include #include #include #include #include #include #include using namespace std;int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b);}int main() { int原创 2015-05-22 08:58:58 · 637 阅读 · 0 评论 -
467A - George and Accommodation
#include #include #include #include #include #include #include #include #include using namespace std;int main() { int n, p, q; int ans = 0; cin >> n; for(int i = 0; i < n;原创 2015-05-22 09:13:02 · 548 阅读 · 0 评论 -
110A - Nearly Lucky Number
#include #include #include #include #include #include #include #include #include using namespace std;int main() { long long n; int ans = 0; cin >> n; while(n) { if(原创 2015-05-22 09:21:25 · 618 阅读 · 0 评论 -
58A - Chat room
#include #include #include #include #include #include #include #include #include using namespace std;int main() { int i, j = 0; string s1 = "hello"; string s2; cin >> s2;原创 2015-05-22 09:25:50 · 721 阅读 · 0 评论 -
271A Beautiful Year
#include #include #include #include #include #include #include #include #include using namespace std;bool mark[10];int main() { int n; cin >> n; while(true) { ++n;原创 2015-05-22 09:33:33 · 572 阅读 · 0 评论 -
122A - Lucky Division
#include #include #include #include #include #include #include #include #include using namespace std;int main() { int n; int i = 0; cin >> n; for(i = 1; i <= n; ++i) {原创 2015-05-22 09:39:00 · 689 阅读 · 0 评论 -
379A - New Year Candles
#include #include #include #include #include #include #include #include #include using namespace std;int main() { int a, b; int ans = 0; cin >> a >> b; ans = a; while(原创 2015-05-22 10:07:56 · 428 阅读 · 0 评论 -
61A - Ultra-Fast Mathematician
#include #include #include #include #include #include #include #include #include using namespace std;int main() { string s1; string s2; cin >> s1 >> s2; int len = s1.length原创 2015-05-22 15:31:03 · 586 阅读 · 0 评论 -
451A - Game With Sticks
#include #include #include #include #include #include #include #include #include using namespace std;int main() { int n, m, x; cin >> n >> m; x = min(n, m); if(x % 2 == 0)原创 2015-05-22 15:02:14 · 447 阅读 · 0 评论 -
208A - Dubstep
#include #include #include #include #include #include #include #include #include using namespace std;int main() { //freopen("aa.in", "r", stdin); string s1; string s2 = "";原创 2015-05-22 16:12:50 · 492 阅读 · 0 评论 -
Codeforces 552C Vanya and Scales
Vanya has a scales for weighing loads and weights of masses w0, w1, w2, ..., w100 grams wherew is some integer not less than 2 (exactly one weight of each nominal value). Vanya wonders whether h原创 2015-06-23 17:03:43 · 1038 阅读 · 0 评论 -
460A - Vasya and Socks
#include #include #include #include #include #include #include #include #include using namespace std;int main() { int n, m, ans = 0; cin >> n >> m; while(n >= m) { ans原创 2015-05-22 10:41:35 · 401 阅读 · 0 评论 -
228A - Is your horseshoe on the other hoof?
#include #include #include #include #include #include #include #include #include using namespace std;int main() { int s[4]; int ans = 0; cin >> s[0] >> s[1] >> s[2] >> s[3];原创 2015-05-22 11:09:47 · 446 阅读 · 0 评论 -
266B - Queue at the School
#include #include #include #include #include #include #include #include #include using namespace std;int main() { int n, t; string str; cin >> n >> t; cin >> str; while原创 2015-05-22 11:23:35 · 722 阅读 · 0 评论 -
41A Translation
#include #include #include #include #include #include #include #include #include using namespace std;int main() { string s1, s2; cin >> s1 >> s2; int l1 = s1.length(); int原创 2015-05-22 11:40:10 · 692 阅读 · 0 评论 -
472A - Design Tutorial: Learn from Math
#include #include #include #include #include #include #include #include #include using namespace std;bool check(int n) { for(int i = 2; i * i <= n; ++i) { if(n % i == 0) return原创 2015-05-22 10:29:22 · 708 阅读 · 0 评论