We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0225ab1 commit fb690d6Copy full SHA for fb690d6
atcoder/abc033/B/main.cpp
@@ -0,0 +1,39 @@
1
+#include <bits/stdc++.h>
2
+
3
+using namespace std;
4
+using ll = int64_t;
5
+using ff = long double;
6
7
+int N;
8
+vector<string> S;
9
+vector<int> P;
10
11
+string solve() {
12
+ int sumP = 0;
13
+ for (int i = 0; i < N; ++i) {
14
+ sumP += P[i];
15
+ }
16
17
+ if (P[i] * 2 > sumP) {
18
+ return S[i];
19
20
21
+ return "atcoder";
22
+}
23
24
+int main() {
25
+ ios_base::sync_with_stdio(false);
26
+ cin.tie(0); cout.tie(0);
27
28
+ cin >> N;
29
+ S.assign(N, "");
30
+ P.assign(N, 0);
31
32
+ cin >> S[i] >> P[i];
33
34
35
+ auto ans = solve();
36
+ cout << ans << endl;
37
38
+ return 0;
39
0 commit comments