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 9adde58 commit 13d60ebCopy full SHA for 13d60eb
atcoder/abc184/B/main.cpp
@@ -0,0 +1,26 @@
1
+#include <bits/stdc++.h>
2
+
3
+using namespace std;
4
+using ll = int64_t;
5
+using ff = long double;
6
7
+int main() {
8
+ ios_base::sync_with_stdio(false);
9
+ cin.tie(0); cout.tie(0);
10
11
+ int N; ll X;
12
+ string S;
13
14
+ cin >> N >> X >> S;
15
+ for (auto c : S) {
16
+ if (c == 'o') {
17
+ ++X;
18
+ } else if (c == 'x') {
19
+ --X;
20
+ X = max(ll(0), X);
21
+ }
22
23
+ cout << X << endl;
24
25
+ return 0;
26
+}
0 commit comments