BAEKJOON ONLINE JUDGE
한국정보올림피아드 시.도 지역본선 2005
2590 색종이
https://www.acmicpc.net/problem/2590


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | #include <cstdio> int main() { int count, paper[5]; for (int i = 0; i < 5; i++) { scanf("%d", &paper[i]); } scanf("%d", &count); count += paper[4] + paper[3] + paper[2] / 4; paper[0] -= (paper[4] * 11); if (paper[1] < paper[3] * 5) { paper[0] -= 20 * paper[3] - 4 * paper[1]; } paper[1] -= paper[3] * 5; if (paper[2] % 4) { count++; paper[1] -= 2 * (paper[2] % 4) - 1; paper[0] -= 8 - paper[2] % 4; } while (paper[1] > 0) { count++; if (paper[1] < 9) paper[0] -= 36 - (paper[0] * 4); paper[1] -= 9; } while (paper[0] > 0) { count++; paper[0] -= 36; } printf("%d\n", count); return 0; } | cs |