buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; cout << (s == "ABC" ? "ARC" : s); }
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; cout << (s == "ABC" ? "ARC" : "ABC"); }
[["-", 0, 1, 0, 16, 12, 23, 0, 41, 75, 22], ["+", 0, 16, 12, 23, 0, 41, 75, 5, 0, 62], ["+", 0, 16, 12, 23, 0, 41, 75, 5, 0, 6]]
1
35
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <iomanip> // fixed, setprecis...
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <iomanip> // fixed, setprecis...
[["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
109
import java.util.*; public class Main { public static void main(String args[]) { Scanner s = new Scanner(System.in); String input = s.next(); if (input == "ABC") System.out.println("ARC"); else System.out.println("ABC"); } }
import java.util.*; public class Main { public static void main(String args[]) { Scanner s = new Scanner(System.in); String input = s.next(); if (input.contains("ABC")) System.out.println("ARC"); else System.out.println("ABC"); } }
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 60], ["+", 8, 196, 0, 57, 15, 15, 0, 492, 0, 131], ["+", 8, 196, 0, 57, 15, 15, 0, 492, 141, 22], ["+", 0, 57, 15, 15, 0, 492, 3, 4, 0, 24], ["+", 0, 57, 15, 15, 0, 492, 3, 4, 0, 25]]
3
75
s = str(input()) if s is ABC: print("ARC") else: print("ABC")
s = str(input()) if s == "ABC": print("ARC") else: print("ABC")
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 709], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 60], ["+", 0, 656, 0, 57, 15, 666, 0, 557, 0, 654], ["+", 0, 656, 0, 57, 15, 666, 0, 557, 0, 655]]
5
27
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)n; i++) #define rp(i, n) for (int i = 1; i <= (int)n; i++) int main() { string s; cin >> s; if (s == "ARC") cout << "ARC" << endl; else cout << "ABC" << endl; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)n; i++) #define rp(i, n) for (int i = 1; i <= (int)n; i++) int main() { string s; cin >> s; if (s == "ARC") cout << "ABC" << endl; else cout << "ARC" << endl; }
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
65
#include <stdio.h> signed main() { char S[10]; int i; for (i = 0; i < 3; i++) { scanf("%s", S[i]); } if (S[1] == 'B') { printf("ARC\n"); } else { printf("ABC\n"); } return (0); }
#include <stdio.h> signed main() { char S[10]; int i; for (i = 0; i < 3; i++) { scanf("%s", &S[i]); } if (S[1] == 'B') { printf("ARC\n"); } else { printf("ABC\n"); } return (0); }
[["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67]]
0
81
#include <bits/stdc++.h> using namespace std; int main(int argc, char const *argv[]) { string contest; cin >> contest; if (contest == "ABC") { cout << "ARC" << endl; } else { cout << "ARC" << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main(int argc, char const *argv[]) { string contest; cin >> contest; if (contest == "ABC") { cout << "ARC" << endl; } else { cout << "ABC" << endl; } return 0; }
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
60
s = str(input()) if s == ABC: print('ARC') else: if s == ARC: print('ABC')
s = str(input()) if s == 'ABC': print('ARC') else: if s == 'ARC': print('ABC')
[["+", 0, 656, 0, 57, 15, 666, 0, 557, 0, 654], ["+", 0, 656, 0, 57, 15, 666, 0, 557, 0, 655], ["+", 8, 196, 0, 57, 15, 666, 0, 557, 0, 654], ["+", 8, 196, 0, 57, 15, 666, 0, 557, 0, 655]]
5
32
# A - A?C S = int(input()) if S=='ABC': print('ARC') else: print('ABC')
# A - A?C S = input() if S=='ABC': print('ARC') else: print('ABC')
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
30
a = ["ABC","ARC"] print(a[input() == "ARC"])
a = ["ABC","ARC"] print(a[input() == "ABC"])
[["-", 3, 4, 0, 206, 206, 666, 0, 557, 0, 6], ["+", 3, 4, 0, 206, 206, 666, 0, 557, 0, 6]]
5
24
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) using namespace std; using ll = long long; using d = double; int main() { string S; cin >> S; if (S == "ABC") cout << "ARC" << endl; else cout << "ARC" << endl; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) using namespace std; using ll = long long; using d = double; int main() { string S; cin >> S; if (S == "ABC") cout << "ARC" << endl; else cout << "ABC" << endl; }
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
63
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main() { string s; if (s == "ABC") cout << "ARC" << endl; else cout << "ABC" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main() { string s; cin >> s; if (s == "ABC") cout << "ARC" << endl; else cout << "ABC" << endl; return 0; }
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
49
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println((scan.next().equals("ABC") ? "AGC" : "ABC")); } }
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println((scan.next().equals("ABC") ? "ARC" : "ABC")); } }
[["-", 3, 4, 0, 23, 0, 510, 64, 5, 0, 491], ["+", 3, 4, 0, 23, 0, 510, 64, 5, 0, 491]]
3
64
s = input() output = "ABC" if s == output: output = "ARC" print(s)
s = input() output = "ABC" if s == output: output = "ARC" print(output)
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]]
5
24
#include <iostream> using namespace std; int main() { string s; cin >> s; if (s[1] = 'B') cout << "ARC" << endl; else cout << "ABC" << endl; }
#include <iostream> using namespace std; int main() { string s; cin >> s; if (s[1] == 'B') cout << "ARC" << endl; else cout << "ABC" << endl; }
[["-", 8, 9, 0, 57, 15, 339, 51, 11, 17, 32], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60]]
1
47
#include <bits/stdc++.h> using namespace std; #define int long long #define F first #define S second #define _READ freopen("input.txt", "r", stdin); #define _FAST \ ios_base::sync_with_stdio(false); \ cin.tie...
#include <bits/stdc++.h> using namespace std; #define int long long #define F first #define S second #define _READ freopen("input.txt", "r", stdin); #define _FAST \ ios_base::sync_with_stdio(false); \ cin.tie...
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13]]
1
86
#include <bits/stdc++.h> using namespace std; int main() { string n; cin >> n; string m = "abc"; if (n == m) cout << "arc"; else cout << "abc"; }
#include <bits/stdc++.h> using namespace std; int main() { string n; cin >> n; string m = "ABC"; if (n == m) cout << "ARC"; else cout << "ABC"; }
[["-", 8, 9, 0, 43, 49, 50, 51, 5, 0, 6], ["+", 8, 9, 0, 43, 49, 50, 51, 5, 0, 6], ["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
45
#include <bits/stdc++.h> using namespace std; int main() { string S; if (S == "ABC") { cout << "ARC" << endl; } else { cout << "ABC" << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; if (S == "ABC") { cout << "ARC" << endl; } else { cout << "ABC" << endl; } }
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
44
#include <bits/stdc++.h> using namespace std; typedef long long ll; bool judge(vector<pair<int, int>> &p) { sort(p.begin(), p.end()); int h = 0; for (auto e : p) { if (h + e.first < 0) return false; h += e.second; } return true; } int main() { int n; cin >> n; vector<string> s(n); vec...
#include <bits/stdc++.h> using namespace std; typedef long long ll; bool judge(vector<pair<int, int>> &p) { sort(p.begin(), p.end(), greater()); int h = 0; for (auto e : p) { if (h + e.first < 0) return false; h += e.second; } return true; } int main() { int n; cin >> n; vector<string> ...
[["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 0, 1, 0, 2, 3, 4, 0, 2, 63, 22], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25]]
1
254
package main import ( "bufio" "fmt" "os" "sort" ) type Frags [][]int func (a Frags) Len() int { return len(a) } func (a Frags) Swap(i, j int) { a[i], a[j] = a[j], a[i] } func (a Frags) Less(i, j int) bool { return a[i][0] < a[j][0] } func main() { reader := bufio.NewReader(os.Stdin) var n int ...
package main import ( "bufio" "fmt" "os" "sort" ) type Frags [][]int func (a Frags) Len() int { return len(a) } func (a Frags) Swap(i, j int) { a[i], a[j] = a[j], a[i] } func (a Frags) Less(i, j int) bool { return a[i][0] < a[j][0] } func main() { reader := bufio.NewReader(os.Stdin) var n int ...
[["-", 0, 434, 0, 435, 8, 196, 0, 440, 0, 217], ["-", 0, 435, 8, 196, 0, 440, 0, 441, 141, 22], ["-", 0, 435, 8, 196, 0, 440, 0, 441, 39, 78], ["-", 36, 36, 0, 434, 0, 435, 8, 196, 0, 165], ["+", 12, 432, 0, 465, 8, 196, 0, 440, 0, 217], ["+", 0, 465, 8, 196, 0, 440, 0, 441, 141, 22], ["+", 0, 465, 8, 196, 0, 440, 0, 4...
7
398
#include "bits/stdc++.h" using namespace std; #define fio \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) #define pb push...
#include "bits/stdc++.h" using namespace std; #define fio \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) #define pb push...
[["+", 0, 2, 3, 4, 0, 83, 0, 2, 63, 22], ["+", 3, 4, 0, 83, 0, 2, 3, 4, 0, 24], ["+", 3, 4, 0, 83, 0, 2, 3, 4, 0, 25], ["-", 64, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 17, 33]]
1
569
#include <bits/stdc++.h> using namespace std; #define ll long long #define db double #define pii pair<int, int> #define pli pair<ll, int> #define pil pair<int, ll> #define pll pair<ll, ll> #define mat vector<vector<int>> const int inf = 1 << 30; const ll linf = 1e18; const db EPS = 1e-7; template <class T> void chmin(T...
#include <bits/stdc++.h> using namespace std; #define ll long long #define db double #define pii pair<int, int> #define pli pair<ll, int> #define pil pair<int, ll> #define pll pair<ll, ll> #define mat vector<vector<int>> const int inf = 1 << 30; const ll linf = 1e18; const db EPS = 1e-7; template <class T> void chmin(T...
[["-", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["-", 0, 57, 15, 339, 51, 16, 12, 91, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
355
# **************************************************************************** # # # # __ __ .____ .__ __. ____ # # F-bracketSequencing.py | | | || _ \ | \/ | / | ...
# **************************************************************************** # # # # __ __ .____ .__ __. ____ # # F-bracketSequencing.py | | | || _ \ | \/ | / | ...
[["+", 0, 14, 8, 196, 0, 37, 0, 432, 0, 21], ["+", 0, 14, 8, 196, 0, 37, 0, 432, 0, 22], ["+", 0, 656, 0, 1, 0, 662, 31, 684, 0, 21], ["+", 0, 656, 0, 1, 0, 662, 31, 684, 0, 22]]
5
344
#define _CRT_SECURE_NO_WARNINGS #define MOD 998244353 #define INF 100000000 //#define MOD 922337203685419LL #include <algorithm> #include <bitset> #include <chrono> #include <cmath> #include <cstdio> #include <deque> #include <functional> #include <iostream> #include <iterator> #include <list> #include <map> #include <...
#define _CRT_SECURE_NO_WARNINGS #define MOD 998244353 #define INF 100000000 //#define MOD 922337203685419LL #include <algorithm> #include <bitset> #include <chrono> #include <cmath> #include <cstdio> #include <deque> #include <functional> #include <iostream> #include <iterator> #include <list> #include <map> #include <...
[["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72], ["+", 15, 339, 51, 16, 31, 16, 12, 118, 28, 22], ["+", 15, 339, 51, 16, 31, 16, 12, 118, 17, 131], ["+", 15, 339, 51, 16, 31, 16, 12, 118, 119, 120]]
1
843
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define ll long long using namespace std; // typedef vector<unsigned int>vec; // typedef vector<ll>vec; // typedef vector<vec> mat; typedef pair<int, int> P; typedef pair<ll, ll> LP; const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define ll long long using namespace std; // typedef vector<unsigned int>vec; // typedef vector<ll>vec; // typedef vector<vec> mat; typedef pair<int, int> P; typedef pair<ll, ll> LP; const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {...
[["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["-", 0, 338, 8, 9, 0, 1, 0, 11, 17, 110], ["+", 0, 338, 8, 9, 0, 1, 0, 11, 17, 107]]
1
506
#include <bits/stdc++.h> using namespace std; #define REP(i, a, n) for (int i = (a); i < (int)(n); i++) #define rep(i, n) REP(i, 0, n) #define FOR(it, c) \ for (__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++it) #define ALLOF(c) (c).begin(), (c)....
#include <bits/stdc++.h> using namespace std; #define REP(i, a, n) for (int i = (a); i < (int)(n); i++) #define rep(i, n) REP(i, 0, n) #define FOR(it, c) \ for (__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++it) #define ALLOF(c) (c).begin(), (c)....
[["-", 0, 218, 8, 9, 0, 37, 0, 16, 17, 18], ["+", 0, 218, 8, 9, 0, 37, 0, 16, 17, 47]]
1
419
#include <bits/stdc++.h> using namespace std; #define MOD (long long int)(998244353) #define ll long long int #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define reps(i, n) for (int i = 1; i <= (int)(n); i++) #define REP(i, n) for (int i = n - 1; i >= 0; i--) #define REPS(i, n) for (int i = n; i > 0; i--) #def...
#include <bits/stdc++.h> using namespace std; #define MOD (long long int)(998244353) #define ll long long int #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define reps(i, n) for (int i = 1; i <= (int)(n); i++) #define REP(i, n) for (int i = n - 1; i >= 0; i--) #define REPS(i, n) for (int i = n; i > 0; i--) #def...
[["-", 3, 4, 0, 2, 3, 4, 0, 16, 31, 22], ["-", 3, 4, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 12, 22], ["-", 0, 1, 0, 2, 3, 4, 0, 2, 63, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 2, 63, 22]]
1
538
N = int(input()) memo1 = [] memo2 = [] memo3 = [] memo4 = [] for i in range(N): S = input() sum_n = sum([1 if s=='(' else -1 for s in S]) if sum_n >= 0: sum_n = 0 min_n = 1 for s in S: if s == ')': sum_n -= 1 min_n = min(min_n, sum_n) else: sum_n += 1 if min_n ...
N = int(input()) memo1 = [] memo2 = [] memo3 = [] memo4 = [] for i in range(N): S = input() sum_n = sum([1 if s=='(' else -1 for s in S]) if sum_n >= 0: sum_n = 0 min_n = 1 for s in S: if s == ')': sum_n -= 1 min_n = min(min_n, sum_n) else: sum_n += 1 if min_n ...
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 31, 22], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 31, 22]]
5
310
#include <algorithm> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <memory> #include <queue> #include <set> #include <sstream> #include <stack> #include...
#include <algorithm> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <memory> #include <queue> #include <set> #include <sstream> #include <stack> #include...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 22]]
1
423
#include <bits/stdc++.h> using namespace std; #define pb push_back #define fi first #define se second #define mp make_pair #define all(x) (x).begin(), (x).end() #define rep(i, n) for (int i = 0; i < (n); ++i) #define repp(i, a, b) for (int i = a; i <= (b); ++i) #define repr(i, a, b) for (int i = a; i >= (b); --i) #defi...
#include <bits/stdc++.h> using namespace std; #define pb push_back #define fi first #define se second #define mp make_pair #define all(x) (x).begin(), (x).end() #define rep(i, n) for (int i = 0; i < (n); ++i) #define repp(i, a, b) for (int i = a; i <= (b); ++i) #define repr(i, a, b) for (int i = a; i >= (b); --i) #defi...
[["-", 0, 14, 8, 9, 0, 37, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 37, 0, 16, 31, 22], ["-", 8, 9, 0, 37, 0, 16, 12, 118, 119, 120], ["+", 8, 9, 0, 37, 0, 16, 12, 118, 119, 120]]
1
1,185
#ifndef ONLINE_JUDGE #define DEBUG 0 #define _GLIBCXX_DEBUG #endif #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack...
#ifndef ONLINE_JUDGE #define DEBUG 1 #define _GLIBCXX_DEBUG #endif #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack...
[["-", 36, 36, 0, 30, 0, 171, 0, 58, 51, 59], ["+", 36, 36, 0, 30, 0, 171, 0, 58, 51, 59], ["-", 8, 9, 0, 1, 0, 11, 12, 91, 17, 33]]
1
2,147
#include <bits/stdc++.h> using namespace std; long long n, all = 0; vector<string> s; vector<int> req[2], sum[2], id[2]; bool solve(); int main() { cin >> n; s.resize(n); for (int i = 0; i < n; ++i) { cin >> s[i]; int len = s[i].size(), cnt = 0, now = 0; for (int j = 0; j < len; ++j) if (s[i]...
#include <bits/stdc++.h> using namespace std; long long n, all = 0; vector<string> s; vector<int> req[2], sum[2], id[2]; bool solve(); int main() { cin >> n; s.resize(n); for (int i = 0; i < n; ++i) { cin >> s[i]; int len = s[i].size(), cnt = 0, now = 0; for (int j = 0; j < len; ++j) if (s[i]...
[["+", 0, 1, 0, 2, 3, 4, 0, 91, 17, 33]]
1
539
#include <algorithm> #include <array> #include <assert.h> #include <bitset> #include <cmath> #include <cstdlib> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <tup...
#include <algorithm> #include <array> #include <assert.h> #include <bitset> #include <cmath> #include <cstdlib> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <tup...
[["-", 0, 1, 0, 2, 3, 4, 0, 2, 63, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 2, 63, 22]]
1
333
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> using namespace std; typedef long long int64; typedef pair<int, int> pii; typedef pair<int64, int64> pll; const int INF = 0x3f3f3f3f; const...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> using namespace std; typedef long long int64; typedef pair<int, int> pii; typedef pair<int64, int64> pll; const int INF = 0x3f3f3f3f; const...
[["-", 0, 30, 0, 14, 8, 9, 0, 37, 0, 38], ["-", 0, 30, 0, 14, 8, 9, 0, 37, 0, 146], ["-", 0, 30, 0, 14, 8, 9, 0, 37, 0, 35], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33]]
1
536
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <climits> #include <cmath> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include ...
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <climits> #include <cmath> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include ...
[["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 98], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 31, 22], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 19], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 22]]
1
496
import sys n = int(input()) ss =[] for _ in range(n): ss.apend(input()) cnt_p = [] cnt_m = [] for i in range(n): left = 0 right = 0 for s in ss[i]: if(s == '('): left += 1 elif(s == ')'): if(left > 0): left -= 1 else: ri...
import sys n = int(input()) ss =[] for _ in range(n): ss.append(input()) cnt_p = [] cnt_m = [] for i in range(n): left = 0 right = 0 for s in ss[i]: if(s == '('): left += 1 elif(s == ')'): if(left > 0): left -= 1 else: r...
[["-", 8, 196, 0, 1, 0, 652, 63, 319, 319, 22], ["+", 8, 196, 0, 1, 0, 652, 63, 319, 319, 22]]
5
226
#include <algorithm> #include <iostream> #include <queue> #include <vector> #define pub push_back #define pii pair<int, int> #define vi vector<int> #define fst first #define snd second using namespace std; string s, ns; int lft = 0, rg = 0; vector<pii> v; bool cp(const pii &l, const pii &r) { return make_pair(l.snd, ...
#include <algorithm> #include <iostream> #include <queue> #include <vector> #define pub push_back #define pii pair<int, int> #define vi vector<int> #define fst first #define snd second using namespace std; string s, ns; int lft = 0, rg = 0; vector<pii> v; bool cp(const pii &l, const pii &r) { return make_pair(l.snd, ...
[["-", 0, 14, 8, 9, 0, 37, 0, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 37, 0, 16, 17, 47], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
510
N = int(input()) s = [input() for i in range(N)] S = [[0]*len(s[i]) for i in range(N)] for i, x in enumerate(s): res = [] q = 0 for j in range(len(x)): if x[j] == ')': S[i][j] = -1 else: S[i][j] = 1 s = [0]*N m = [len(S[i]) for i in range(N)] for i, x in enumerate(S):...
N = int(input()) s = [input() for i in range(N)] S = [[0]*len(s[i]) for i in range(N)] for i, x in enumerate(s): res = [] q = 0 for j in range(len(x)): if x[j] == ')': S[i][j] = -1 else: S[i][j] = 1 s = [0]*N m = [len(S[i]) for i in range(N)] for i, x in enumerate(S):...
[["-", 0, 656, 0, 57, 64, 196, 0, 7, 12, 22], ["+", 0, 656, 0, 57, 64, 196, 0, 7, 12, 22]]
5
366
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = (a); i < (b); ++i) #define per(i, a, b) for (int i = (b)-1; i >= (a); --i) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() #define pb push_back #define eb emplace_back #define mp make_pair #define fst first #define snd second...
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = (a); i < (b); ++i) #define per(i, a, b) for (int i = (b)-1; i >= (a); --i) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() #define pb push_back #define eb emplace_back #define mp make_pair #define fst first #define snd second...
[["-", 8, 9, 0, 37, 0, 16, 31, 16, 17, 72], ["+", 8, 9, 0, 37, 0, 16, 31, 16, 17, 33], ["-", 8, 9, 0, 37, 0, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 37, 0, 16, 12, 16, 17, 33]]
1
583
def check(pt, brackets): brackets.sort(reverse=True) for m, t in brackets: if pt + m < 0: return False pt += t return pt n = int(input()) brackets_p = [] # (始めを0として、( = +1, ) = -1 として、最後はいくつか, 途中の最小値はいくつか) brackets_m = [] pt = 0 mt = 0 for _ in range(n): s = input() to...
def check(pt, brackets): brackets.sort(reverse=True) for m, t in brackets: if pt + m < 0: return -1 pt += t return pt n = int(input()) brackets_p = [] # (始めを0として、( = +1, ) = -1 として、最後はいくつか, 途中の最小値はいくつか) brackets_m = [] pt = 0 mt = 0 for _ in range(n): s = input() total...
[["-", 8, 196, 0, 57, 64, 196, 0, 37, 0, 147], ["+", 0, 57, 64, 196, 0, 37, 0, 664, 17, 33], ["+", 0, 57, 64, 196, 0, 37, 0, 664, 28, 612], ["-", 15, 679, 31, 679, 31, 23, 0, 666, 0, 147], ["+", 31, 679, 31, 23, 0, 666, 0, 664, 17, 33], ["+", 31, 679, 31, 23, 0, 666, 0, 664, 28, 612], ["-", 15, 679, 31, 679, 12, 23, 0,...
5
213
#include <bits/stdc++.h> #define rep(i, a, ...) \ for (int i = (a) * (strlen(#__VA_ARGS__) != 0); \ i < (int)(strlen(#__VA_ARGS__) ? __VA_ARGS__ : (a)); ++i) #define per(i, a, ...) ...
#include <bits/stdc++.h> #define rep(i, a, ...) \ for (int i = (a) * (strlen(#__VA_ARGS__) != 0); \ i < (int)(strlen(#__VA_ARGS__) ? __VA_ARGS__ : (a)); ++i) #define per(i, a, ...) ...
[["-", 0, 37, 0, 16, 31, 16, 31, 118, 119, 120], ["+", 0, 37, 0, 16, 31, 16, 31, 118, 119, 120], ["-", 0, 37, 0, 16, 31, 16, 12, 118, 119, 120], ["+", 0, 37, 0, 16, 31, 16, 12, 118, 119, 120], ["-", 0, 37, 0, 16, 12, 16, 31, 118, 119, 120], ["+", 0, 37, 0, 16, 12, 16, 31, 118, 119, 120], ["-", 0, 37, 0, 16, 12, 16, 12,...
1
914
import sys input = sys.stdin.readline N = int(input()) S = [input()[:-1] for _ in range(N)] high = [] low = [] for i in range(N): cnt = 0 m = 0 for j in range(len(S[i])): if S[i][j] == "(": cnt += 1 else: cnt -= 1 m = min(m, cnt) if cnt > 0: high....
import sys input = sys.stdin.readline N = int(input()) S = [input()[:-1] for _ in range(N)] high = [] low = [] for i in range(N): cnt = 0 m = 0 for j in range(len(S[i])): if S[i][j] == "(": cnt += 1 else: cnt -= 1 m = min(m, cnt) if cnt > 0: high....
[["+", 0, 1, 0, 652, 3, 4, 0, 653, 141, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 0, 32], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 51, 146]]
5
225
#include <bits/stdc++.h> using namespace std; int n, ct[1010101], nw[1010101], sum, al; string s; vector<pair<int, int>> v; bool cmp(pair<int, int> a, pair<int, int> b) { return min(a.second, a.first + b.second) > min(b.second, b.first + a.second); } int main() { cin >> n; for (int i = 0; i < n; i++) { cin >>...
#include <bits/stdc++.h> using namespace std; int n, ct[1010101], nw[1010101], sum, al; string s; vector<pair<int, int>> v; bool cmp(pair<int, int> a, pair<int, int> b) { return min(a.second, a.first + b.second) > min(b.second, b.first + a.second); } int main() { cin >> n; for (int i = 0; i < n; i++) { cin >>...
[["+", 0, 57, 15, 339, 51, 16, 12, 2, 63, 22], ["+", 15, 339, 51, 16, 12, 2, 3, 4, 0, 24], ["+", 15, 339, 51, 16, 12, 2, 3, 4, 0, 25]]
1
311
#include <bits/stdc++.h> #define syosu(x) fixed << setprecision(x) using namespace std; typedef long long ll; typedef unsigned int uint; typedef unsigned long long ull; typedef pair<int, int> P; typedef pair<double, double> pdd; typedef pair<ll, ll> pll; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<do...
#include <bits/stdc++.h> #define syosu(x) fixed << setprecision(x) using namespace std; typedef long long ll; typedef unsigned int uint; typedef unsigned long long ull; typedef pair<int, int> P; typedef pair<double, double> pdd; typedef pair<ll, ll> pll; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<do...
[["-", 0, 218, 8, 9, 0, 37, 0, 16, 17, 18], ["+", 0, 218, 8, 9, 0, 37, 0, 16, 17, 47]]
1
546
#include <bits/stdc++.h> using namespace std; #define li long long int #define rep(i, to) for (li i = 0; i < ((li)(to)); i++) #define repp(i, start, to) for (li i = (li)(start); i < ((li)(to)); i++) #define pb push_back #define sz(v) ((li)(v).size()) #define bgn(v) ((v).begin()) #define eend(v) ((v).end()) #define all...
#include <bits/stdc++.h> using namespace std; #define li long long int #define rep(i, to) for (li i = 0; i < ((li)(to)); i++) #define repp(i, start, to) for (li i = (li)(start); i < ((li)(to)); i++) #define pb push_back #define sz(v) ((li)(v).size()) #define bgn(v) ((v).begin()) #define eend(v) ((v).end()) #define all...
[["-", 3, 4, 0, 83, 0, 16, 31, 118, 119, 120], ["-", 0, 2, 3, 4, 0, 83, 0, 16, 17, 72], ["+", 3, 4, 0, 83, 0, 16, 31, 118, 119, 120], ["+", 0, 2, 3, 4, 0, 83, 0, 16, 17, 33], ["-", 3, 4, 0, 83, 0, 16, 12, 118, 119, 120], ["+", 3, 4, 0, 83, 0, 16, 12, 118, 119, 120]]
1
737
#include <bits/stdc++.h> using namespace std; const int mn = 1e6 + 7; string s, a[mn]; int n, cnt, l, r; struct node { int la, ra; } b[mn]; bool cmp(node a, node b) { if (a.la - a.ra != b.la - b.ra) return a.la - a.ra > b.la - b.ra; else return a.la < b.la; } int main() { scanf("%d", &n); for (int...
#include <bits/stdc++.h> using namespace std; const int mn = 1e6 + 7; string s, a[mn]; int n, cnt, l, r; struct node { int la, ra; } b[mn]; bool cmp(node a, node b) { if (a.la - a.ra != b.la - b.ra) return a.la - a.ra > b.la - b.ra; else return a.la < b.la; } int main() { scanf("%d", &n); for (int...
[["-", 0, 57, 15, 339, 51, 16, 12, 118, 119, 120], ["+", 0, 57, 15, 339, 51, 16, 12, 118, 119, 120]]
1
535
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef unsigned long long ull; #define rep(i, up) for (ll i = ...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef unsigned long long ull; #define rep(i, up) for (ll i = ...
[["-", 8, 9, 0, 37, 0, 16, 12, 118, 119, 120], ["+", 8, 9, 0, 37, 0, 16, 12, 118, 119, 120]]
1
811
#include <bits/stdc++.h> using namespace std; using ll = long long; using PII = pair<ll, ll>; #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) x.begin(), x.end() template <typename T> void chmin(T &a, const T &b) { a = min(a, b); } template <typename T> void chmax(T ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using PII = pair<ll, ll>; #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) x.begin(), x.end() template <typename T> void chmin(T &a, const T &b) { a = min(a, b); } template <typename T> void chmax(T ...
[["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 0, 2, 3, 4, 0, 2, 63, 346, 141, 22], ["+", 3, 4, 0, 2, 63, 346, 3, 347, 0, 18], ["+", 3, 4, 0, 2, 63, 346, 3, 347, 0, 47], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 25]]
1
437
import sys input=sys.stdin.readline def count(s): m=0 e=0 for t in s: if t=='(': e+=1 else: e-=1 m=min(m,e) return (e,m) def count_reverse(s): m=0 e=0 for t in s: if t==')': e+=1 else: e-=1 m=min...
import sys input=sys.stdin.readline def count(s): m=0 e=0 for t in s: if t=='(': e+=1 else: e-=1 m=min(m,e) return (e,m) def count_reverse(s): m=0 e=0 for t in s[::-1]: if t==')': e+=1 else: e-=1 ...
[["+", 0, 14, 8, 196, 0, 7, 12, 206, 0, 70], ["+", 8, 196, 0, 7, 12, 206, 206, 663, 0, 102], ["+", 0, 7, 12, 206, 206, 663, 0, 664, 17, 33], ["+", 0, 7, 12, 206, 206, 663, 0, 664, 28, 612], ["+", 0, 14, 8, 196, 0, 7, 12, 206, 0, 73]]
5
306
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<tuple<bool, int, int, int>> v; for (auto &e : v) { string s; cin >> s; int l = 0, r = 0; for (auto c : s) { if (c == '(') { l++; } else if (l > 0) { l--; } else { r++; ...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<tuple<bool, int, int, int>> v(n); for (auto &e : v) { string s; cin >> s; int l = 0, r = 0; for (auto c : s) { if (c == '(') { l++; } else if (l > 0) { l--; } else { r++;...
[["+", 8, 9, 0, 43, 49, 53, 54, 55, 0, 24], ["+", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 8, 9, 0, 43, 49, 53, 54, 55, 0, 25]]
1
212
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using ull = unsigned long long; #define all(x) x.begin(), x.end() template <typename T1, typename T2> inline void chkmin(T1 &x, const T2 &y) { if (x > y) x = y; } template <typename T1, typename T2> inline void chkmax(T1...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using ull = unsigned long long; #define all(x) x.begin(), x.end() template <typename T1, typename T2> inline void chkmin(T1 &x, const T2 &y) { if (x > y) x = y; } template <typename T1, typename T2> inline void chkmax(T1...
[["-", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
474
#include <bits/stdc++.h> #define int long long #define rep(i, a, n) for (int i = (int)(a); (i) < (int)(n); ++(i)) #define repe(i, a, n) for (int i = (int)(a); (i) <= (int)(n); ++(i)) #define repif(i, a, x) for (int i = (int)(a); (x); ++(i)) #define repr(i, a, n) for (int i = ((int)(a)-1); (i) >= (int)(n); --(i)) #defin...
#include <bits/stdc++.h> #define int long long #define rep(i, a, n) for (int i = (int)(a); (i) < (int)(n); ++(i)) #define repe(i, a, n) for (int i = (int)(a); (i) <= (int)(n); ++(i)) #define repif(i, a, x) for (int i = (int)(a); (x); ++(i)) #define repr(i, a, n) for (int i = ((int)(a)-1); (i) >= (int)(n); --(i)) #defin...
[["+", 3, 4, 0, 16, 31, 16, 12, 118, 119, 120], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 2, 3, 4, 0, 16, 12, 118, 28, 22], ["+", 0, 2, 3, 4, 0, 16, 12, 118, 17, 131]]
1
636
def main(): ## IMPORT MODULE #import sys #sys.setrecursionlimit(100000) #input=lambda :sys.stdin.readline().rstrip() #f_inf=float("inf") #MOD=10**9+7 if 'get_ipython' in globals(): ## SAMPLE INPUT n = 4 S = ['((()))', '((((((', '))))))', '()()()'] else: ## INPUT n = int(input...
def main(): ## IMPORT MODULE #import sys #sys.setrecursionlimit(100000) #input=lambda :sys.stdin.readline().rstrip() #f_inf=float("inf") #MOD=10**9+7 if 'get_ipython' in globals(): ## SAMPLE INPUT n = 4 S = ['((()))', '((((((', '))))))', '()()()'] else: ## INPUT n = int(input...
[["-", 75, 76, 8, 196, 0, 1, 0, 664, 17, 33], ["+", 75, 76, 8, 196, 0, 1, 0, 677, 31, 22], ["+", 75, 76, 8, 196, 0, 1, 0, 677, 17, 110]]
5
257
#include <bits/stdc++.h> using namespace std; mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count()); typedef long long ll; typedef long double ld; const int N = (int)1e6 + 7; int n, sumtop; struct T { int o; int mn; }; bool cmp1(T a, T b) { return a.mn > b.mn; } bool cmp2(T a, T b) { re...
#include <bits/stdc++.h> using namespace std; mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count()); typedef long long ll; typedef long double ld; const int N = (int)1e6 + 7; int n, sumtop; struct T { int o; int mn; }; bool cmp1(T a, T b) { return a.mn > b.mn; } bool cmp2(T a, T b) { re...
[["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33]]
1
431
import sys n=int(input()) jsum=0 gjlist=[] ejlist=[] esum=0 def jouka(t): global jsum global gjlist global ejlist global esum tmpj=0 tmpe=0 for i in range(len(t)): if t[i] == "(": tmpj += 1 else: if tmpj == 0: tmpe +=1 else: tmpj -=1 if tmpe == 0: jsum += tmpj elif tmpj == 0: e...
import sys n=int(input()) jsum=0 gjlist=[] ejlist=[] esum=0 def jouka(t): global jsum global gjlist global ejlist global esum tmpj=0 tmpe=0 for i in range(len(t)): if t[i] == "(": tmpj += 1 else: if tmpj == 0: tmpe +=1 else: tmpj -=1 if tmpe == 0: jsum += tmpj elif tmpj == 0: e...
[["-", 0, 1, 0, 677, 12, 657, 31, 206, 51, 22], ["+", 0, 1, 0, 677, 12, 657, 31, 206, 51, 22], ["-", 0, 1, 0, 677, 12, 657, 12, 206, 51, 22], ["+", 0, 1, 0, 677, 12, 657, 12, 206, 51, 22]]
5
268
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> l_l; typedef pair<int, int> i_i; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> l_l; typedef pair<int, int> i_i; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; ...
[["-", 0, 57, 15, 339, 51, 16, 31, 118, 119, 120], ["+", 0, 57, 15, 339, 51, 16, 31, 118, 119, 120], ["-", 0, 9, 0, 1, 0, 11, 12, 118, 119, 120], ["+", 0, 9, 0, 1, 0, 11, 12, 118, 119, 120]]
1
481
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef unsigned long long int ull; typedef vector<int> vii; typedef vector<ll> vll; typedef pair<ll, ll> pii; #define pb push_back #define odd(x) ((x)&1) #define even(x) (!odd(x)) #define ff it->first #define ss it->second #define all(v) (v).be...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef unsigned long long int ull; typedef vector<int> vii; typedef vector<ll> vll; typedef pair<ll, ll> pii; #define pb push_back #define odd(x) ((x)&1) #define even(x) (!odd(x)) #define ff it->first #define ss it->second #define all(v) (v).be...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
1,155
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; typedef long double ld; typedef pair<ll, ll> pii; typedef tuple<ll, ll, ll> ti; ll mod = 1E9 + 7; #define REP(a, b, c) for (ll a = b; a < (c); a++) #define PER(a, b, c) for (ll a = b; a >= (c); a--) ll ii() { ll x; ...
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; typedef long double ld; typedef pair<ll, ll> pii; typedef tuple<ll, ll, ll> ti; ll mod = 1E9 + 7; #define REP(a, b, c) for (ll a = b; a < (c); a++) #define PER(a, b, c) for (ll a = b; a >= (c); a--) ll ii() { ll x; ...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22]]
1
467
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int N; cin >> N; vector<string> Si(N); for (int n = 0; n < N; n++) { cin >> Si[n]; } vector<pair<int, int>> up, down; for (int n = 0; n < N; n++) { int h = 0, b = 0; for (int i = 0; i < Si[n].size(); ...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int N; cin >> N; vector<string> Si(N); for (int n = 0; n < N; n++) { cin >> Si[n]; } vector<pair<int, int>> up, down; for (int n = 0; n < N; n++) { int h = 0, b = 0; for (int i = 0; i < Si[n].size(); ...
[["-", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120], ["-", 31, 16, 31, 16, 12, 118, 28, 69, 28, 22], ["+", 31, 16, 31, 16, 12, 118, 28, 69, 28, 22], ["-", 51, 16, 31, 16, 12, 118, 28, 69, 28, 22], ["+", 51, 16, 31, 16, 12, 118, 28, 69, 28, 22]]
1
382
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <random> #include ...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <random> #include ...
[["-", 0, 218, 8, 9, 0, 37, 0, 16, 17, 47], ["+", 0, 218, 8, 9, 0, 37, 0, 16, 17, 18]]
1
408
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; #define INF ((1 << 30) - 1) #define LINF (1LL << 60) tem...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; #define INF ((1 << 30) - 1) #define LINF (1LL << 60) tem...
[["-", 75, 76, 0, 1, 0, 2, 63, 118, 28, 22], ["+", 75, 76, 0, 1, 0, 2, 63, 118, 28, 22]]
1
351
#include <algorithm> #include <cstdio> #define maxn 1000010 using namespace std; struct node { int l, r; } a[maxn]; int tot; char s[maxn]; int cmp(node a, node b) { return a.l - a.r > b.l - b.r; } int main() { int n, ln, rn; int i, j; ln = rn = 0; scanf("%d", &n); for (i = 1; i <= n; i++) { int l = 0, r...
#include <algorithm> #include <cstdio> #define maxn 1000010 using namespace std; struct node { int l, r; } a[maxn]; int tot; char s[maxn]; int cmp(node a, node b) { return a.l - a.r > b.l - b.r; } int main() { int n, ln, rn; int i, j; ln = rn = 0; scanf("%d", &n); for (i = 1; i <= n; i++) { int l = 0, r...
[["+", 0, 14, 8, 9, 0, 57, 64, 37, 0, 38]]
1
327
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define rep(i, n) for (int i = 0; i < (n); ++i) template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a =...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define rep(i, n) for (int i = 0; i < (n); ++i) template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a =...
[["+", 51, 16, 31, 16, 31, 16, 12, 118, 119, 120], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["+", 15, 339, 51, 16, 31, 16, 12, 118, 28, 22], ["+", 15, 339, 51, 16, 31, 16, 12, 118, 17, 131]]
1
466
import java.util.Comparator; import java.util.PriorityQueue; import java.util.Scanner; class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int N = in.nextInt(); long l = 0, r = 0; PriorityQueue<int[]> lq = new PriorityQueue<>(Comparator.comparing(x -> x[...
import java.util.Comparator; import java.util.PriorityQueue; import java.util.Scanner; class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int N = in.nextInt(); long l = 0, r = 0; PriorityQueue<int[]> lq = new PriorityQueue<>(Comparator.comparing(x -> x[...
[["-", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491]]
3
478
from itertools import chain N = int(input()) zenhan = [] kouhan = [] for _ in range(N): si = input() last = 0 low = last high = last for s in si: if s == "(": last += 1 else: last -= 1 low = min(low, last) high = max(high, last) if high + ...
from itertools import chain N = int(input()) zenhan = [] kouhan = [] for _ in range(N): si = input() last = 0 low = last high = last for s in si: if s == "(": last += 1 else: last -= 1 low = min(low, last) high = max(high, last) if last >=...
[["-", 0, 57, 15, 666, 0, 657, 31, 657, 31, 22], ["-", 0, 57, 15, 666, 0, 657, 31, 657, 17, 72], ["-", 0, 57, 15, 666, 0, 657, 31, 657, 12, 22], ["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 33], ["-", 0, 652, 3, 4, 0, 660, 0, 657, 31, 22], ["+", 0, 652, 3, 4, 0, 660, 0, 657, 31, 22], ["-", 0, 652, 3, 4, 0, 660, 0, 657, 12...
5
182
#include <bits/stdc++.h> using namespace std; using ll = int64_t; const ll MOD = 1000000007; int main() { int N; cin >> N; vector<pair<int, int>> S; int balance = 0; vector<pair<int, int>> pos_S, zero_S, neg_S; for (int i = 0; i < N; i++) { string s; cin >> s; int inner_balance = 0; int mi...
#include <bits/stdc++.h> using namespace std; using ll = int64_t; const ll MOD = 1000000007; int main() { int N; cin >> N; vector<pair<int, int>> S; int balance = 0; vector<pair<int, int>> pos_S, zero_S, neg_S; for (int i = 0; i < N; i++) { string s; cin >> s; int inner_balance = 0; int mi...
[["-", 0, 30, 0, 14, 8, 9, 0, 338, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 338, 12, 22]]
1
444
import sys input = sys.stdin.readline N = int(input()) S = [input()[:-1] for _ in range(N)] rl1, rl2 = [], [] for Si in S: l, r = 0, 0 for i in range(len(Si)): if Si[i]=='(': l += 1 else: if l==0: r += 1 else: l -= 1 ...
import sys input = sys.stdin.readline N = int(input()) S = [input()[:-1] for _ in range(N)] rl1, rl2 = [], [] for Si in S: l, r = 0, 0 for i in range(len(Si)): if Si[i]=='(': l += 1 else: if l==0: r += 1 else: l -= 1 ...
[["-", 0, 1, 0, 652, 3, 4, 0, 664, 17, 33], ["-", 0, 1, 0, 652, 3, 4, 0, 664, 28, 612], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 654], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 655]]
5
210
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < (n); i++) #define all(x) (x).begin(), (x).end() using ll = long long; using namespace std; using P = pair<ll, ll>; template <typename T> using vec = std::vector<T>; int main() { int N; cin >> N; vec<P> p; vec<P> m; rep(i, N) { string s; ci...
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < (n); i++) #define all(x) (x).begin(), (x).end() using ll = long long; using namespace std; using P = pair<ll, ll>; template <typename T> using vec = std::vector<T>; int main() { int N; cin >> N; vec<P> p; vec<P> m; rep(i, N) { string s; ci...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22]]
1
295
# +1/-1の折れ線で表したとき # 「0で終わる」かつ「途中で0未満にならない」を満たせば良い # あとは貪欲を上手い事使う def main(): import sys input = sys.stdin.readline sys.setrecursionlimit(10**7) from collections import Counter, deque from itertools import combinations, permutations, accumulate, groupby, product from bisect import bisect_left,...
# +1/-1の折れ線で表したとき # 「0で終わる」かつ「途中で0未満にならない」を満たせば良い # あとは貪欲を上手い事使う def main(): import sys input = sys.stdin.readline sys.setrecursionlimit(10**7) from collections import Counter, deque from itertools import combinations, permutations, accumulate, groupby, product from bisect import bisect_left,...
[["+", 0, 14, 8, 196, 0, 7, 75, 76, 0, 95], ["+", 0, 14, 8, 196, 0, 7, 75, 76, 0, 102], ["+", 75, 76, 8, 196, 0, 7, 75, 76, 0, 95], ["+", 75, 76, 8, 196, 0, 7, 75, 76, 0, 102]]
5
285
#include <bits/stdc++.h> using namespace std; vector<string> str; vector<pair<int, int>> opclo; bool cmp1(const int &a, const int &b) { return (opclo[a].second < opclo[b].second); } bool cmp2(const int &a, const int &b) { return (opclo[a].first < opclo[b].first); } vector<int> ind; int main() { ios_base::sync_...
#include <bits/stdc++.h> using namespace std; vector<string> str; vector<pair<int, int>> opclo; bool cmp1(const int &a, const int &b) { return (opclo[a].first < opclo[b].first); } bool cmp2(const int &a, const int &b) { return (opclo[a].second < opclo[b].second); } vector<int> ind; int main() { ios_base::sync_...
[["-", 0, 37, 0, 23, 0, 16, 31, 118, 119, 120], ["+", 0, 37, 0, 23, 0, 16, 31, 118, 119, 120], ["-", 0, 37, 0, 23, 0, 16, 12, 118, 119, 120], ["+", 0, 37, 0, 23, 0, 16, 12, 118, 119, 120]]
1
606
//#include<iostream> #include <bits/stdc++.h> using namespace std; int n; vector<pair<int, string>> op, cl, bl; void process(string s) { int o = 0, c = 0; for (int i = 0; i < (int)s.size(); i++) { if (s[i] == '(') o++; else c++; } if (o > c) op.push_back({o, s}); if (o < c) cl.pu...
//#include<iostream> #include <bits/stdc++.h> using namespace std; int n; vector<pair<int, string>> op, cl, bl; void process(string s) { int o = 0, c = 0; for (int i = 0; i < (int)s.size(); i++) { if (s[i] == '(') o++; else c++; } if (o > c) op.push_back({c, s}); if (o < c) cl.pu...
[["-", 64, 1, 0, 2, 3, 4, 0, 83, 0, 22], ["+", 64, 1, 0, 2, 3, 4, 0, 83, 0, 22]]
1
427
#include "bits/stdc++.h" #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using P = pair<int, int>; bool check(vector<P> st) { int bottom, last = 0; for (P p : st) { bottom += last + p.first; if (bottom < 0) return false; last += p.second; } return true; } int main() { ...
#include "bits/stdc++.h" #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using P = pair<int, int>; bool check(vector<P> st) { int bottom, last = 0; for (P p : st) { bottom = last + p.first; if (bottom < 0) return false; last += p.second; } return true; } int main() { i...
[["-", 0, 338, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 338, 8, 9, 0, 1, 0, 11, 17, 32]]
1
262
n = int(input()) s = [] for i in range(n): s.append(input()) ls = [] rs = [] tot = 0 for si in s: b = 0 h = 0 for c in si: if c == '(': h += 1 else: h -= 1 b = min(h,b) if h > 0: ls.append((b,h)) else: rs.append((b-h,-h)) tot += h ls.sort(reverse = True) rs.sort(reverse = ...
n = int(input()) s = [] for i in range(n): s.append(input()) ls = [] rs = [] tot = 0 for si in s: b = 0 h = 0 for c in si: if c == '(': h += 1 else: h -= 1 b = min(h,b) if h > 0: ls.append((b,h)) else: rs.append((b-h,-h)) tot += h ls.sort(reverse = True) rs.sort(reverse = ...
[["-", 0, 7, 8, 196, 0, 1, 0, 677, 12, 22], ["+", 0, 7, 8, 196, 0, 1, 0, 677, 12, 22]]
5
186
N, *Ss = readlines.map(&:chomp) as, os, ls = [], 0, 0 Ss.each do |s| o, c = 0, 0 s.chars.each do |x| if x == ')' o == 0 ? c += 1 : o -= 1 else o += 1 end end if o == 0 cs += c elsif c == 0 os += o else as << [c, o] end end.transpose xs.sort_by{|c, o| c - o}.each do |c...
N, *Ss = readlines.map(&:chomp) as, os, cs = [], 0, 0 Ss.each do |s| o, c = 0, 0 s.chars.each do |x| if x == ')' o == 0 ? c += 1 : o -= 1 else o += 1 end end if o == 0 cs += c elsif c == 0 os += o else as << [c, o] end end as.sort_by{|c, o| c - o}.each do |c, o| os ...
[["-", 36, 36, 0, 493, 0, 662, 31, 761, 0, 22], ["+", 36, 36, 0, 493, 0, 662, 31, 761, 0, 22], ["-", 36, 36, 36, 36, 0, 493, 0, 652, 17, 131], ["-", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22], ["-", 36, 36, 0, 493, 0, 652, 486, 652, 486, 22], ["+", 36, 36, 0, 493, 0, 652, 486, 652, 486, 22]]
4
141
n=int(input()) s=[0]*n info=[0]*n for i in range(n): ss=list(input()) now=0 mi=0 for sss in ss: if sss=="(": now+=1 else: now-=1 mi=min(mi,now) info[i]=(mi,now) #info.sort(key=lambda x:(x[1]>=0)*2+(x[0]>=0),reverse=True ) info0 = [] info1 = [] for...
n=int(input()) s=[0]*n info=[0]*n for i in range(n): ss=list(input()) now=0 mi=0 for sss in ss: if sss=="(": now+=1 else: now-=1 mi=min(mi,now) info[i]=(mi,now) #info.sort(key=lambda x:(x[1]>=0)*2+(x[0]>=0),reverse=True ) info0 = [] info1 = [] for...
[["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 21], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 141, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 0, 32], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 51, 146]]
5
244
#include <bits/stdc++.h> using namespace std; // #define int long long // #define double long double #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define FORR(i, a, b) for (int i = (a); i > (b); --i) #define REP(i, n) for (int i = 0; i < (n); ++i) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOREAC...
#include <bits/stdc++.h> using namespace std; // #define int long long // #define double long double #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define FORR(i, a, b) for (int i = (a); i > (b); --i) #define REP(i, n) for (int i = 0; i < (n); ++i) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOREAC...
[["-", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22]]
1
1,267
#include <bits/stdc++.h> using namespace std; // #define int long long // #define double long double #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define FORR(i, a, b) for (int i = (a); i > (b); --i) #define REP(i, n) for (int i = 0; i < (n); ++i) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOREAC...
#include <bits/stdc++.h> using namespace std; // #define int long long // #define double long double #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define FORR(i, a, b) for (int i = (a); i > (b); --i) #define REP(i, n) for (int i = 0; i < (n); ++i) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOREAC...
[["-", 0, 218, 8, 9, 0, 37, 0, 16, 17, 18], ["+", 0, 218, 8, 9, 0, 37, 0, 16, 17, 47], ["-", 8, 9, 0, 1, 0, 11, 12, 69, 28, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 69, 28, 22]]
1
1,195
#include <bits/stdc++.h> #define Int int64_t using namespace std; int main() { int N; cin >> N; vector<string> s(N); for (int i = 0; i < N; ++i) { cin >> s[i]; } vector<pair<int, int>> a, b; for (int i = 0; i < N; ++i) { int sum = 0, min_s = 1e8; for (auto c : s[i]) { if (c == '(') { ...
#include <bits/stdc++.h> #define Int int64_t using namespace std; int main() { int N; cin >> N; vector<string> s(N); for (int i = 0; i < N; ++i) { cin >> s[i]; } vector<pair<int, int>> a, b; for (int i = 0; i < N; ++i) { int sum = 0, min_s = 1e8; for (auto c : s[i]) { if (c == '(') { ...
[["+", 0, 1, 0, 2, 3, 4, 0, 91, 17, 33]]
1
339
#include <bits/stdc++.h> using namespace std; using ll = long long; bool check(vector<pair<int, int>> a) { int cur = 0; for (auto i : a) { if (cur + i.first < 0) return 0; cur += i.second; } return 1; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, total = 0...
#include <bits/stdc++.h> using namespace std; using ll = long long; bool check(vector<pair<int, int>> a) { int cur = 0; for (auto i : a) { if (cur + i.first < 0) return 0; cur += i.second; } return 1; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, total = 0...
[["-", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120]]
1
285
#include <bits/stdc++.h> using namespace std; using ll = long long; bool check(vector<pair<int, int>> a) { int cur = 0; for (auto i : a) { if (cur + i.first < 0) return 0; cur += i.second; } return 1; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, total = 0...
#include <bits/stdc++.h> using namespace std; using ll = long long; bool check(vector<pair<int, int>> a) { int cur = 0; for (auto i : a) { if (cur + i.first < 0) return 0; cur += i.second; } return 1; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, total = 0...
[["-", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120]]
1
281
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys sys.setrecursionlimit(10**7) from pprint import pprint as pp from pprint import pformat as pf # @pysnooper.snoop() #import pysnooper # debug import math #from sortedcontainers import SortedList, SortedDict, SortedSet # no in atcoder import bisect class Part: ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys sys.setrecursionlimit(10**7) from pprint import pprint as pp from pprint import pformat as pf # @pysnooper.snoop() #import pysnooper # debug import math #from sortedcontainers import SortedList, SortedDict, SortedSet # no in atcoder import bisect class Part: ...
[["-", 8, 196, 0, 1, 0, 677, 12, 319, 319, 22], ["+", 8, 196, 0, 1, 0, 677, 12, 319, 319, 22]]
5
484
#include <bits/stdc++.h> using namespace std; // 1点更新,区間最小 class SegmentTree { public: SegmentTree(int64_t n, int64_t value) { n_ = (int64_t)pow(2, ceil(log2(n))); nodes_.resize(2 * n_ - 1, make_pair(value, INT_MIN)); } void update(int64_t x, int64_t v) { nodes_[x + n_ - 1].first = v; nodes_[x +...
#include <bits/stdc++.h> using namespace std; // 1点更新,区間最小 class SegmentTree { public: SegmentTree(int64_t n, int64_t value) { n_ = (int64_t)pow(2, ceil(log2(n))); nodes_.resize(2 * n_ - 1, make_pair(value, INT_MIN)); } void update(int64_t x, int64_t v) { nodes_[x + n_ - 1].first = v; nodes_[x +...
[["+", 15, 339, 51, 16, 31, 16, 31, 16, 17, 72], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]]
1
806
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<pair<int, int>> left, right; for (int i = 0; i < N; i++) { string s; cin >> s; int d = 0, mi_d = 0; for (auto c : s) { if (c == '(') d++; else d--; mi_d = min(mi_d, d); } ...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<pair<int, int>> left, right; for (int i = 0; i < N; i++) { string s; cin >> s; int d = 0, mi_d = 0; for (auto c : s) { if (c == '(') d++; else d--; mi_d = min(mi_d, d); } ...
[["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
274
#pragma GCC optimize("O3") #pragma GCC target("avx2") #include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i <= (n); i++) #define co(x) cout << (x) << "\n" #define cosp(x) cout << (x) << " " #define ce(x) cerr << (x) << "\...
#pragma GCC optimize("O3") #pragma GCC target("avx2") #include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i <= (n); i++) #define co(x) cout << (x) << "\n" #define cosp(x) cout << (x) << " " #define ce(x) cerr << (x) << "\...
[["-", 0, 11, 12, 16, 31, 118, 28, 69, 28, 22], ["+", 0, 11, 12, 16, 31, 118, 28, 69, 28, 22], ["-", 0, 11, 12, 16, 12, 118, 28, 69, 28, 22], ["+", 0, 11, 12, 16, 12, 118, 28, 69, 28, 22]]
1
551
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <random> #include ...
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <random> #include ...
[["-", 0, 218, 8, 9, 0, 37, 0, 16, 17, 18], ["+", 0, 218, 8, 9, 0, 37, 0, 16, 17, 47]]
1
587
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return tr...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return tr...
[["-", 0, 2, 3, 4, 0, 2, 63, 118, 28, 22], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 28, 22]]
1
469
// // Created by bytedance on 2020/5/12. // #include <bits/stdc++.h> using namespace std; const int maxn = 1e6 + 5; char shit[maxn]; int main() { int n; scanf("%d", &n); vector<vector<int>> a(maxn), s(maxn); for (int i = 0; i < n; i++) { scanf("%s", shit); int need = 0, off = 0; int l = strlen(s...
// // Created by bytedance on 2020/5/12. // #include <bits/stdc++.h> using namespace std; const int maxn = 1e6 + 5; char shit[maxn]; int main() { int n; scanf("%d", &n); vector<vector<int>> a(maxn), s(maxn); for (int i = 0; i < n; i++) { scanf("%s", shit); int need = 0, off = 0; int l = strlen(s...
[["-", 15, 339, 51, 16, 31, 69, 341, 342, 0, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 22]]
1
410
#include <stdio.h> int main(void) { char s[10]; scanf("%s", s); if (s[1] == 'B') { printf("ARC\n"); } else { printf("ARC\n"); } return 0; }
#include <stdio.h> int main(void) { char s[10]; scanf("%s", s); if (s[1] == 'B') { printf("ARC\n"); } else { printf("ABC\n"); } return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
59
#include <bits/stdc++.h> #include <string> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main(void) { string s; cin >> s; if (s == "ABC") cout << "ARC"; cout << "ABC"; return 0; }
#include <bits/stdc++.h> #include <string> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main(void) { string s; cin >> s; if (s == "ABC") cout << "ARC"; else cout << "ABC"; return 0; }
[["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95]]
1
69
function main(input) { console.log(input === 'ABC' ? 'ARC' : 'ABC') } main(require('fs').readFileSync('/dev/stdin', 'utf8'))
function main(input) { console.log(input.trim() === 'ABC' ? 'ARC' : 'ABC') } main(require('fs').readFileSync('/dev/stdin', 'utf8'))
[["+", 0, 510, 15, 16, 31, 2, 63, 558, 0, 131], ["+", 0, 510, 15, 16, 31, 2, 63, 558, 559, 560], ["+", 0, 510, 15, 16, 31, 2, 3, 3, 0, 24], ["+", 0, 510, 15, 16, 31, 2, 3, 3, 0, 25]]
2
45
import sys #import cython def main(): read = lambda: sys.stdin.readline().rstrip() #N: cython.longlong = 0 N = read() print("ABC" if N[1]=="B" else "ARC") if __name__ == "__main__": main()
import sys #import cython def main(): read = lambda: sys.stdin.readline().rstrip() #N: cython.longlong = 0 N = read() print("ABC" if N[1]=="R" else "ARC") if __name__ == "__main__": main()
[["-", 3, 4, 0, 41, 0, 666, 0, 557, 0, 6], ["+", 3, 4, 0, 41, 0, 666, 0, 557, 0, 6]]
5
58
print("ABC" if input() is "ARC" else "ARC")
print("ABC" if input() == "ARC" else "ARC")
[["-", 0, 652, 3, 4, 0, 41, 0, 666, 667, 709], ["+", 0, 652, 3, 4, 0, 41, 0, 666, 667, 60]]
5
18
function Main(input) { tmp = input.split(" "); s = tmp[0]; if (s === "ABC") { console.log("ARC"); } else if (s === "ARC") { console.log("ABC"); } } Main(require("fs").readFileSync("/dev/stdin", "utf8"));
function Main(input) { tmp = input.split("\n"); s = tmp[0]; if (s === "ABC") { console.log("ARC"); } else if (s === "ARC") { console.log("ABC"); } } Main(require("fs").readFileSync("/dev/stdin", "utf8"));
[["-", 0, 11, 12, 2, 3, 3, 0, 557, 0, 491], ["+", 0, 11, 12, 2, 3, 3, 0, 557, 0, 44]]
2
85
def main(): s = input() if s == 'ABC': print('ARC') else: print(s) if __name__ == '__main__': main()
def main(): s = input() if s == 'ABC': print('ARC') else: print('ABC') if __name__ == '__main__': main()
[["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 654], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 655]]
5
39
S = input() if S == 'ABC': print(ARC) else: print(ABC)
S = input() if S == 'ABC': print('ARC') else: print('ABC')
[["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 654], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 655]]
5
22
#include <bits/stdc++.h> using namespace std; // DEFINE and // TYPEDEF-------------------------------------------------------------- #define timeKyaHorhaH 1.0 * clock() / CLOCKS_PER_SEC #define FORG(i, a, n) for (lld i = a; i < n; i++) // for - general #define FORZ(i, n) for (lld i = 0; i < n; i++) // for - zero ...
#include <bits/stdc++.h> using namespace std; // DEFINE and // TYPEDEF-------------------------------------------------------------- #define timeKyaHorhaH 1.0 * clock() / CLOCKS_PER_SEC #define FORG(i, a, n) for (lld i = a; i < n; i++) // for - general #define FORZ(i, n) for (lld i = 0; i < n; i++) // for - zero ...
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
576
/** * code generated by JHelper * More info: https://github.com/AlexeyDmitriev/JHelper * @author yosiiii */ #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (long long int i = 0; i < (n); ++i) typedef long long int ll; class AAC { public: void solve(std::istream &in, std::ostream &out) { ...
/** * code generated by JHelper * More info: https://github.com/AlexeyDmitriev/JHelper * @author yosiiii */ #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (long long int i = 0; i < (n); ++i) typedef long long int ll; class AAC { public: void solve(std::istream &in, std::ostream &out) { ...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
124
s=str(input()) if s[1]==B: print('ARC') else: print('ABC')
s=str(input()) if s[1]=='B': print('ARC') else: print('ABC')
[["+", 0, 656, 0, 57, 15, 666, 0, 557, 0, 654], ["+", 0, 656, 0, 57, 15, 666, 0, 557, 0, 655]]
5
30
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; typedef unsigned long long ll...
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; typedef unsigned long long ll...
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
98
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; if (s[1] = 'B') cout << "ARC\n"; else cout << "ABC\n"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; if (s[1] == 'B') cout << "ARC\n"; else cout << "ABC\n"; return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 11, 17, 32], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60]]
1
48