Skip to content

Commit a836a2f

Browse files
committed
boj 25335 Gravity Hackenbush
1 parent e1d0198 commit a836a2f

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

게임 이론/25335.cpp

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int r, g, b;
5+
int N, M;
6+
7+
void func() {
8+
r += (g >> 1);
9+
b += (g >> 1);
10+
if (g & 1) r++;
11+
12+
if (r > b) cout << "jhnah917\n";
13+
else cout << "jhnan917\n";
14+
}
15+
16+
void input() {
17+
int x, y;
18+
cin >> N >> M;
19+
while (N--) {
20+
cin >> x >> y;
21+
}
22+
23+
char c;
24+
while (M--) {
25+
cin >> x >> y >> c;
26+
if (c == 'R') r++;
27+
else if (c == 'G') g++;
28+
else b++;
29+
}
30+
}
31+
32+
int main() {
33+
cin.tie(NULL); cout.tie(NULL);
34+
ios::sync_with_stdio(false);
35+
36+
input();
37+
func();
38+
39+
return 0;
40+
}

0 commit comments

Comments
 (0)