Skip to content

Commit 068f285

Browse files
authored
Merge pull request #507 from xirc/atcoder/abc184
AtCoder/ABC184
2 parents 7dfa0ee + 13d60eb commit 068f285

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

atcoder/abc184/A/main.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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 a, b, c, d;
12+
cin >> a >> b >> c >> d;
13+
int det = a * d - b * c;
14+
cout << det << endl;
15+
16+
return 0;
17+
}

atcoder/abc184/B/main.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)