File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments