problem_id
stringlengths
6
6
language
stringclasses
2 values
original_status
stringclasses
3 values
original_src
stringlengths
19
243k
changed_src
stringlengths
19
243k
change
stringclasses
3 values
i1
int64
0
8.44k
i2
int64
0
8.44k
j1
int64
0
8.44k
j2
int64
0
8.44k
error
stringclasses
270 values
stderr
stringlengths
0
226k
p03109
Python
Runtime Error
from datetime import date dt = date.fromisoformat(input().replace("/", "-")) th = date.fromisoformat("2019-04-30") if dt <= th: print("Heisei") else: print("TBD")
y, m, d = map(int, input().split("/")) if y < 2019: print("Heisei") elif y == 2019 and m < 5: print("Heisei") else: print("TBD")
replace
0
5
0
4
0
p03109
Python
Runtime Error
A, B, C = map(int, input().split(" ")) ymd = tuple(map(int, input().split("/"))) if ymd <= (2019, 4, 30): print("Heisei") else: print("TBD")
ymd = tuple(map(int, input().split("/"))) if ymd <= (2019, 4, 30): print("Heisei") else: print("TBD")
delete
0
1
0
0
ValueError: invalid literal for int() with base 10: '2019/04/30'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03109/Python/s758016076.py", line 1, in <module> A, B, C = map(int, input().split(' ')) ValueError: invalid literal for int() with base 10: '2019/04/30'
p03109
Python
Runtime Error
date = input() date = date.replace("/", "") if date <= 20190430: print("Heisei") else: print("TBD")
date = input() date = int(date.replace("/", "")) if date <= 20190430: print("Heisei") else: print("TBD")
replace
2
3
2
3
TypeError: '<=' not supported between instances of 'str' and 'int'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03109/Python/s278452814.py", line 4, in <module> if date <= 20190430: TypeError: '<=' not supported between instances of 'str' and 'int'
p03109
Python
Runtime Error
s = map(int, input().split("/")) print("Heisei" if s <= 20190430 else "TBD")
s = int(input().replace("/", "")) print("Heisei" if s <= 20190430 else "TBD")
replace
0
1
0
1
TypeError: '<=' not supported between instances of 'map' and 'int'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03109/Python/s969500454.py", line 2, in <module> print("Heisei" if s <= 20190430 else "TBD") TypeError: '<=' not supported between instances of 'map' and 'int'
p03109
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string S; if (S.at(5) == '1') { cout << "TBD" << endl; } else if (S.at(6) == '1' || S.at(6) == '2' || S.at(6) == '3' || S.at(6) == '4') { cout << "Heisei" << endl; } else { cout << "TBD" << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; if (S.at(5) == '1') { cout << "TBD" << endl; } else if (S.at(6) == '1' || S.at(6) == '2' || S.at(6) == '3' || S.at(6) == '4') { cout << "Heisei" << endl; } else { cout << "TBD" << endl; } }
insert
5
5
5
6
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 5) >= this->size() (which is 0)
p03109
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, d, e, f; while (scanf("%d/%d/%d", &a, &b, &c)) { if (b <= 4) { cout << "Heisei" << endl; } else { cout << "TBD" << endl; } } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, d, e, f; scanf("%d/%d/%d", &a, &b, &c); if (b <= 4) { cout << "Heisei" << endl; } else { cout << "TBD" << endl; } return 0; }
replace
4
10
4
10
TLE
p03109
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string s; string year = s.substr(0, 4); string month = s.substr(5, 2); string day = s.substr(8, 2); int yearI = stoi(year); int monthI = stoi(month); int dayI = stoi(day); if (yearI > 2019) { cout << "TBD"; } else { if (monthI > 4) ...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; string year = s.substr(0, 4); string month = s.substr(5, 2); string day = s.substr(8, 2); int yearI = stoi(year); int monthI = stoi(month); int dayI = stoi(day); if (yearI > 2019) { cout << "TBD"; } else { if (...
insert
5
5
5
6
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::substr: __pos (which is 5) > this->size() (which is 0)
p03109
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int a, b, c, d; a = (int)(s.at(6) - '0'); b = (int)(s.at(7) - '0'); c = (int)(s.at(9) - '0'); d = (int)(s.at(10) - '0'); if (10 * a + b >= 5) { cout << "TBD"; } else { cout << "Heisei"; } }
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int a, b, c, d; a = (int)(s.at(5) - '0'); b = (int)(s.at(6) - '0'); c = (int)(s.at(8) - '0'); d = (int)(s.at(9) - '0'); if (10 * a + b >= 5) { cout << "TBD"; } else { cout << "Heisei"; } }
replace
6
10
6
10
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 10) >= this->size() (which is 10)
p03109
Python
Runtime Error
a = int(input().split("/")) if a[1] <= 4: print("Heisei") else: print("TBD")
S = input().split("/") if int(S[1]) < 5: print("Heisei") else: print("TBD")
replace
0
2
0
2
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03109/Python/s386069214.py", line 1, in <module> a = int(input().split("/")) TypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'
p03109
Python
Runtime Error
s = sorted(input()) t = sorted(input())[::-1] print("Yes" if s < t else "No")
S = input() print("Heisei" if S <= "2019/04/30" else "TBD")
replace
0
3
0
2
EOFError: EOF when reading a line
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03109/Python/s553178748.py", line 2, in <module> t = sorted(input())[:: -1] EOFError: EOF when reading a line
p03109
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define vll vector<ll> #define pb push_back #define rep(i, a, b, c) for (ll i = (a); i <= (b); i += (c)) #define repb(i, a, b, c) for (ll i = (a); i >= (b); i -= (c)) #define MOD 1000000007 #define ld double #define mp make_pair #define vpll vector<pair<ll, ll>> #define vll...
#include <bits/stdc++.h> #define ll long long #define vll vector<ll> #define pb push_back #define rep(i, a, b, c) for (ll i = (a); i <= (b); i += (c)) #define repb(i, a, b, c) for (ll i = (a); i >= (b); i -= (c)) #define MOD 1000000007 #define ld double #define mp make_pair #define vpll vector<pair<ll, ll>> #define vll...
replace
133
145
133
134
0
p03109
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int y = stoi(s.substr(0, 4)); int m = stoi(s.substr(4, 2)); int d = stoi(s.substr(7, 2)); if (y > 2019 || (y == 2019 && m > 4)) cout << "TBD"; else cout << "Heisei"; }
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int y = stoi(s.substr(0, 4)); int m = stoi(s.substr(5, 2)); int d = stoi(s.substr(8, 2)); if (y > 2019 || (y == 2019 && m > 4)) cout << "TBD"; else cout << "Heisei"; }
replace
7
9
7
9
-6
terminate called after throwing an instance of 'std::invalid_argument' what(): stoi
p03109
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define INT(a) scanf("%d", &a) #define STR(a) scanf("%s", a) #define DBL(a) scanf("%lf", &a) #define LNG(a) scanf("%lld", &a) #define PI acos(-1) int main() { string s; cin >> s; int date = 0, year = 0; bool f = 0; for (int i = s.length() - 1; i >= 0; i++) { ...
#include <bits/stdc++.h> using namespace std; #define INT(a) scanf("%d", &a) #define STR(a) scanf("%s", a) #define DBL(a) scanf("%lf", &a) #define LNG(a) scanf("%lld", &a) #define PI acos(-1) int main() { string s; cin >> s; int year = (s[5] - '0') * 10 + (s[6] - '0'); if (year > 4) cout << "TBD\n"; els...
replace
11
24
11
13
0
p03109
C++
Runtime Error
#include <iostream> #include <string> using namespace std; int main() { int a, b, c; scanf("%d/%d/%d", a, b, c); if (b > 4) cout << "TBD" << endl; else cout << "Heisei" << endl; }
#include <iostream> #include <string> using namespace std; int main() { int a, b, c; scanf("%d/%d/%d", &a, &b, &c); if (b > 4) cout << "TBD" << endl; else cout << "Heisei" << endl; }
replace
5
6
5
6
-11
p03109
C++
Runtime Error
#include <iostream> #include <string> int main() { std::string S; std::cin >> S; std::string s1; std::string s2; std::string s3; s1 = S[0] + S[1] + S[2] + S[3]; s2 = S[5] + S[6]; s3 = S[8] + S[9]; if (std::stoi(s1) <= 2019 && std::stoi(s2) <= 4 && std::stoi(s3) <= 30) { std::cout << "Heisei" ...
#include <iostream> #include <string> int main() { std::string S; std::cin >> S; std::string s1; std::string s2; std::string s3; s1 = S.substr(0, 4); s2 = S.substr(5, 2); s3 = S.substr(8, 2); if (std::stoi(s1) <= 2019 && std::stoi(s2) <= 4 && std::stoi(s3) <= 30) { std::cout << "Heisei" << st...
replace
12
15
12
15
-6
terminate called after throwing an instance of 'std::invalid_argument' what(): stoi
p03109
C++
Runtime Error
#pragma gcc optimize("Ofast") #include <bits/stdc++.h> using namespace std; using ll = long long; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(V) (V).begin(), (V).end() #define SORT(V) sort(ALL(V)) // 小さい方からソート #define REV(V) reverse(ALL(V)) // リバース #define RSORT(V...
#pragma gcc optimize("Ofast") #include <bits/stdc++.h> using namespace std; using ll = long long; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(V) (V).begin(), (V).end() #define SORT(V) sort(ALL(V)) // 小さい方からソート #define REV(V) reverse(ALL(V)) // リバース #define RSORT(V...
replace
77
78
77
78
-6
terminate called after throwing an instance of 'std::invalid_argument' what(): stoi
p03109
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; string t = "TBD"; string u; int i; for (i = 0; i < 10; i++) { if (s.at(i) != '/') { u.at(i) = s.at(i); } } int a = stoi(u); if (a / 10000 < 2019) { t = "Heisei"; } if (a / 10000 == 2019 && a - 20190000...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; string t = "TBD"; if (s <= "2019/04/30") { t = "Heisei"; } cout << t; }
replace
6
18
6
7
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 0) >= this->size() (which is 0)
p03109
C++
Runtime Error
#include <cstdio> #include <stdio.h> #include <string.h> #include <time.h> int main() { int y, m, d; scanf("%d/%d/%d", y, m, d); if (y > 2019 || y == 2019 && m >= 5) { printf("TBD"); } else { printf("Heisei"); } return 0; }
#include <cstdio> #include <stdio.h> #include <string.h> #include <time.h> int main() { int y, m, d; scanf("%d/%d/%d", &y, &m, &d); if (y > 2019 || y == 2019 && m >= 5) { printf("TBD"); } else { printf("Heisei"); } return 0; }
replace
7
8
7
8
-11
p03109
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cstdlib> #include <fstream> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <stack> #include <stdio.h> #include <string> #include <time.h> #include <tuple> #include <unord...
#include <algorithm> #include <cassert> #include <cstdlib> #include <fstream> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <stack> #include <stdio.h> #include <string> #include <time.h> #include <tuple> #include <unord...
replace
39
40
39
40
-6
terminate called after throwing an instance of 'std::invalid_argument' what(): stoi
p03110
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; #define pb push_back #define mp make_pair #define ff first #define ss second typedef long long ll; typedef vector<ll> vi; typedef vector<vi> vvi; typedef pair<ll, ll> ...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; #define pb push_back #define mp make_pair #define ff first #define ss second typedef long long ll; typedef vector<ll> vi; typedef vector<vi> vvi; typedef pair<ll, ll> ...
replace
38
39
38
39
0
p03110
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repr(i, n) for (int i = (int)(n); i > 0; i++) using ll = long long; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; cout << fixed << setprecision(10); double ans = 0; rep(i, ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repr(i, n) for (int i = (int)(n); i > 0; i++) using ll = long long; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; cout << fixed << setprecision(10); double ans = 0; rep(i, ...
replace
15
17
15
17
-6
terminate called after throwing an instance of 'std::logic_error' what(): basic_string: construction from null is not valid
p03110
C++
Runtime Error
#include <iostream> using namespace std; int main() { int n, i; double s; s = 0; cin >> n; double a[n]; string u[n]; for (i = 1; i <= n; i++) { cin >> a[i] >> u[i]; if (u[i] == "JPY") { s = s + a[i]; } else if (u[i] == "BTC") { s = s + a[i] * 380000; } } cout << s << endl...
#include <iostream> using namespace std; int main() { int n, i; double s; s = 0; cin >> n; double a[n]; string u[n]; for (i = 0; i <= n - 1; i++) { cin >> a[i] >> u[i]; if (u[i] == "JPY") { s = s + a[i]; } else if (u[i] == "BTC") { s = s + a[i] * 380000; } } cout << s << ...
replace
11
12
11
12
0
p03110
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; double x[n], s = 0; string t[n]; for (int i = 0; i < n; i++) { cin >> x[i] >> t[i]; if (t[n] == "JPY") s += x[i]; else s += x[i] * 380000; } cout << fixed << setprecision(15) << s; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; double x[n], s = 0; string t[n]; for (int i = 0; i < n; i++) { cin >> x[i] >> t[i]; if (t[i] == "JPY") s += x[i]; else s += x[i] * 380000; } cout << fixed << setprecision(15) << s; }
replace
9
10
9
10
-11
p03110
Python
Runtime Error
N = int(input()) sum = 0.0 for i in range(N): x = float(input()) u = input() if u == "JPY": sum = sum + x else: sum = sum + x * 380000 print(sum)
N = int(input()) sum = 0.0 for i in range(N): S = input() S = S.split() x = float(S[0]) u = S[1] if u == "JPY": sum = sum + x else: sum = sum + x * 380000 print(sum)
replace
5
7
5
10
ValueError: could not convert string to float: '10000 JPY'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03110/Python/s819401905.py", line 6, in <module> x = float(input()) ValueError: could not convert string to float: '10000 JPY'
p03110
C++
Runtime Error
#include <algorithm> #include <climits> #include <iostream> #include <map> #include <numeric> #include <set> #include <string> #include <vector> using namespace std; #define all(collection) (collection).begin(), (collection).end() #define loop(i, times) for (int i = 0; i < times; i++) #define seloop(i, start_index, e...
#include <algorithm> #include <climits> #include <iostream> #include <map> #include <numeric> #include <set> #include <string> #include <vector> using namespace std; #define all(collection) (collection).begin(), (collection).end() #define loop(i, times) for (int i = 0; i < times; i++) #define seloop(i, start_index, e...
insert
25
25
25
30
-6
terminate called after throwing an instance of 'std::invalid_argument' what(): stod
p03111
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> II; typedef vector<II> VII; typedef vector<int> VI; typedef vector<VI> VVI; typedef long long int LL; typedef vector<LL> VL; typedef unsigned long long int ULL; #define PB push_back #define MP make_pair #define F first #define S second #define SZ(a) ...
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> II; typedef vector<II> VII; typedef vector<int> VI; typedef vector<VI> VVI; typedef long long int LL; typedef vector<LL> VL; typedef unsigned long long int ULL; #define PB push_back #define MP make_pair #define F first #define S second #define SZ(a) ...
insert
96
96
96
98
0
p03111
C++
Runtime Error
#include <algorithm> #include <climits> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define repf(i, m, n) for (int(i) = m; (i) < n; (i)++) #define all(v) (v).begin(), (v).end() #define ll long long #define vec(n, m, v...
#include <algorithm> #include <climits> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define repf(i, m, n) for (int(i) = m; (i) < n; (i)++) #define all(v) (v).begin(), (v).end() #define ll long long #define vec(n, m, v...
replace
11
12
11
12
0
p03111
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; #define REP(i, n) for (int i = 0; i < (n); ++i) #define SORT(v) sort((v).begin(), (v).end()) #define RSORT(v) sort((v).rbegin(), (v).rend()) const ll MOD = 1000000007; const int nmax = 8; ll N, A, B, C; std::vector<long long> l(N + 1); bool graph[nmax]...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define REP(i, n) for (int i = 0; i < (n); ++i) #define SORT(v) sort((v).begin(), (v).end()) #define RSORT(v) sort((v).rbegin(), (v).rend()) const ll MOD = 1000000007; const int nmax = 8; ll N, A, B, C; std::vector<long long> l(N + 100); bool graph[nma...
replace
9
10
9
10
0
p03111
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <math.h> #include <queue> #include <set> #include <stdlib.h> #include <string> #include <utility> #include <vector> using namespace std; typedef long long int ll; typedef long double ld; template ...
#include <algorithm> #include <bitset> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <math.h> #include <queue> #include <set> #include <stdlib.h> #include <string> #include <utility> #include <vector> using namespace std; typedef long long int ll; typedef long double ld; template ...
insert
113
113
113
115
-11
p03111
C++
Runtime Error
#include <iostream> #include <string> #include <vector> const int INF = 1000000000; int n; int target[3]; std::vector<int> l; // ref : https://img.atcoder.jp/abc119/editorial.pdf // ref : https://drken1215.hatenablog.com/entry/2019/02/24/224100 /* 延長、縮小は合成の前後どっちでやろうが同じ -> 合成魔法を一切これ以降使用しない場合に限り延長、縮小魔法を使用としても一般性は失われない ...
#include <iostream> #include <string> #include <vector> const int INF = 1000000000; int n; int target[3]; std::vector<int> l; // ref : https://img.atcoder.jp/abc119/editorial.pdf // ref : https://drken1215.hatenablog.com/entry/2019/02/24/224100 /* 延長、縮小は合成の前後どっちでやろうが同じ -> 合成魔法を一切これ以降使用しない場合に限り延長、縮小魔法を使用としても一般性は失われない ...
replace
41
42
41
42
0
p03111
C++
Runtime Error
#include <algorithm> #include <climits> #include <complex> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stdio.h> #include <string> #include <vector> using namespace std; using ll = long long; // typedef pair<string,string> P; ...
#include <algorithm> #include <climits> #include <complex> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stdio.h> #include <string> #include <vector> using namespace std; using ll = long long; // typedef pair<string,string> P; ...
replace
42
43
42
43
-11
p03111
C++
Runtime Error
/*     ∧_∧ やあ    (´・ω・`)     /     ようこそ、バーボンハウスへ。    /∇y:::::\    [ ̄]     このテキーラはサービスだから、まず飲んで落ち着いて欲しい。    |:⊃:|:::::|   |──|  ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄| うん、「また」なんだ。済まない。  ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄| ̄  仏の顔もって言うしね、謝って許してもらおうとも思っていない。  ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄/|     ∇ ∇ ∇ ∇   /./|   でも、この提出を見たとき、君は、きっと言葉では言い表せない     ┴ ┴ ┴ ┴ / /  |   「ときめき」みたいなものを感じてくれ...
/*     ∧_∧ やあ    (´・ω・`)     /     ようこそ、バーボンハウスへ。    /∇y:::::\    [ ̄]     このテキーラはサービスだから、まず飲んで落ち着いて欲しい。    |:⊃:|:::::|   |──|  ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄| うん、「また」なんだ。済まない。  ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄| ̄  仏の顔もって言うしね、謝って許してもらおうとも思っていない。  ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄/|     ∇ ∇ ∇ ∇   /./|   でも、この提出を見たとき、君は、きっと言葉では言い表せない     ┴ ┴ ┴ ┴ / /  |   「ときめき」みたいなものを感じてくれ...
replace
69
70
69
70
0
p03111
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int N, A, B, C; int l[8]; int dfs(int cur, int a, int b, int c) { if (cur == N) { if (min(a, min(b, c)) > 0) { return abs(a - A) + abs(b - B) + abs(c - C) - 30; } } int ret0 = dfs(cur + 1, a, b, c); int ret1 = dfs(cur + 1, a + l[cur], b, c) + 10; ...
#include <bits/stdc++.h> using namespace std; int N, A, B, C; int l[8]; int dfs(int cur, int a, int b, int c) { if (cur == N) { if (min(a, min(b, c)) > 0) { return abs(a - A) + abs(b - B) + abs(c - C) - 30; } else { return 1e9; } } int ret0 = dfs(cur + 1, a, b, c); int ret1 = dfs(cur...
insert
11
11
11
13
-11
p03111
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int n, a, b, c, i, l[9], ans; void dfs(int x, int A, int B, int C, int s) { if (x > n && A && B && C) { ans = min(ans, s + abs(a - A) + abs(b - B) + abs(c - C)); return; } dfs(x + 1, A, B, C, s); dfs(x + 1, A + l[x], B, C, s + 10 * (A > 0)); dfs(x + 1, A, ...
#include <bits/stdc++.h> using namespace std; int n, a, b, c, i, l[9], ans; void dfs(int x, int A, int B, int C, int s) { if (x > n) { if (A && B && C) ans = min(ans, s + abs(a - A) + abs(b - B) + abs(c - C)); return; } dfs(x + 1, A, B, C, s); dfs(x + 1, A + l[x], B, C, s + 10 * (A > 0)); dfs(x ...
replace
4
6
4
7
-11
p03111
C++
Runtime Error
#include <iostream> #include <stdlib.h> #include <vector> using namespace std; int N, A, B, C, l[8] = {}; long long mpsum, mpmin = 9999999999; void dfs(int depth, vector<int> v) { if (depth == N) { // ここから計算部 int num[4] = {}; // 使われた回数を確認 int a = 0, b = 0, c = 0; // a,b,cのmp消費前の竹の長さ for...
#include <iostream> #include <stdlib.h> #include <vector> using namespace std; int N, A, B, C, l[8] = {}; long long mpsum, mpmin = 9999999999; void dfs(int depth, vector<int> v) { if (depth == N) { // ここから計算部 int num[4] = {}; // 使われた回数を確認 int a = 0, b = 0, c = 0; // a,b,cのmp消費前の竹の長さ for...
replace
40
43
40
42
-11
p03111
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define ALL(a) (a).begin(), (a).end() #define ALLR(a) (a).rbegin(), (a).rend() #define spa << " " << #define lfs << fixed << setprecision(10) << #define test cout << "test" << endl; #define fi first #define se second #define MP make_pair #define PB push_b...
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define ALL(a) (a).begin(), (a).end() #define ALLR(a) (a).rbegin(), (a).rend() #define spa << " " << #define lfs << fixed << setprecision(10) << #define test cout << "test" << endl; #define fi first #define se second #define MP make_pair #define PB push_b...
replace
163
164
163
164
0
p03111
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; int N, A, B, C; vector<int> l; int dfs(int depth, int La, int Lb, int Lc) { if (depth == N + 1) { if (La != 0 && Lb != 0 && Lc != 0) { return abs(A - La) + abs(Lb - B) + abs(Lc - C) - 30; } } int r1 = dfs(depth + 1, ...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int N, A, B, C; vector<int> l; int dfs(int depth, int La, int Lb, int Lc) { if (depth == N + 1) { if (La != 0 && Lb != 0 && Lc != 0) { return abs(A - La) + abs(Lb - B) + abs(Lc - C) - 30; } else { return (1 << 29); ...
insert
13
13
13
15
-11
p03111
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int N; vector<int> L; int A, B, C; int ans = 1e9; void dfs(int depth, int a, int b, int c, int mp) { if (depth == N) { // ベースケース if (a > 0 && b > 0 && c > 0) { mp += abs(a - A) + abs(b - B) + abs(c - C); ans = min(ans, mp - 30); } else { retur...
#include <bits/stdc++.h> using namespace std; int N; vector<int> L; int A, B, C; int ans = 1e9; void dfs(int depth, int a, int b, int c, int mp) { if (depth == N) { // ベースケース if (a > 0 && b > 0 && c > 0) { mp += abs(a - A) + abs(b - B) + abs(c - C); ans = min(ans, mp - 30); return; } else...
insert
14
14
14
15
-11
p03111
Python
Time Limit Exceeded
N, A, B, C = map(int, input().split()) L = [int(input()) for _ in range(N)] def solve(X): if not ("1" in X and "2" in X and "3" in X): return 1e10 MS = [[L[i] for i in range(N) if X[i] == j] for j in "123"] ret = 1e10 ret = min(ret, solve2(MS[0], A) + solve2(MS[1], B) + solve2(MS[2], C)) ...
N, A, B, C = map(int, input().split()) L = [int(input()) for _ in range(N)] def solve(X): if not ("1" in X and "2" in X and "3" in X): return 1e10 MS = [[L[i] for i in range(N) if X[i] == j] for j in "123"] ret = 1e10 A_ans = [] B_ans = [] C_ans = [] for i in range(3): A_a...
replace
10
16
10
23
TLE
p03111
Python
Runtime Error
from math import inf from collections import deque N, A, B, C = map(int, input().split()) ls = [0] for _ in range(N): ls.append(int(input())) ls.sort() q = deque() q.append((0, -30, 0, 0, 0)) minmp = inf while len(q): n, mp, a, b, c = q.pop() if n == N: if min(a, b, c) == 0: continue ...
try: from math import inf except: inf = float("inf") from collections import deque N, A, B, C = map(int, input().split()) ls = [0] for _ in range(N): ls.append(int(input())) ls.sort() q = deque() q.append((0, -30, 0, 0, 0)) minmp = inf while len(q): n, mp, a, b, c = q.pop() if n == N: if m...
replace
0
1
0
4
0
p03111
Python
Runtime Error
# 入力 N, A, B, C = map(int, input().split()) L = [int(input()) for i in range(N)] INF = 10**9 def dfs(cursor, a, b, c): # cursor:カーソル a,b,c:現在の竹の長さ if cursor == N: # cursorが最後まで行ったら終了する。 return abs(a - A) + abs(b - B) + abs(c - C) - 30 if min(a, b, c) > 0 else INF # abs(a - A) + abs(b - B) + abs(c -...
# 入力 N, A, B, C = map(int, input().split()) L = [int(input()) for i in range(N)] INF = 10**9 def dfs(cursor, a, b, c): # cursor:カーソル a,b,c:現在の竹の長さ if cursor == N: # cursorが最後まで行ったら終了する。 return abs(a - A) + abs(b - B) + abs(c - C) - 30 if min(a, b, c) > 0 else INF # abs(a - A) + abs(b - B) + abs(c -...
replace
19
23
19
23
RecursionError: maximum recursion depth exceeded in comparison
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03111/Python/s159461881.py", line 30, in <module> print(dfs(0, 0, 0, 0)) File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03111/Python/s159461881.py", line 20, in dfs no_compound_patte...
p03111
Python
Runtime Error
import itertools N, A, B, C = map(int, input().split()) L = [int(input()) for _ in range(N)] ans = float("inf") for Lp in itertools.permutations(L): Lac = tuple(itertools.accumulate((0, *Lp))) for a in range(1, N - 1): for b in range(a + 1, N): for c in range(b + 1, N + 1): ...
import itertools N, A, B, C = map(int, input().split()) L = [int(input()) for _ in range(N)] ans = float("inf") for Lp in itertools.permutations(L): Lac = tuple(itertools.accumulate(([0] + list(Lp)))) for a in range(1, N - 1): for b in range(a + 1, N): for c in range(b + 1, N + 1): ...
replace
7
8
7
8
0
p03111
Python
Runtime Error
import itertools N, a, b, c = [int(_) for _ in input().split()] L = [int(input()) for _ in range(N)] ans = 10**10 for K in itertools.product(range(4), repeat=N): A = [[] for _ in range(N)] for i in range(N): A[K[i]] += [L[i]] if len(A[1]) and len(A[2]) and len(A[3]): cost = 10 * (N - len(A[...
import itertools N, a, b, c = [int(_) for _ in input().split()] L = [int(input()) for _ in range(N)] ans = 10**10 for K in itertools.product(range(4), repeat=N): A = [[] for _ in range(4)] for i in range(N): A[K[i]] += [L[i]] if len(A[1]) and len(A[2]) and len(A[3]): cost = 10 * (N - len(A[...
replace
6
7
6
7
0
p03111
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const long long INF = 1LL << 60; template <class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } else return false; } template <class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } else return false; } int mai...
#include <bits/stdc++.h> using namespace std; const long long INF = 1LL << 60; template <class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } else return false; } template <class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } else return false; } int mai...
replace
46
47
46
47
-8
p03112
C++
Runtime Error
#include <algorithm> #include <array> #include <assert.h> #include <cmath> #include <fstream> #include <iostream> #include <queue> #include <set> #include <stdio.h> #include <vector> // #include <unordered_map> // #include <unordered_set> // #include <boost/container/static_vector.hpp> // #include <boost/unordered_set....
#include <algorithm> #include <array> #include <assert.h> #include <cmath> #include <fstream> #include <iostream> #include <queue> #include <set> #include <stdio.h> #include <vector> // #include <unordered_map> // #include <unordered_set> // #include <boost/container/static_vector.hpp> // #include <boost/unordered_set....
replace
52
53
52
53
0
p03112
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; vector<long long> shrines, temples; long long s, t, x, lshrine, rshrine, ltemple, rtemple, ans1, ans2, ans3, ans4, ans5, ans6, a, b, q; long long solve(long long c, long long l, long long r) { while (l != r) { if (c > shrines[(l + r) / 2]) { l = (l + r) / ...
#include <bits/stdc++.h> using namespace std; vector<long long> shrines, temples; long long s, t, x, lshrine, rshrine, ltemple, rtemple, ans1, ans2, ans3, ans4, ans5, ans6, a, b, q; long long solve(long long c, long long l, long long r) { while (l != r) { if (c > shrines[(l + r) / 2]) { l = (l + r) / ...
replace
93
95
93
95
0
p03112
C++
Runtime Error
#include <algorithm> #include <bitset> //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <fstream> #include <iomanip> //do setprecision #include <ios...
#include <algorithm> #include <bitset> //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <fstream> #include <iomanip> //do setprecision #include <ios...
replace
52
54
52
54
-6
munmap_chunk(): invalid pointer
p03112
C++
Runtime Error
#include <algorithm> #include <assert.h> #include <complex> #include <ctime> #include <iostream> #include <list> #include <map> #include <math.h> #include <memory.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <vector> using namespace std; using ll = long long; using...
#include <algorithm> #include <assert.h> #include <complex> #include <ctime> #include <iostream> #include <list> #include <map> #include <math.h> #include <memory.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <vector> using namespace std; using ll = long long; using...
replace
56
57
56
57
0
p03112
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long #define vvi vector<vector<int>> #define vec vector #define pq priority_queue #define all(v) (v).begin(), (v).end() #define uniqueV(x) \ sort(x.begin(), x.end()); ...
#include <bits/stdc++.h> using namespace std; #define int long long #define vvi vector<vector<int>> #define vec vector #define pq priority_queue #define all(v) (v).begin(), (v).end() #define uniqueV(x) \ sort(x.begin(), x.end()); ...
replace
89
90
89
90
0
p03112
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define int long long #define all(v) (v).begin(), (v).end() template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } #define uniqueV(x) \ sort(x.begin(), x.end(...
#include <bits/stdc++.h> using namespace std; #define int long long #define all(v) (v).begin(), (v).end() template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } #define uniqueV(x) \ sort(x.begin(), x.end(...
replace
32
33
32
33
TLE
p03112
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; typedef long long ll; ll calc(vector<ll> a, vector<ll> b, ll x) { // vector<ll>a,b; ll ans = 1e18; ll d; // for ...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; typedef long long ll; ll calc(vector<ll> &a, vector<ll> &b, ll x) { // vector<ll>a,b; ll ans = 1e18; ll d; // fo...
replace
14
15
14
15
TLE
p03112
C++
Runtime Error
#include <bits/stdc++.h> #define ld long double #define int long long using namespace std; const int N = 2e5 + 50; const int mod = 1e9 + 7; const int inf = 1e17; int dx[] = {0, 1, -1, 0, -1, 1, 1, -1}; int dy[] = {1, 0, 0, -1, -1, 1, -1, 1}; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(...
#include <bits/stdc++.h> #define ld long double #define int long long using namespace std; const int N = 2e5 + 50; const int mod = 1e9 + 7; const int inf = 1e17; int dx[] = {0, 1, -1, 0, -1, 1, 1, -1}; int dy[] = {1, 0, 0, -1, -1, 1, -1, 1}; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(...
replace
31
32
31
32
0
p03112
C++
Runtime Error
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; #define rep2(x, from, to) for (long long x = (from); (x) < (to); (x)++) #define rep(x, to) rep2(x, 0, ...
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; #define rep2(x, from, to) for (long long x = (from); (x) < (to); (x)++) #define rep(x, to) rep2(x, 0, ...
replace
21
24
21
24
0
p03112
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; #define BR "\n" #define SP " " #define SHOW(x) \ for (int i = 0; i < x.size(); i++) { \ cout << x[i] << SP; ...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define BR "\n" #define SP " " #define SHOW(x) \ for (int i = 0; i < x.size(); i++) { \ cout << x[i] << SP; ...
replace
34
35
34
35
0
p03112
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; typedef uint64_t u64; typedef int64_t s64; ty...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; typedef uint64_t u64; typedef int64_t s64; ty...
replace
116
117
116
117
0
p03112
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, a, b) for (ll i = (a); i < (b); i++) #define PER(i, a, b) for (ll i = (a); i >= (b); i--) #define rep(i, n) REP(i, 0, n) #define per(i, n) PER(i, n, 0) #define ALL(a) (a).begin(), (a).end() const ll INF = 1e18 + 18; const ll MAX = 200000...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, a, b) for (ll i = (a); i < (b); i++) #define PER(i, a, b) for (ll i = (a); i >= (b); i--) #define rep(i, n) REP(i, 0, n) #define per(i, n) PER(i, n, 0) #define ALL(a) (a).begin(), (a).end() const ll INF = 1e18 + 18; const ll MAX = 200000...
replace
48
49
48
49
0
p03112
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() #define PRINT(v) \ for (auto x : (V)) \ cout << x << " " << endl; using namespace ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() #define PRINT(v) \ for (auto x : (V)) \ cout << x << " " << endl; using namespace ...
replace
96
97
96
97
0
p03112
C++
Runtime Error
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); ++i) #define INF 2e10 typedef long long llong; using namespace std; int main() { int a, b, q; cin >> a >> b >> q; llong s[10002], t[10002]; for (int i = 1; i <= a; ++i) cin >> s[i]; for (int i = 1; i <= b; ++i) cin >> t[i]; s[0] = ...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); ++i) #define INF 2e10 typedef long long llong; using namespace std; int main() { int a, b, q; cin >> a >> b >> q; llong s[100002], t[100002]; for (int i = 1; i <= a; ++i) cin >> s[i]; for (int i = 1; i <= b; ++i) cin >> t[i]; s[0] ...
replace
9
10
9
10
0
p03112
C++
Runtime Error
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstring> #include <ctime> #include <iostream> #include <list> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> #defi...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstring> #include <ctime> #include <iostream> #include <list> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> #defi...
replace
42
43
42
50
0
p03112
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, q, x; cin >> a >> b >> q; vector<long long> s(a), t(a); for (int i = 0; i < a; i++) { cin >> s[i]; } for (int i = 0; i < b; i++) { cin >> t[i]; } for (int i = 0; i < q; i++) { cin >> x; long long r = a - 1, l = 0,...
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, q, x; cin >> a >> b >> q; vector<long long> s(a), t(b); for (int i = 0; i < a; i++) { cin >> s[i]; } for (int i = 0; i < b; i++) { cin >> t[i]; } for (int i = 0; i < q; i++) { cin >> x; long long r = a - 1, l = 0,...
replace
5
6
5
6
0
p03112
C++
Runtime Error
#include <bits/stdc++.h> long long s[100000]; long long t[100000]; long long x[100000]; int binary_search(long long a[], int src, int dst, long long key) { int ok = 0; int ng = dst; while (ng - ok > 1) { int middle = (ok + ng) / 2; if (a[middle] >= a[key]) { ok = middle; } else { ng = mi...
#include <bits/stdc++.h> long long s[100000]; long long t[100000]; long long x[100000]; int binary_search(long long a[], int src, int dst, long long key) { int ok = 0; int ng = dst; while (ng - ok > 1) { int middle = (ok + ng) / 2; if (a[middle] <= key) { ok = middle; } else { ng = middl...
replace
11
12
11
12
0
p03112
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define RANGE(i, n) for (ll i = 0; i < n; i++) typedef long long ll; using namespace std; vector<ll> neighbor(vector<ll> arr, ll pos) { vector<ll> neighbors; if (pos <= arr[0]) { neighbors.push_back(arr[0]); return neighbors; } else if (pos >= arr.back()) { neighbors.push_ba...
#include <bits/stdc++.h> #define RANGE(i, n) for (ll i = 0; i < n; i++) typedef long long ll; using namespace std; vector<ll> neighbor(vector<ll> &arr, ll pos) { vector<ll> neighbors; if (pos <= arr[0]) { neighbors.push_back(arr[0]); return neighbors; } else if (pos >= arr.back()) { neighbors.push_b...
replace
6
7
6
7
TLE
p03112
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; void chmin(long long &a, long long b) { if (a > b) a = b; } const long long INF = 1LL << 59; // 前方の index int former(const vector<long long> &v, long long x) { return (int)(upper_bound(v.begin(), v.end(), x) - v.begin()) - 1; } //...
#include <algorithm> #include <iostream> #include <vector> using namespace std; void chmin(long long &a, long long b) { if (a > b) a = b; } const long long INF = 1LL << 59; // 前方の index int former(const vector<long long> &v, long long x) { return (int)(upper_bound(v.begin(), v.end(), x) - v.begin()) - 1; } //...
replace
45
46
45
46
0
p03112
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdlib> #include <ctime> #include <deque> #include <iomanip> #include <ios> #include <iostream> #include <map> #include <numeric> #include <queue> #include <string> #include <tuple> #include <utility> #include <vector> #define ALL_OF(x) (x).begin(), (x).end() #define RE...
#include <algorithm> #include <cmath> #include <cstdlib> #include <ctime> #include <deque> #include <iomanip> #include <ios> #include <iostream> #include <map> #include <numeric> #include <queue> #include <string> #include <tuple> #include <utility> #include <vector> #define ALL_OF(x) (x).begin(), (x).end() #define RE...
replace
65
66
65
66
0
p03112
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define INF 1e14 + 1 typedef long long ll; template <class T> int former(const vector<T> &v, T x) { return upper_bound(v.begin(), v.end(), x) - v.begin() - 1; } template <class T> int latter(const vector<T> &v, T x) { return lower_bound(v.begin(), v.end(), x) - v.b...
#include <bits/stdc++.h> using namespace std; #define INF 1e14 + 1 typedef long long ll; template <class T> int former(const vector<T> &v, T x) { return upper_bound(v.begin(), v.end(), x) - v.begin() - 1; } template <class T> int latter(const vector<T> &v, T x) { return lower_bound(v.begin(), v.end(), x) - v.b...
replace
48
49
48
49
0
p03112
C++
Runtime Error
/* ABC119-D 問題 A社の神社とB軒の寺がある。 西からi社目の神社はsiメートル、i軒目の寺はtiメートルの地点 があります。 以下Q個の問いに答える。 問i:道路のxiメートルの地点から出発して自由に移動したとき、 神社1社と寺1軒に訪れるのに必要な最小の移動距離は何メートルか。 制約 1<=A,B<=10^5 1<=Q<=10^5 1<=si,ti,xi<=10^10 方針 単純にxiに一番近い神社と寺に行くのが最短距離なのはわかる。 ただし、パターンとしては以下があるので、全パターン試す。 ・最初に前方最寄りの神社に行き、前方最寄りの寺にいく ・最初に前方最寄りの神社に行き、後方最寄りの寺にいく ・最初に後方最寄り...
/* ABC119-D 問題 A社の神社とB軒の寺がある。 西からi社目の神社はsiメートル、i軒目の寺はtiメートルの地点 があります。 以下Q個の問いに答える。 問i:道路のxiメートルの地点から出発して自由に移動したとき、 神社1社と寺1軒に訪れるのに必要な最小の移動距離は何メートルか。 制約 1<=A,B<=10^5 1<=Q<=10^5 1<=si,ti,xi<=10^10 方針 単純にxiに一番近い神社と寺に行くのが最短距離なのはわかる。 ただし、パターンとしては以下があるので、全パターン試す。 ・最初に前方最寄りの神社に行き、前方最寄りの寺にいく ・最初に前方最寄りの神社に行き、後方最寄りの寺にいく ・最初に後方最寄り...
replace
111
112
111
112
0
p03112
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <limits.h> #include <vector> using namespace std; int A, B, Q; vector<long long> s, t, x; int main() { cin >> A >> B >> Q; s.resize(A + 2); t.resize(B + 2); x.resize(Q); s[0] = LLONG_MIN / 4; s[A + 1] = LLONG_MAX / 4; t[0] = LLONG_MI...
#include <algorithm> #include <cmath> #include <iostream> #include <limits.h> #include <vector> using namespace std; int A, B, Q; vector<long long> s, t, x; int main() { cin >> A >> B >> Q; s.resize(A + 2); t.resize(B + 2); x.resize(Q); s[0] = LLONG_MIN / 4; s[A + 1] = LLONG_MAX / 4; t[0] = LLONG_MI...
replace
22
23
22
23
0
p03112
C++
Time Limit Exceeded
#include <bits/stdc++.h> #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") using namespace std; /*----------------------------------ここからマクロ----------------------------------*/ #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() #define vecin(a) rep(i, ...
#include <bits/stdc++.h> #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") using namespace std; /*----------------------------------ここからマクロ----------------------------------*/ #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() #define vecin(a) rep(i, ...
replace
147
149
147
149
TLE
p03112
C++
Runtime Error
/* How to lambda ex) sort(ALL(cont),[](dat a,dat b){return a.l<b.l;}); lower_bound/upper_bound of 2 1 2 2 2 3 3 ^lb ^ub */ #include <cstdio> #define BR "\n" #define REP(i, n) for (int(i) = 0; (i) < (n); ++(i)) #define ALL(cont) begin(cont), end(cont) #define AS_MOD(a, b) ((((a) % (b)) + (b)) % (b)) #define FE...
/* How to lambda ex) sort(ALL(cont),[](dat a,dat b){return a.l<b.l;}); lower_bound/upper_bound of 2 1 2 2 2 3 3 ^lb ^ub */ #include <cstdio> #define BR "\n" #define REP(i, n) for (int(i) = 0; (i) < (n); ++(i)) #define ALL(cont) begin(cont), end(cont) #define AS_MOD(a, b) ((((a) % (b)) + (b)) % (b)) #define FE...
replace
41
42
41
42
0
p03112
C++
Runtime Error
// ref: https://drken1215.hatenablog.com/entry/2019/02/24/230900 // #define _GLIBCXX_DEBUG #include <bits/stdc++.h> typedef int64_t int64; typedef uint32_t uint; typedef uint64_t uint64; using namespace std; //--- template <typename T> inline void print(const T &rhs) { std::cout << " = " << rhs << std::endl; } t...
// ref: https://drken1215.hatenablog.com/entry/2019/02/24/230900 // #define _GLIBCXX_DEBUG #include <bits/stdc++.h> typedef int64_t int64; typedef uint32_t uint; typedef uint64_t uint64; using namespace std; //--- template <typename T> inline void print(const T &rhs) { std::cout << " = " << rhs << std::endl; } t...
replace
164
166
164
166
0
p03112
C++
Time Limit Exceeded
#include <algorithm> #include <climits> #include <cmath> #include <cstring> #include <functional> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; int main() { int A, B, Q; cin >> A >> B >> Q; vector<long long> s(A); vector<long long> t(B); vector<long long> x(Q);...
#include <algorithm> #include <climits> #include <cmath> #include <cstring> #include <functional> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; int main() { int A, B, Q; cin >> A >> B >> Q; vector<long long> s(A); vector<long long> t(B); vector<long long> x(Q);...
replace
28
29
28
29
TLE
p03112
C++
Time Limit Exceeded
#include <algorithm> #include <math.h> #include <stdio.h> #include <vector> using namespace std; const int maxn = 100000 + 5; #define INF 1e14 int a, b, q; long long s[maxn], t[maxn]; vector<long long> ss, tt; int main() { while (scanf("%d%d%d", &a, &b, &q) == 3) { ss.clear(); tt.clear(); for (int i = 0;...
#include <algorithm> #include <math.h> #include <stdio.h> #include <vector> using namespace std; const int maxn = 100000 + 5; #define INF 1e14 int a, b, q; long long s[maxn], t[maxn]; vector<long long> ss, tt; int main() { while (scanf("%d%d%d", &a, &b, &q) == 3) { ss.clear(); tt.clear(); for (int i = 0;...
insert
22
22
22
24
TLE
p03112
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll A, B, Q; cin >> A >> B >> Q; std::vector<ll> s(A), t(B), x(Q); std::for_each(s.begin(), s.end(), [](auto &x) { cin >> x; }); std::for_each(t.begin(), t.end(), [](auto &x) { cin >> x; }); std::for_each(x.begin(), x.end(),...
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll A, B, Q; cin >> A >> B >> Q; std::vector<ll> s(A), t(B), x(Q); std::for_each(s.begin(), s.end(), [](auto &x) { cin >> x; }); std::for_each(t.begin(), t.end(), [](auto &x) { cin >> x; }); std::for_each(x.begin(), x.end(),...
replace
17
21
17
19
TLE
p03112
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; int A, B, Q; vector<long long> s; vector<long long> t; vector<long long> x; void chmin(long long &a, long long b) { if (a > b) a = b; } template <class T> int former(const vector<T> &v, T x) { return upper_bound(v.begin(), v.end(),...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int A, B, Q; vector<long long> s; vector<long long> t; vector<long long> x; void chmin(long long &a, long long b) { if (a > b) a = b; } template <class T> int former(const vector<T> &v, T x) { return upper_bound(v.begin(), v.end(),...
replace
53
54
53
54
0
p03112
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define int long long #define double long double #define fo(a, b) for (int a = 0; a < b; a++) #define Sort(a) sort(a.begin(), a.end()) #define rev(a) reverse(a.begin(), a.end()) #define fi first #define se second #define sz size() #define bgn begin() #define en end() #defin...
#include <bits/stdc++.h> using namespace std; #define int long long #define double long double #define fo(a, b) for (int a = 0; a < b; a++) #define Sort(a) sort(a.begin(), a.end()) #define rev(a) reverse(a.begin(), a.end()) #define fi first #define se second #define sz size() #define bgn begin() #define en end() #defin...
replace
376
383
376
386
TLE
p03112
C++
Runtime Error
#include <algorithm> #include <climits> #include <cmath> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define repf(i, m, n) for (int(i) = m; (i) < n; (i)++) #define all(v) (v).begin(), (v).end() #define ll long long #def...
#include <algorithm> #include <climits> #include <cmath> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define repf(i, m, n) for (int(i) = m; (i) < n; (i)++) #define all(v) (v).begin(), (v).end() #define ll long long #def...
replace
78
80
78
80
0
p03112
C++
Runtime Error
// includes #include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdint> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <unordered...
// includes #include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdint> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <unordered...
replace
89
91
89
91
0
p03112
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vll; typedef pair<ll, ll> pll; typedef vector<pll> vpll; typedef string str; static const long long INF = INT64_MAX; static const long long MOD = (ll)1e9 + 7; #define endl "\n" #define fast_io ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vll; typedef pair<ll, ll> pll; typedef vector<pll> vpll; typedef string str; static const long long INF = INT64_MAX; static const long long MOD = (ll)1e9 + 7; #define endl "\n" #define fast_io ...
replace
46
47
46
47
TLE
p03112
C++
Time Limit Exceeded
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } #define rep(i, n) for (int i = 0; i...
// #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } #define rep(i, n) for (int i = 0...
replace
0
1
0
1
TLE
p03112
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) using ll = long long; using P = pair<int, int>; const ll INF = 1LL << 58; int main() { int a, b, q; cin >> a >> b >> q; vector<ll> s(a + 2), t(b + 2); rep(i, a) cin >> s[i + 1]; rep(i, b) cin >> t[i + 1]; s[0] = t[...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) using ll = long long; using P = pair<int, int>; const ll INF = 1LL << 58; int main() { int a, b, q; cin >> a >> b >> q; vector<ll> s(a + 2), t(b + 2); rep(i, a) cin >> s[i + 1]; rep(i, b) cin >> t[i + 1]; s[0] = t[...
replace
13
14
13
14
0
p03112
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; #define INF 100000000 long long calc(vector<long long> s, vector<long long> t, long long x) { vector<long long>::iterator sRight = lower_bound(s.begin(), s.end(), x); // x[i]以上が最初に現れる要素 vector<long long>::iterat...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; #define INF 100000000 long long calc(vector<long long> &s, vector<long long> &t, long long x) { vector<long long>::iterator sRight = lower_bound(s.begin(), s.end(), x); // x[i]以上が最初に現れる要素 vector<long long>::iter...
replace
7
8
7
8
TLE
p03112
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define reps(i, s, n) for (int i = (int)(s); i < (int)(n); i++) const ll mod = ll(1e9) + 7; const ll INF = ll(1e18); ll hoge(ll cost, ll x, vector<ll> &v) { auto it = lower...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define reps(i, s, n) for (int i = (int)(s); i < (int)(n); i++) const ll mod = ll(1e9) + 7; const ll INF = ll(1e18); ll hoge(ll cost, ll x, vector<ll> &v) { auto it = lower...
insert
49
49
49
50
0
p03112
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, n) FOR(i, 0, n) #define FOR(i, a, b) for (ll i = a; i < b; i++) #define UM unordered_map #define ALL(a) (a).begin(), (a).end() typedef vector<ll> vi; typedef vector<vector<ll>> vvi; typedef pair<ll, ll> pii; const long long INF = 1LL << ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, n) FOR(i, 0, n) #define FOR(i, a, b) for (ll i = a; i < b; i++) #define UM unordered_map #define ALL(a) (a).begin(), (a).end() typedef vector<ll> vi; typedef vector<vector<ll>> vvi; typedef pair<ll, ll> pii; const long long INF = 1LL << ...
replace
31
32
31
32
TLE
p03112
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define all(x) (x).begin(), (x).end() using namespace std; const int INF = 1145141919, MOD = 1e9 + 7; const long long LINF = 8931145141919364364, LMOD = 998244353; inline long long mod(long long n, long long m) { return (n % m + m) % m; } // const i...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define all(x) (x).begin(), (x).end() using namespace std; const int INF = 1145141919, MOD = 1e9 + 7; const long long LINF = 8931145141919364364, LMOD = 998244353; inline long long mod(long long n, long long m) { return (n % m + m) % m; } // const i...
replace
18
20
18
20
0
p03112
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; const long long INF = 20000000001; void Main() { int a, b, q; cin >> a >> b >> q; vector<long long> s, t; for (int i = 0; i < a; i++) { long long tmp; cin >> tmp; s.push_back(tmp); } for (int i = 0; i < b; i++) { long long tmp; cin >> tmp; ...
#include "bits/stdc++.h" using namespace std; const long long INF = 20000000001; void Main() { int a, b, q; cin >> a >> b >> q; vector<long long> s, t; for (int i = 0; i < a; i++) { long long tmp; cin >> tmp; s.push_back(tmp); } for (int i = 0; i < b; i++) { long long tmp; cin >> tmp; ...
replace
34
35
34
35
0
p03112
Python
Runtime Error
from bisect import bisect_right A, B, Q = map(int, input().split()) INF = 10**18 s = [-INF] + [int(input()) for i in range(A)] + [INF] t = [-INF] + [int(input()) for i in range(B)] + [INF] xs = [int(input()) for i in range(Q)] for x in xs: x = int(input()) b, d = bisect_right(s, x), bisect_right(t, x) res ...
from bisect import bisect_right A, B, Q = map(int, input().split()) INF = 10**18 s = [-INF] + [int(input()) for i in range(A)] + [INF] t = [-INF] + [int(input()) for i in range(B)] + [INF] xs = [int(input()) for i in range(Q)] for x in xs: b, d = bisect_right(s, x), bisect_right(t, x) res = INF for S in [s...
delete
8
9
8
8
EOFError: EOF when reading a line
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03112/Python/s591577203.py", line 8, in <module> x = int(input()) EOFError: EOF when reading a line
p03112
Python
Runtime Error
def p_d(): from bisect import bisect_right A, B, Q = map(int, input().split()) INF = 10**9 s = [-INF] + [int(input()) for _ in range(A)] + [INF] t = [-INF] + [int(input()) for _ in range(B)] + [INF] ans = [] for _ in range(Q): x = int(input()) b, d = bisect_right(s, x), bise...
def p_d(): from bisect import bisect_right A, B, Q = map(int, input().split()) INF = 10**18 s = [-INF] + [int(input()) for _ in range(A)] + [INF] t = [-INF] + [int(input()) for _ in range(B)] + [INF] ans = [] for _ in range(Q): x = int(input()) b, d = bisect_right(s, x), bis...
replace
4
5
4
5
0
p03112
Python
Runtime Error
import bisect def solve(a_list, b_list, position): # time O(log(A)) a_right_key = bisect.bisect_left(a_list, position) a_left_key = a_right_key - 1 # time O(log(B)) b_right_key = bisect.bisect_left(b_list, position) b_left_key = b_right_key - 1 a_left, a_right = a_list[a_left_key], a_list...
import bisect def solve(a_list, b_list, position): # time O(log(A)) a_right_key = bisect.bisect_left(a_list, position) a_left_key = a_right_key - 1 # time O(log(B)) b_right_key = bisect.bisect_left(b_list, position) b_left_key = b_right_key - 1 a_left, a_right = a_list[a_left_key], a_list...
replace
31
32
31
32
0
p03112
C++
Runtime Error
// dile a la jardinera que traigo flores #include <bits/stdc++.h> #define ff first #define ss second #define tm1 first.first #define tm2 first.second #define tm3 second #define pb push_back #define sz(x) int(x.size()) #define all(v) (v).begin(), (v).end() #define trace(x) cout << #x << " = " << x << endl #define fasti...
// dile a la jardinera que traigo flores #include <bits/stdc++.h> #define ff first #define ss second #define tm1 first.first #define tm2 first.second #define tm3 second #define pb push_back #define sz(x) int(x.size()) #define all(v) (v).begin(), (v).end() #define trace(x) cout << #x << " = " << x << endl #define fasti...
replace
22
23
22
23
0
p03112
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < n; i++) #define repr(i, s, e) for (ll i = s; i >= e; i--) #define reps(i, s, e) for (ll i = s; i <= e; i++) #define inf 1e18 #define all(v) v.begin(), v.end() #define vsort(v) sort(v.begin(), v.end()) #define vsortr(v) sort(v.begin(), v.end(), greater<ll>())...
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < n; i++) #define repr(i, s, e) for (ll i = s; i >= e; i--) #define reps(i, s, e) for (ll i = s; i <= e; i++) #define inf 1e18 #define all(v) v.begin(), v.end() #define vsort(v) sort(v.begin(), v.end()) #define vsortr(v) sort(v.begin(), v.end(), greater<ll>())...
insert
121
121
121
123
TLE
p03112
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; long long INF = 1LL << 60; long long calc(vector<long long> s, vector<long long> t, long long x) { long long answer = INF; auto a_ = lower_bound(s.begin(), s.end(), x); for (int i = 0; i < 2; i++) { long long ax_ = *prev(a_); if (i == 1) { ax_ = *...
#include <bits/stdc++.h> using namespace std; long long INF = 1LL << 60; long long calc(vector<long long> &s, vector<long long> &t, long long x) { long long answer = INF; auto a_ = lower_bound(s.begin(), s.end(), x); for (int i = 0; i < 2; i++) { long long ax_ = *prev(a_); if (i == 1) { ax_ =...
replace
5
6
5
6
TLE
p03112
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; i++) typedef long long ll; const ll INF = 1e15; int main() { int A, B, Q; ll x; cin >> A >> B >> Q; ll s[A], t[B], ans[Q]; rep(i, A) cin >> s[i]; rep(i, B) cin >> t[i]; rep(i, Q) { cin >> x; int su = lower...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; i++) typedef long long ll; const ll INF = 1e15; int main() { int A, B, Q; ll x; cin >> A >> B >> Q; ll s[A], t[B], ans[Q]; rep(i, A) cin >> s[i]; rep(i, B) cin >> t[i]; rep(i, Q) { cin >> x; int su = lower...
replace
16
17
16
17
0
p03112
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <map> #include <string> #include <tuple> #include <vector> template <typename T> bool chmax(T &a, T b) { if (a < b) { a = b; return (true); } else { return (false); } } template <typename T> bool chmin(T &a, T b) { ...
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <map> #include <string> #include <tuple> #include <vector> template <typename T> bool chmax(T &a, T b) { if (a < b) { a = b; return (true); } else { return (false); } } template <typename T> bool chmin(T &a, T b) { ...
replace
68
70
68
70
0
p03113
Python
Runtime Error
def solve(n, k, aaa): buf = [] prev_last = -1 for t in range(k + 1): ma, mi = min((a, i + 1) for i, a in enumerate(aaa) if i + 1 != prev_last) others = set(range(1, n + 1)) - {prev_last, mi} buf.extend(others) if t == k: aaa[mi] += 1 else: buf...
def solve(n, k, aaa): buf = [] prev_last = -1 for t in range(k + 1): ma, mi = min((a, i + 1) for i, a in enumerate(aaa) if i + 1 != prev_last) others = set(range(1, n + 1)) - {prev_last, mi} buf.extend(others) buf.append(mi) # print(buf) for i in range(n): ...
replace
8
12
8
10
IndexError: list index out of range
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03113/Python/s607630341.py", line 29, in <module> solve(n, k, aaa) File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03113/Python/s607630341.py", line 10, in solve aaa[mi] += 1 IndexErr...
p03113
C++
Runtime Error
// #define NDEBUG #include <cstddef> #include <cstdint> #include <vector> using i8 = ::std::int_least8_t; using i32 = ::std::int_least32_t; using i64 = ::std::int_least64_t; using u8 = ::std::uint_least8_t; using u32 = ::std::uint_least32_t; using u64 = ::std::uint_least64_t; using isize = ::std::ptrdiff_t; using usiz...
// #define NDEBUG #include <cstddef> #include <cstdint> #include <vector> using i8 = ::std::int_least8_t; using i32 = ::std::int_least32_t; using i64 = ::std::int_least64_t; using u8 = ::std::uint_least8_t; using u32 = ::std::uint_least32_t; using u64 = ::std::uint_least64_t; using isize = ::std::ptrdiff_t; using usiz...
replace
150
151
150
151
0
p03113
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using lint = long long; const lint mod = 1e9 + 7; #define all(x) (x).begin(), (x).end() #define bitcount(n) __builtin_popcountll((lint)(n)) #define fcout cout << fixed << setprecision(15) #define highest(x) (63 - __builtin_clzll(x)) #define rep(i, n) for (int i = 0; i < n; ...
#include <bits/stdc++.h> using namespace std; using lint = long long; const lint mod = 1e9 + 7; #define all(x) (x).begin(), (x).end() #define bitcount(n) __builtin_popcountll((lint)(n)) #define fcout cout << fixed << setprecision(15) #define highest(x) (63 - __builtin_clzll(x)) #define rep(i, n) for (int i = 0; i < n; ...
replace
144
145
144
145
0
p03114
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long lint; typedef long double louble; template <typename T1, typename T2> inline T1 max(T1 a, T2 b) { return a < b ? b : a; } template <typename T1, typename T2> inline T1 min(T1 a, T2 b) { return a < b ? a : b; } const char lf = '\n'; namespace ae86 {...
#include <bits/stdc++.h> using namespace std; typedef long long lint; typedef long double louble; template <typename T1, typename T2> inline T1 max(T1 a, T2 b) { return a < b ? b : a; } template <typename T1, typename T2> inline T1 min(T1 a, T2 b) { return a < b ? a : b; } const char lf = '\n'; namespace ae86 {...
replace
42
43
42
43
0
p03114
C++
Runtime Error
/*{{{*/ #include <algorithm> #include <assert.h> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <limits.h> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> #define SZ(X) ((int)(X).size()) #defin...
/*{{{*/ #include <algorithm> #include <assert.h> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <limits.h> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> #define SZ(X) ((int)(X).size()) #defin...
replace
240
242
240
242
0
p03114
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x, to) for (x = 0; x < (to); x++) #define FORR(x, arr) for (auto &x : arr) #define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++) #define ALL(a) (a.begin()), ...
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x, to) for (x = 0; x < (to); x++) #define FORR(x, arr) for (auto &x : arr) #define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++) #define ALL(a) (a.begin()), ...
replace
16
17
16
17
0
p03114
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7, N = 16; namespace { inline int add(int x, int y) { return (x += y) >= mod ? x - mod : x; } inline int sub(int x, int y) { return (x -= y) < 0 ? x + mod : x; } inline int mul(int x, int y) { return 1LL * x * y % mod; } inline int kissme(int x, int ...
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7, N = 16; namespace { inline int add(int x, int y) { return (x += y) >= mod ? x - mod : x; } inline int sub(int x, int y) { return (x -= y) < 0 ? x + mod : x; } inline int mul(int x, int y) { return 1LL * x * y % mod; } inline int kissme(int x, int ...
replace
22
23
22
23
0