Codeforces Round #190 (Div. 2) B. Ciel and Flowers
2013-07-03 14:14
295 查看
链接:http://codeforces.com/contest/322/problem/B
这题做错了。没考虑周全。
。。
。。
这题做错了。没考虑周全。
#include <cstdio> #include <cstdlib> #include <iostream> #include <algorithm> using namespace std; int main(void) { int r, g, b; while (~scanf("%d%d%d", &r, &g, &b)) { int x = r % 3, y = g % 3, z = b % 3, Max = max(x, max(y, z)), cnt =r/3+g/3+b/3; if (Max == 1) { if (x == y && y == z && x == 1) cnt++; } if (Max == 2) { if (x + y + z == 4) { if (x*y*z) cnt++; else if (!x && r/3) cnt++; else if (!y && g/3) cnt++; else if (!z && b/3) cnt++; } else if (x + y + z == 5) cnt++; else if (x + y + z == 6) cnt+=2; } printf("%d\n", cnt); } return 0; }
。。
。。
相关文章推荐
- 想法题——Codeforces Round #190 (Div. 2)——B. Ciel and Flowers
- Codeforces Round #190 (Div. 2)---A. Ciel and Dancing
- Codeforces Round #190 (Div. 2)-C. Ciel and Robot
- Codeforces Round #190 (Div. 2) E. Ciel the Commander 点分治
- Codeforces Round #190 DIV.2 A. Ciel and Dancing
- Codeforces Round #341 (Div. 2) C. Wet Shark and Flowers
- Codeforces Round #261 (Div. 2)B. Pashmak and Flowers(容易)
- Codeforces Round #341 (Div. 2)--C. Wet Shark and Flowers
- Codeforces Round #190 (Div. 2) E. Ciel the Commander 题目与题解翻译
- Codeforces Round #190 (Div. 2) E. Ciel the Commander 题目与题解翻译
- Codeforces Round #381 (Div. 2) B. Alyona and flowers(贪心 模拟)
- Codeforces Round #253 (Div. 2) C Borya and Hanabi (思维+bitmask)
- Codeforces Round #226 (Div. 2) D. Bear and Floodlight
- Codeforces Round 444 div2 D Ratings and Reality Shows (双指针)
- 【Codeforces Round 263 (Div 2)B】【水题 贪心】Appleman and Card Game 选字符,每个字符个数的平方
- Codeforces Round #383 (Div. 2) B. Arpa’s obvious problem and Mehrdad’s terrible solution(STL乱搞)
- Codeforces Round #324 (Div. 2) D. Dima and Lisa(哥德巴赫猜想)
- 【Educational Codeforces Round 48 (Rated for Div. 2) C】 Vasya And The Mushrooms
- Codeforces Round #390(Div. 2)B. Ilya and tic-tac-toe game【模拟】
- Codeforces Round #281 (Div. 2) C. Vasya and Basketball 枚举+二分