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
p03000
C++
Runtime Error
#include <algorithm> #include <bits/stdc++.h> #include <stdint.h> #include <vector> using namespace std; int main() { int n, x; cin >> n >> x; vector<int> l(n, 0); for (int i = 0; i < n; i++) { cin >> l.at(i); } int h = 0; int ans = 1; int i = 0; while (h <= x) { h += l.at(i); if (h >...
#include <algorithm> #include <bits/stdc++.h> #include <stdint.h> #include <vector> using namespace std; int main() { int n, x; cin >> n >> x; vector<int> l(n, 0); for (int i = 0; i < n; i++) { cin >> l.at(i); } int h = 0; int ans = 1; int i = 0; while (h <= x && i < n) { h += l.at(i); ...
replace
20
21
20
21
0
p03000
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; /* g++ -g -fsanitize=address -lasan -std=c++11 -Dfoo_ */ /* freopen("input.txt", "rt", stdin); */ /* freopen("output.txt", "wt", stdout); */ #define ALL(c) (c).begin(), (c).end() #define ALLR(c) (c).rbegin(), (c).rend() #define FOR(i, a, b) for (int i = (a); i < (b); ++...
#include <bits/stdc++.h> using namespace std; /* g++ -g -fsanitize=address -lasan -std=c++11 -Dfoo_ */ /* freopen("input.txt", "rt", stdin); */ /* freopen("output.txt", "wt", stdout); */ #define ALL(c) (c).begin(), (c).end() #define ALLR(c) (c).rbegin(), (c).rend() #define FOR(i, a, b) for (int i = (a); i < (b); ++...
replace
49
50
49
50
0
p03000
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; int main() { int n, x; int i; int D = 0; int cnt = 1; vector<int> l(n); cin >> n >> x; for (i = 0; i < n; i++) { cin >> l[i]; D += l[i]; if (D <= x) { cnt++; } } cout << cnt << endl; return 0; }
#include <iostream> #include <vector> using namespace std; int main() { long n, x; long i; long D = 0; long cnt = 1; vector<long> l(n); cin >> n >> x; for (i = 0; i < n; i++) { cin >> l[i]; D += l[i]; if (D <= x) { cnt++; } } cout << cnt << endl; return 0; }
replace
5
10
5
10
0
p03000
C++
Runtime Error
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> // Common file #include <ext/pb_ds/tree_policy.hpp> #include <functional> // for less #define pb push_back #define For(i, s, e) for (ll i = (s); i < (e); i++) #define Debug_array(a, n) \ for (ll i = ...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> // Common file #include <ext/pb_ds/tree_policy.hpp> #include <functional> // for less #define pb push_back #define For(i, s, e) for (ll i = (s); i < (e); i++) #define Debug_array(a, n) \ for (ll i = ...
replace
32
33
32
33
0
p03000
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using st = string; using ch = char; using db = double; using bl = bool; using vll = vector<long long>; using vdb = vector<db>; using vvll = vector<vll>; using vst = vector<st>; using vch = vector<char>; using pll = pair...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using st = string; using ch = char; using db = double; using bl = bool; using vll = vector<long long>; using vdb = vector<db>; using vvll = vector<vll>; using vst = vector<st>; using vch = vector<char>; using pll = pair...
replace
45
48
45
50
0
p03000
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; // for(int i = 0; i < n; i++) int main() { int n, x, d = 0, a = 0; cin >> n >> x; vector<int> l(n); for (int i = 0; i < n; i++) cin >> l.at(i); while (d <= x) { d += l.at(a); a++; } cout << a << endl; }
#include <bits/stdc++.h> using namespace std; // for(int i = 0; i < n; i++) int main() { int n, x, d = 0, a = 0; cin >> n >> x; vector<int> l(n); for (int i = 0; i < n; i++) cin >> l.at(i); a = n + 1; for (int i = 0; i < n; i++) { x -= l.at(i); if (x < 0) { a = i + 1; break; } ...
replace
10
13
10
17
0
p03000
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, X; cin >> N >> X; vector<int> L(N); for (int i = 0; i < N; i++) { cin >> L.at(i); } int D = 0; int ans = 0; while (D <= X) { D += L.at(ans); ans++; } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N, X; cin >> N >> X; vector<int> L(N); for (int i = 0; i < N; i++) { cin >> L.at(i); } int D = 0; int ans = 1; while (ans <= N) { D += L.at(ans - 1); if (D > X) break; ans++; } cout << ans << endl; }
replace
11
14
11
16
0
p03000
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < int(n); i++) using namespace std; int main() { int n, x, s; cin >> n >> x; vector<int> l(n), d(n); rep(i, n) cin >> l.at(i); for (int i = 1; i < n + 1; i++) { d.at(0) = 0; d.at(i) = d.at(i - 1) + l.at(i - 1); if (d.at(i) <= x) ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < int(n); i++) using namespace std; int main() { int n, x, s; cin >> n >> x; vector<int> l(n), d(n + 1); rep(i, n) cin >> l.at(i); for (int i = 1; i < n + 1; i++) { d.at(0) = 0; d.at(i) = d.at(i - 1) + l.at(i - 1); if (d.at(i) <= x) ...
replace
8
9
8
9
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 3) >= this->size() (which is 3)
p03000
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; #define REP(i, n) for (int i = 0; i < (n); i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define ALL(n) begin(n), end(n) #define IN(a, x, b)...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; #define REP(i, n) for (int i = 0; i < (n); i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define ALL(n) begin(n), end(n) #define IN(a, x, b)...
replace
29
31
29
31
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 3) >= this->size() (which is 3)
p03000
C++
Runtime Error
//{{{ #include <bits/stdc++.h> using namespace std; #define repX(a, b, c, x, ...) x #define repN(a) repX a #define rep(...) repN((__VA_ARGS__, rep3, rep2, loop))(__VA_ARGS__) #define rrep(...) repN((__VA_ARGS__, rrep3, rrep2))(__VA_ARGS__) #define loop(n) rep2(i_, n) #define rep2(i, n) rep3(i, 0, n) #define rep3(i, be...
//{{{ #include <bits/stdc++.h> using namespace std; #define repX(a, b, c, x, ...) x #define repN(a) repX a #define rep(...) repN((__VA_ARGS__, rep3, rep2, loop))(__VA_ARGS__) #define rrep(...) repN((__VA_ARGS__, rrep3, rrep2))(__VA_ARGS__) #define loop(n) rep2(i_, n) #define rep2(i, n) rep3(i, 0, n) #define rep3(i, be...
replace
193
194
193
194
0
p03000
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, X; cin >> N >> X; int zahyou = 0, count = 1; vector<int> vec; for (int i = 0; i < N; i++) { cin >> vec.at(i); zahyou += vec.at(i); if (zahyou > X) { break; } count++; } cout << count << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N, X; cin >> N >> X; int zahyou = 0, count = 1; vector<int> vec(N); for (int i = 0; i < N; i++) { cin >> vec.at(i); zahyou += vec.at(i); if (zahyou > X) { break; } count++; } cout << count << endl; }
replace
6
7
6
7
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 0) >= this->size() (which is 0)
p03000
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; int main() { int N, X; cin >> N >> X; vector<int> L(N); for (int i = 0; i < N; i++) cin >> L.at(i); int sum = 0, count = 1; for (int i = 0;; i++) { sum += L.at(i); if (sum <= X) ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; int main() { int N, X; cin >> N >> X; vector<int> L(N); for (int i = 0; i < N; i++) cin >> L.at(i); int sum = 0, count = 1; for (int i = 0; i < N; i++) { sum += L.at(i); if (sum ...
replace
13
14
13
14
0
p03000
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int N, X; cin >> N >> X; vector<int> L(N); rep(i, N) { cin >> L.at(i); } int D = 0; int cnt = 0; while (D <= X) { D += L.at(cnt); cnt++; } cout << cnt << e...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int N, X; cin >> N >> X; vector<int> L(N); rep(i, N) { cin >> L.at(i); } int D = 0; int cnt = 0; while (D <= X) { if (cnt == N) { cnt++; break; } ...
insert
16
16
16
20
0
p03000
Python
Runtime Error
N, X = map(int, input().split()) positions = list(map(int, input().split())) ans = 1 D = 0 for i in range(N + 1): if D + positions[i] <= X: D += positions[i] ans += 1 else: print(ans) exit() print(ans)
N, X = map(int, input().split()) positions = list(map(int, input().split())) ans = 1 D = 0 for i in range(N): if D + positions[i] <= X: D += positions[i] ans += 1 else: print(ans) exit() print(ans)
replace
6
7
6
7
0
p03000
Python
Runtime Error
a, b = map(int, input().split()) c = list(map(int, input().split())) d = 1 e = 0 for i in range(a): e += c[i] if e <= b: d += 1 print(d) a, b = map(int, input().split()) c = list(map(int, input().split())) d = 1 e = 0 for i in range(a): e += c[i] if e <= b: d += 1 else: break...
a, b = map(int, input().split()) c = list(map(int, input().split())) d = 1 e = 0 for i in range(a): e += c[i] if e <= b: d += 1 else: break print(d)
delete
0
9
0
0
EOFError: EOF when reading a line
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03000/Python/s443147037.py", line 10, in <module> a, b = map(int, input().split()) EOFError: EOF when reading a line
p03000
Python
Runtime Error
n, x = map(int, input().split()) ls = list(map(int, input().split())) d = 0 count = 0 while d <= x: d += ls[count] count += 1 print(count)
n, x = map(int, input().split()) ls = list(map(int, input().split())) d = 0 count = 1 for a in ls: d += a if d <= x: count += 1 print(count)
replace
4
8
4
9
0
p03000
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, X; cin >> N >> X; vector<int> data(5); for (int i = 0; i < N; i++) { cin >> data.at(i); } int count = 1; int total = 0; for (int i = 0; i < N; i++) { total += data.at(i); if (total <= X) { count++; } } cout <...
#include <bits/stdc++.h> using namespace std; int main() { int N, X; cin >> N >> X; vector<int> data(N); for (int i = 0; i < N; i++) { cin >> data.at(i); } int count = 1; int total = 0; for (int i = 0; i < N; i++) { total += data.at(i); if (total <= X) { count++; } } cout <...
replace
7
8
7
8
0
p03000
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { long long n, x; cin >> n >> x; vector<int> vec(n); rep(i, n) cin >> vec.at(i); long long d = 0; long long i = 0; while (d <= x) { d += vec.at(i); i++; } cout << i << endl; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { long long n, x; cin >> n >> x; vector<int> vec(n); rep(i, n) cin >> vec.at(i); vector<int> d(n + 1); rep(i, n) d.at(i + 1) = d.at(i) + vec.at(i); int ans = 0; rep(i, n + 1) if (d.at(i) <= x) ans++; ...
replace
9
16
9
14
0
p03000
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(s, t) \ for (int s = 0; s < t; s++) \ ; using namespace std; using ll = long long; int main() { int n, x, k; cin >> n >> x; vector<int> l(n + 1); l[0] = 0;...
#include <bits/stdc++.h> #define rep(s, t) \ for (int s = 0; s < t; s++) \ ; using namespace std; using ll = long long; int main() { int n, x, k; cin >> n >> x; vector<int> l(n + 1); l[0] = 0;...
replace
24
25
24
25
TLE
p03000
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, x; cin >> n >> x; vector<int> l(n); for (int i = 0; i < n; ++i) { cin >> l.at(i); } int position = 0; int ans = 0; while (position <= x) { position += l.at(ans); ans++; } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n, x; cin >> n >> x; vector<int> l(n); for (int i = 0; i < n; ++i) { cin >> l.at(i); } int position = 0; int ans = 1; for (int j = 0; j < n; ++j) { position += l.at(j); if (position <= x) ans++; } cout << ans << endl;...
replace
12
16
12
17
0
p03000
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, X; cin >> N >> X; vector<int> L(N); for (int i = 0; i < N; i++) { cin >> L.at(i); } int distance = 0; int number = 0; while (distance <= X) { distance += L.at(number); number++; } cout << number << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N, X; cin >> N >> X; vector<int> L(N); for (int i = 0; i < N; i++) { cin >> L.at(i); } int distance = 0; int number = 0; while (distance <= X && number <= N) { if (number < N) { distance += L.at(number); } number++; }...
replace
11
13
11
15
0
p03000
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int X, N; cin >> N >> X; vector<int> L(N); for (int i = 0; i < N; i++) cin >> L.at(i); int count = 0; int Dn = 0; for (int i = 0; Dn < X + 1; i++) { count++; Dn += L.at(i); } cout << count << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int X, N; cin >> N >> X; vector<int> L(N); for (int i = 0; i < N; i++) cin >> L.at(i); int count = 0; int Dn = 0; for (int i = 0; Dn < X + 1; i++) { count++; Dn += L.at(i); if (i == N - 1) { if (Dn < X + 1) count++; ...
insert
14
14
14
19
0
p03000
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { long long n, x; cin >> n >> x; vector<long long> l(n + 1); for (int i = 0; i < n; i++) { cin >> l[i]; } vector<long long> dp(n); dp[0] = 0; for (int i = 1; i < n + 1; i++) { dp[i] = dp[i - 1] + l[i - 1]; } int ans = 0; for (int j...
#include <bits/stdc++.h> using namespace std; int main() { long long n, x; cin >> n >> x; vector<long long> l(n + 1); for (int i = 0; i < n; i++) { cin >> l[i]; } vector<long long> dp(n + 1); dp[0] = 0; for (int i = 1; i < n + 1; i++) { dp[i] = dp[i - 1] + l[i - 1]; } int ans = 0; for (i...
replace
10
11
10
11
-6
Fatal glibc error: malloc assertion failure in sysmalloc: (old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)
p03000
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, x; int i = 0; int xxx = 0; cin >> n >> x; vector<int> l(n); while (i < n) { cin >> l.at(i++); } i = 0; while (xxx <= x) { i++; if (i <= n) { xxx += l.at(i - 1); } } cout << i << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, x; int i = 0; int xxx = 0; cin >> n >> x; vector<int> l(n); while (i < n) { cin >> l.at(i++); } i = 0; while (xxx <= x) { i++; if (i <= n) { xxx += l.at(i - 1); } else { break; } } cout << i << endl...
insert
18
18
18
20
0
p03000
C++
Runtime Error
#include <iostream> using namespace std; int L[101]; int main() { cin.tie(0); ios::sync_with_stdio(false); int N, X; cin >> N >> X; for (int i = 0; i < N; i++) cin >> L[i]; int d = 0; int ans = 0; int idx = 0; while (d <= X) { ans++; d += L[idx]; idx++; } cout << ans << endl; r...
#include <iostream> using namespace std; int L[101]; int main() { cin.tie(0); ios::sync_with_stdio(false); int N, X; cin >> N >> X; for (int i = 0; i < N; i++) cin >> L[i]; int d = 0; int ans = 0; int idx = 0; while (d <= X) { ans++; if (idx == N) break; d += L[idx]; idx++;...
insert
17
17
17
19
0
p03000
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { int n, x; cin >> n >> x; vector<ll> v(n), vv(n); for (int i = 0; i < n; ++i) cin >> v[i]; vv[0] = v[0]; for (int i = 1; i <= n; ++i) vv[i] = vv[i - 1] + v[i]; int cnt = 1; for (int i = 0; i < n; ++i) if (vv[i] <...
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { int n, x; cin >> n >> x; vector<ll> v(n), vv(n); for (int i = 0; i < n; ++i) cin >> v[i]; vv[0] = v[0]; for (int i = 1; i < n; ++i) vv[i] = vv[i - 1] + v[i]; int cnt = 1; for (int i = 0; i < n; ++i) if (vv[i] <=...
replace
11
12
11
12
-6
Fatal glibc error: malloc assertion failure in sysmalloc: (old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)
p03000
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, x; cin >> n >> x; vector<int> l(n); for (int i = 0; i < n; i++) cin >> l.at(i); int count = 1; int y = 0; for (int i = 0; i <= n; i++) { y += l.at(i); if (y <= x) count++; else break; } cout << count << endl;...
#include <bits/stdc++.h> using namespace std; int main() { int n, x; cin >> n >> x; vector<int> l(n); for (int i = 0; i < n; i++) cin >> l.at(i); int count = 1; int y = 0; for (int i = 0; i < n; i++) { y += l.at(i); if (y <= x) count++; else break; } cout << count << endl; ...
replace
10
11
10
11
0
p03000
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int l[105]; int main() { // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); int n, x, d = 0, b = 1; cin >> n >> x; for (int i = 1; i <= n; ++i) { cin >> l[i]; } while (1) { d = d + l[b]; if (d > x) break; b++...
#include <bits/stdc++.h> using namespace std; int l[105]; int main() { // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); int n, x, d = 0, b = 1; cin >> n >> x; for (int i = 1; i <= n; ++i) { cin >> l[i]; } while (b < n + 1) { d = d + l[b]; if (d > x) break;...
replace
16
17
16
17
0
p03000
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, X; cin >> N >> X; vector<int> Vec(N); for (int i = 0; i < N; i++) { cin >> Vec.at(i); } int count = 0; while (X > -1 && count < N + 2) { X -= Vec.at(count); count++; } cout << count << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N, X; cin >> N >> X; vector<int> Vec(N); for (int i = 0; i < N; i++) { cin >> Vec.at(i); } int count = 1; while (count < N + 1) { X -= Vec.at(count - 1); if (X > -1) { count++; } else { break; } } cout << c...
replace
10
14
10
18
0
p03000
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iterator> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; int n; int l[110]; int s[110]; int x; int main() { scanf("%d%d", &n, &x); s[0] = 0; for (int i...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iterator> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; int n; int l[110]; int s[110]; int x; int main() { scanf("%d%d", &n, &x); s[0] = 0; for (int i...
replace
29
30
29
30
0
p03000
C++
Runtime Error
#include <iostream> #include <vector> int main() { int n, x; std::cin >> n >> x; std::vector<int> point(n); for (auto &e : point) std::cin >> e; auto p = 0, count = 0; while (p <= x) { p += point.at(count); ++count; } std::cout << count; return 0; }
#include <iostream> #include <vector> int main() { int n, x; std::cin >> n >> x; std::vector<int> point(n); for (auto &e : point) std::cin >> e; auto p = 0, count = 0; try { while (p <= x) { p += point.at(count); ++count; } } catch (...) { count++; } std::cout << count; ...
replace
11
14
11
18
0
p03000
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> vec(n); int ans = 0; int d = 0; for (int i = 0; i < n; i++) { cin >> vec.at(i); } for (int i = 0; d <= m; i++) { ans++; d += vec.at(i); } cout << ans; }
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> vec(n); int ans = 0; int d = 0; for (int i = 0; i < n; i++) { cin >> vec.at(i); } for (int i = 0; d <= m; i++) { ans++; if (ans == n + 1) break; d += vec.at(i); } cout << ans; }
insert
14
14
14
16
0
p03000
C++
Runtime Error
/////////////////////////////////////////////////////////// #include <algorithm> #include <array> #include <iostream> #include <string> #include <vector> using namespace std; /////////////////////////////////////////////////////////// #define ll long long #define ull insigned lon long //////////////////////////////////...
/////////////////////////////////////////////////////////// #include <algorithm> #include <array> #include <iostream> #include <string> #include <vector> using namespace std; /////////////////////////////////////////////////////////// #define ll long long #define ull insigned lon long //////////////////////////////////...
replace
33
34
33
36
0
p03000
C++
Runtime Error
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; int main() { int N, X; cin >> N >> X; vector<int> L(N); for (int i = 0; i < N; i++) cin >> L[i]; int sum = 0; int cnt = 0; int i = 0; while (sum <= X) { cnt += 1; sum += L[i]; if (cnt == N + 1) break; i++; ...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; int main() { int N, X; cin >> N >> X; vector<int> L(N); for (int i = 0; i < N; i++) cin >> L[i]; int sum = 0; int cnt = 0; int i = 0; while (sum <= X) { cnt += 1; if (i == N) break; sum += L[i]; if (cnt == N ...
insert
15
15
15
17
0
p03000
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; // define #define int long long #define str string #define rep(x, y) for (int i = x; i < y; i++) #define REP(x, y) for (int j = x; j < y; j++) #define all(x) x.begin(), x.end() #define elif else if // vectordefine #define vint vector<int> #define vc vector<char> #define vtr...
#include <bits/stdc++.h> using namespace std; // define #define int long long #define str string #define rep(x, y) for (int i = x; i < y; i++) #define REP(x, y) for (int j = x; j < y; j++) #define all(x) x.begin(), x.end() #define elif else if // vectordefine #define vint vector<int> #define vc vector<char> #define vtr...
replace
36
37
36
37
0
p03000
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; typedef long long ll; int main() { int N, X; cin >> N >> X; vector<int> v(N); vector<int> s(N); for (int i = 0; i < N; i++) cin >> v[i]; for (int i = 0; i <= N; i++) { s[i + 1] = s[i] + v[i]; } int ans = 1; for (int i = 1; i <= N; i++)...
#include <iostream> #include <vector> using namespace std; typedef long long ll; int main() { int N, X; cin >> N >> X; vector<int> v(N + 10); vector<int> s(N + 10); for (int i = 0; i < N; i++) cin >> v[i]; for (int i = 0; i <= N; i++) { s[i + 1] = s[i] + v[i]; } int ans = 1; for (int i = 1; i ...
replace
7
9
7
9
0
p03000
C++
Runtime Error
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <string> #include <vector> using namespace std; #define _GLIBCXX_DEBUG #define pq priority_queue #define mp make_pair #define pb push_back #define ff first #define ss second #define pii pair<long long, l...
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <string> #include <vector> using namespace std; #define _GLIBCXX_DEBUG #define pq priority_queue #define mp make_pair #define pb push_back #define ff first #define ss second #define pii pair<long long, l...
insert
65
65
65
67
0
p03000
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, X; cin >> N >> X; vector<int> L(N); for (int i = 0; i < N; i++) { cin >> L.at(i); } int sum = 0; int num = 0; for (int i = 0; sum <= X; i++) { sum += L.at(i); num++; } cout << num; }
#include <bits/stdc++.h> using namespace std; int main() { int N, X; cin >> N >> X; vector<int> L(N); for (int i = 0; i < N; i++) { cin >> L.at(i); } int sum = 0; int num = 0; for (int i = 0; sum <= X; i++) { sum += L.at(i); num++; if (i == N - 1) { if (sum <= X) { num++; ...
insert
15
15
15
21
0
p03000
C++
Runtime Error
#include <iostream> #include <vector> int main() { int n, x; std::cin >> n >> x; std::vector<int> l; l.push_back(0); for (int i = 0; i < n; i++) { int t; std::cin >> t; l[i + 1] = (t + l[i]); } int s = 0; int i; for (i = 0; i <= n; i++) { if (l[i] <= x) { s++; } } std::c...
#include <iostream> #include <vector> int main() { int n, x; std::cin >> n >> x; std::vector<int> l(n + 1); l[0] = 0; for (int i = 0; i < n; i++) { int t; std::cin >> t; l[i + 1] = (t + l[i]); } int s = 0; int i; for (i = 0; i <= n; i++) { if (l[i] <= x) { s++; } } std::...
replace
6
8
6
8
0
p03001
C++
Runtime Error
/// ..:: In The Name Of God ::.. #include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define endl '\n' #define INF 2e9 #define int ll #define vi vector<int> #define de deque<int> #define S...
/// ..:: In The Name Of God ::.. #include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define endl '\n' #define INF 2e9 #define int ll #define vi vector<int> #define de deque<int> #define S...
replace
29
32
29
33
0
p03001
C++
Runtime Error
#include <stdio.h> int main() { int n, m, x, y; double s; while (~scanf("%d%d%d%d", &n, &m, &x, &y)) { s = n * m / 2; if (n % 2 == 0 && m % 2 == 0 && n / x == 2 && m / y == 2) { printf("%.7lf 1\n", s); } else { printf("%.7lf 0\n", s); } } }
#include <stdio.h> int main() { int w, h, x, y; while (~scanf("%d%d%d%d", &w, &h, &x, &y)) { double z1, z2; z1 = w / 2.0; z2 = h / 2.0; if (x == z1 && y == z2) printf("%lf %d\n", double(w) * double(h) / 2, 1); else printf("%lf %d\n", double(w) * double(h) / 2, 0); } }
replace
2
12
2
11
0
p03001
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++) int main() { double H, W, x, y; cin >> W >> H >> x >> y; if ((x == 0 || x == W) && (y == 0 || y == H)) { printf("%.12lf 0\n", H * W / 2); return 0; } if ((...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++) int main() { double H, W, x, y; cin >> W >> H >> x >> y; if ((x == 0 || x == W) && (y == 0 || y == H)) { printf("%.12lf 0\n", H * W / 2); return 0; } if ((...
replace
20
27
20
22
0
p03001
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <unordered_map> #include <vector> using namespace std...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <unordered_map> #include <vector> using namespace std...
replace
87
99
87
88
-6
62912dba-56bc-450d-b844-ed61b0db20c1.out: /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03001/C++/s818677345.cpp:82: int main(): Assertion `false' failed.
p03001
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int64_t MOD = 1000000007; #define FOR(i, start, end) for (uint64_t i = start; i < end; i++) #define REP(i, n) FOR(i, 0, n) typedef long long ll; typedef unsigned long long ull; // 最大公約数gcd // 最小公倍数lcm=m*n/gcd uint64_t gcd(uint64_t m, uint64_t n) { uint64_t temp;...
#include <bits/stdc++.h> using namespace std; const int64_t MOD = 1000000007; #define FOR(i, start, end) for (uint64_t i = start; i < end; i++) #define REP(i, n) FOR(i, 0, n) typedef long long ll; typedef unsigned long long ull; // 最大公約数gcd // 最小公倍数lcm=m*n/gcd uint64_t gcd(uint64_t m, uint64_t n) { uint64_t temp;...
replace
103
104
103
105
0
p03001
Python
Runtime Error
W, H, x, y = map(int, input().split()) ans = [min(x, W - x) * H, min(y, H - y) * W] if ( (x == 0 and y == 0) or (x == W and y == 0) or (x == 0 and y == H) or (x == W and y == H) ): print(W * H / 2, 0) elif y / x == H / W: if x == W / 2 and y == H / 2: print(W * H / 2, 1) else: ...
W, H, x, y = map(int, input().split()) print(W * H / 2, 1 if W / 2 == x and H / 2 == y else 0)
replace
2
18
2
3
0
p03001
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { long a, b, c, d; cin >> a >> b >> c >> d; cout << a * b / c << ' ' << (a == 2 * c && b == 2 * d) << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long a, b, c, d; cin >> a >> b >> c >> d; cout << a * b / 2.0 << ' ' << (a == 2 * c && b == 2 * d) << endl; }
replace
6
7
6
7
0
p03001
Python
Runtime Error
# 真ん中を通れば必ず二分できてこれが最大値だが、自分自身が真ん中の座標の場合は自分自信を通るどんな直線も二分できる w, h, x, y = map(int, input().split()) ans1 = (w * h) / 2.0 ans2 = 1 if w // x == h // y == 2 else 0 print(ans1, ans2)
# 真ん中を通れば必ず二分できてこれが最大値だが、自分自身が真ん中の座標の場合は自分自信を通るどんな直線も二分できる w, h, x, y = map(int, input().split()) ans1 = (w * h) / 2.0 ans2 = 1 if w / 2 == x and h / 2 == y else 0 print(ans1, ans2)
replace
3
4
3
4
0
p03001
Python
Runtime Error
W, H, x, y = map(int, input().split()) jufuku = 0 if x == 0 and y == 0: if y / x == H / W: naname = W * H / 2 jufuku = 1 kiri = naname else: # 縦 tate = min((W - x) * H, x * H) # 横 yoko = min(W * (H - y), W * y) if tate == yoko: jufuku = 1 kiri = max(tate, yoko...
W, H, x, y = map(int, input().split()) jufuku = 0 if W / 2 == x and H / 2 == y: jufuku = 1 print(W * H / 2, jufuku)
replace
2
16
2
5
0
p03001
Python
Runtime Error
W, H, x, y = map(int, input().split()) print(W * H / 2, 1 if W / x == 2 and H / y == 2 else 0)
W, H, x, y = map(int, input().split()) print(W * H / 2, 1 if x != 0 and y != 0 and W / x == 2 and H / y == 2 else 0)
replace
1
2
1
2
0
p03001
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main(int argc, char *argv[]) { uint64_t w, h, x, y; cin >> w >> h >> x >> y; vector<double> ws; ws.push_back((h - y) * w); ws.push_back(y * w); vector<double> hs; hs.push_back(h * (w - x)); hs.push_back(h * x); vector<double> ds; if (x > 0 && y >...
#include <bits/stdc++.h> using namespace std; int main(int argc, char *argv[]) { uint64_t w, h, x, y; cin >> w >> h >> x >> y; cout << w * h / (double)2 << endl; cout << (x + x == w && y + y == h) << endl; return 0; }
replace
7
61
7
9
0
p03001
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <vector> using namespace ...
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <vector> using namespace ...
replace
23
32
23
31
0
p03001
C++
Runtime Error
#include <bits/stdc++.h> #define REP(i, n) for (ll i = 0; i < n; i++) #define ALL(x) (x).begin(), (x).end() #define MSG(x) cout << x << endl; #define YN(x) x ? cout << "YES" << endl : cout << "NO" << endl; #define Yn(x) x ? cout << "Yes" << endl : cout << "No" << endl; #define yn(x) x ? cout << "yes" << endl : cout <<...
#include <bits/stdc++.h> #define REP(i, n) for (ll i = 0; i < n; i++) #define ALL(x) (x).begin(), (x).end() #define MSG(x) cout << x << endl; #define YN(x) x ? cout << "YES" << endl : cout << "NO" << endl; #define Yn(x) x ? cout << "Yes" << endl : cout << "No" << endl; #define yn(x) x ? cout << "yes" << endl : cout <<...
replace
18
19
18
20
0
p03001
C++
Runtime Error
#include <bits/stdc++.h> #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() { int w, h, x, y; cin >> w >> h >> x >> y; cout << setprecision(15) << (double)w * h / 2.0 << " "; cout << (w / x * 2 == w && h / y * 2 == h ? 1 : 0) << endl; ...
#include <bits/stdc++.h> #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() { int w, h, x, y; cin >> w >> h >> x >> y; cout << setprecision(15) << (double)w * h / 2.0 << " "; cout << (x && y && w / x / 2 * x * 2 == w && h / y / 2 * y *...
replace
9
10
9
11
0
p03001
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <utility> #include <vector> using namespace std; int main() { int W, H, x, y; cin >> W >> H >> x >> y; printf("%.9f %d\n", W * H / 2.0, W * H / (x * y) == 4.0); }
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <utility> #include <vector> using namespace std; int main() { double W, H, x, y; cin >> W >> H >> x >> y; printf("%.9f %d\n", W * H / 2.0, W * H / (x * y) == 4.0); }
replace
11
12
11
12
0
p03001
C++
Runtime Error
#include <iomanip> #include <iostream> using namespace std; int w, h, x, y; int main() { cin >> w >> h >> x >> y; cout << setprecision(20) << (long double)w * (long double)h / 2.0 << " "; if (w / 2 == x && h / 2 == y && w % x == 0 && h % y == 0) cout << 1 << endl; else cout << 0 << endl; return 0; ...
#include <iomanip> #include <iostream> using namespace std; int w, h, x, y; int main() { cin >> w >> h >> x >> y; cout << (double)w * (double)h / 2.0 << " "; if (x == 0 || y == 0) { cout << 0 << endl; return 0; } if (w / 2 == x && h / 2 == y && w % x == 0 && h % y == 0) cout << 1 << endl; els...
replace
9
10
9
14
0
p03001
C++
Runtime Error
#include <stdio.h> int main() { long long w, h, x, y; double s; int t; while (~scanf("%lld%lld%lld%lld", &w, &h, &x, &y)) { t = 0; s = (double)w * (double)h / 2; if (w % 2 == 0 && h % 2 == 0 && x == w / 2 && y == h / 2) t = 1; printf("%.6llf %d\n", s, t); } return 0; }
#include <stdio.h> int main() { long long w, h, x, y; double s; int t; while (~scanf("%lld%lld%lld%lld", &w, &h, &x, &y)) { t = 0; s = (double)w * (double)h / 2; if (w % 2 == 0 && h % 2 == 0 && x == w / 2 && y == h / 2) t = 1; printf("%.6lf %d\n", s, t); } return 0; }
replace
10
11
10
11
0
p03001
C++
Runtime Error
#include <bits/stdc++.h> #define PI 3.1415926535897 using namespace std; typedef long long ll; const int INF = 1000000000; const ll LINF = 1000000000000000000; // 1e18 const double EPS = 1e-10; int main(void) { std::cout << std::fixed << std::setprecision(10); ll W, H, x, y; cin >> W >> H >> x >> y; printf("%...
#include <bits/stdc++.h> #define PI 3.1415926535897 using namespace std; typedef long long ll; const int INF = 1000000000; const ll LINF = 1000000000000000000; // 1e18 const double EPS = 1e-10; int main(void) { std::cout << std::fixed << std::setprecision(10); ll W, H, x, y; cin >> W >> H >> x >> y; printf("%...
replace
13
14
13
14
0
p03001
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <fstream> #include <functional> #include <iostream> #include <map> #include <queue> #include <stack> #include <string> #include <vector> using namespace std; using ll = long long; #define all(x) (x).begin(), (x).end() #define PRI(n) cout << n << " " << ...
#include <algorithm> #include <bitset> #include <cmath> #include <fstream> #include <functional> #include <iostream> #include <map> #include <queue> #include <stack> #include <string> #include <vector> using namespace std; using ll = long long; #define all(x) (x).begin(), (x).end() #define PRI(n) cout << n << " " << ...
replace
78
84
78
84
0
p03001
C++
Runtime Error
#include <iostream> using namespace std; int main() { long W, H, x, y; cin >> W >> H >> x >> y; cout << fixed << (double(W) * double(H) / 2) << " " << ((H % y == 0 && W % x == 0) ? 1 : 0) << endl; }
#include <iostream> using namespace std; int main() { long W, H, x, y; cin >> W >> H >> x >> y; cout << ((double)W * (double)H / 2.0) << " " << ((x + x == W && y + y == H) ? 1 : 0) << endl; }
replace
7
9
7
9
0
p03001
C++
Runtime Error
#include <stdio.h> #define ll long long int main() { ll w, h, x, y; double ans1 = 0; scanf("%lld%lld%lld%lld", &w, &h, &x, &y); ans1 = (double)((w * h) / 2.0); if (w % x == 0 && h % y == 0) { printf("%.6lf 1\n", ans1); } else { printf("%.6lf 0\n", ans1); } }
#include <stdio.h> #define ll long long int main() { ll w, h, x, y; double ans1 = 0; scanf("%lld%lld%lld%lld", &w, &h, &x, &y); ans1 = (double)((w * h) / 2.0); if (w == 2 * x && h == 2 * y) { printf("%.6lf 1\n", ans1); } else { printf("%.6lf 0\n", ans1); } }
replace
7
8
7
8
0
p03001
C++
Runtime Error
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstdlib> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> #define DEBUG 1 constexpr int kMod = 1000000007; typedef long long LL; int main() { LL W, H, x, y; std::cin >> W >> H...
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstdlib> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> #define DEBUG 1 constexpr int kMod = 1000000007; typedef long long LL; int main() { LL W, H, x, y; std::cin >> W >> H...
replace
18
30
18
21
0
p03001
C++
Runtime Error
#include <iostream> using namespace std; int main() { int N, X; int L[100]; L[0] = 0; cin >> N >> X; for (int i = 1; i <= N; i++) { cin >> L[i]; L[i] += L[i - 1]; } bool a = false; for (int i = 0; i <= N; i++) { if (X < L[i]) { cout << i << endl; a = true; break; } ...
#include <iostream> using namespace std; int main() { double W, H, x, y; cin >> W >> H >> x >> y; cout << W * H / 2.0 << " " << (x * 2 == W && y * 2 == H) << endl; }
replace
5
24
5
8
0
p03001
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #ifndef ONLINE_JUDGE freopen("Input.txt", "r", stdin); freopen("Output.txt", "w", stdout); #endif double W, H, x, y; cin >> W >> H >> x >> y; cout << fixed; cout << setpreci...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); double W, H, x, y; cin >> W >> H >> x >> y; cout << fixed; cout << setprecision(10); double area = (W * H) / 2; double midx = W / 2; double midy = H / 2; if (midx == x ...
delete
7
12
7
7
0
p03001
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { long long int n, x, i; cin >> n >> x; long long int arr[n]; for (i = 0; i < n; i++) cin >> arr[i]; long long int d = 0; i = 0; long long int count = 0; do { count++; d = d + arr[i]; i++; } while (d <= x && count <= n + 1); co...
#include <bits/stdc++.h> using namespace std; int main() { double w, h, x, y, area; cin >> w >> h >> x >> y; cout << (w * h) / 2; if (x == w / 2 && y == h / 2) { cout << " 1" << endl; } else cout << " 0" << endl; return 0; }
replace
3
17
3
11
0
p03001
C++
Runtime Error
#include <assert.h> #include <bits/stdc++.h> using namespace std; using i64 = long long; int main() { i64 w, h, x, y; cin >> w >> h >> x >> y; if ((x == 0 && y == 0) || (x == w && y == 0) || (x == w && y == h) || (x == 0 && y == h)) return -1; // cout << fixed << setprecision(10) << (double)w * h / 2 <...
#include <assert.h> #include <bits/stdc++.h> using namespace std; using i64 = long long; int main() { i64 w, h, x, y; cin >> w >> h >> x >> y; cout << fixed << setprecision(10) << (double)w * h / 2 << " " << (x * 2 == w && y * 2 == h ? 1 : 0) << endl; return 0; }
replace
8
18
8
10
255
p03001
C++
Runtime Error
#include <algorithm> #include <bits/stdc++.h> #include <cmath> // abs() for float, and fabs() #include <cstdlib> // abs() for integer 絶対値求めやつ #include <iomanip> //浮動小数点数を出力する制度の指定 #include <limits> #include <numeric> #include <string> #include <type_traits> #include <vector> // 使い方 数値をnumとして cout<<setprecision(n)<<nu...
#include <algorithm> #include <bits/stdc++.h> #include <cmath> // abs() for float, and fabs() #include <cstdlib> // abs() for integer 絶対値求めやつ #include <iomanip> //浮動小数点数を出力する制度の指定 #include <limits> #include <numeric> #include <string> #include <type_traits> #include <vector> // 使い方 数値をnumとして cout<<setprecision(n)<<nu...
replace
55
57
55
59
0
p03003
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cctype> #include <climits> #include <cmath> #include <deque> #include <fstream> #include <functional> #include <initializer_list> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #...
#include <algorithm> #include <bitset> #include <cctype> #include <climits> #include <cmath> #include <deque> #include <fstream> #include <functional> #include <initializer_list> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #...
replace
49
51
49
67
TLE
p03003
C++
Runtime Error
#include <algorithm> #include <cassert> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < n; ++i) using namespace std; using ll = long long; using P = pair<int, int>; // auto mod int const int m...
#include <algorithm> #include <cassert> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < n; ++i) using namespace std; using ll = long long; using P = pair<int, int>; // auto mod int const int m...
replace
64
65
64
65
0
p03003
C++
Time Limit Exceeded
#include <bits/stdc++.h> // #undef DEBUG // Uncomment this line to forcefully disable debug print. #if DEBUG template <typename T> void debug(T value) { std::cerr << value; } template <typename T, typename... Ts> void debug(T value, Ts... args) { std::cerr << value << ", "; debug(args...); } #define dbg(...) ...
#include <bits/stdc++.h> // #undef DEBUG // Uncomment this line to forcefully disable debug print. #if DEBUG template <typename T> void debug(T value) { std::cerr << value; } template <typename T, typename... Ts> void debug(T value, Ts... args) { std::cerr << value << ", "; debug(args...); } #define dbg(...) ...
replace
169
176
169
172
TLE
p03003
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i) #define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i) #define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--) #define rreps(i, n) for (int i = ((int)(n)); i > 0; i--) #define irep(i, m, n) for (int i = ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i) #define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i) #define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--) #define rreps(i, n) for (int i = ((int)(n)); i > 0; i--) #define irep(i, m, n) for (int i = ...
replace
78
79
78
79
0
p03003
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define endl '\n' ll n, m; ll dp[1005][1005]; ll mod = (1e9) + 7; int main() { std::ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n >> m; ll arr[n + 1]; ll brr[m + 1]; for (ll i = 1; i <= n; i++) cin >> arr[i...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define endl '\n' ll n, m; ll dp[2005][2005]; ll mod = (1e9) + 7; int main() { std::ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n >> m; ll arr[n + 1]; ll brr[m + 1]; for (ll i = 1; i <= n; i++) cin >> arr[i...
replace
8
9
8
9
0
p03003
C++
Runtime Error
#include <bits/stdc++.h> #define REP(i, m, n) for (int(i) = (m); (i) < (n); ++i) #define rep(i, n) REP(i, 0, n) #define all(x) (x).begin(), (x).end() using namespace std; using Graph = vector<vector<int>>; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }...
#include <bits/stdc++.h> #define REP(i, m, n) for (int(i) = (m); (i) < (n); ++i) #define rep(i, n) REP(i, 0, n) #define all(x) (x).begin(), (x).end() using namespace std; using Graph = vector<vector<int>>; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }...
replace
91
93
91
93
0
p03003
C++
Runtime Error
#include <bits/stdc++.h> #define F first #define S second using namespace std; typedef long long ll; typedef long double ld; const int mod = 1000000007; const int max_n = 1011; int main() { int n, a[max_n], m, b[max_n]; cin >> n >> m; for (int i = 0; i < n; ++i) { scanf("%d", &a[i]); } for (int i = 0; ...
#include <bits/stdc++.h> #define F first #define S second using namespace std; typedef long long ll; typedef long double ld; const int mod = 1000000007; const int max_n = 2011; int main() { int n, a[max_n], m, b[max_n]; cin >> n >> m; for (int i = 0; i < n; ++i) { scanf("%d", &a[i]); } for (int i = 0; ...
replace
9
10
9
10
0
p03003
C++
Runtime Error
#include <bits/stdc++.h> using namespace std::literals::string_literals; using i64 = long long; using std::cin; using std::cout; using std::endl; template <typename T> std::vector<T> make_v(size_t a) { return std::vector<T>(a); } template <typename T, typename... Ts> auto make_v(size_t a, Ts... ts) { return std::...
#include <bits/stdc++.h> using namespace std::literals::string_literals; using i64 = long long; using std::cin; using std::cout; using std::endl; template <typename T> std::vector<T> make_v(size_t a) { return std::vector<T>(a); } template <typename T, typename... Ts> auto make_v(size_t a, Ts... ts) { return std::...
replace
18
19
18
19
0
p03003
C++
Runtime Error
#include <iostream> using namespace std; long long MOD = 1000000007; int main() { // input long long N, M; cin >> N >> M; long long S[N + 1], T[N + 1]; long long i, j; for (i = 1; i <= N; i++) { cin >> S[i]; } for (j = 1; j <= M; j++) { cin >> T[j]; } // calc long long sum[N + 1][M + 1]...
#include <iostream> using namespace std; long long MOD = 1000000007; int main() { // input long long N, M; cin >> N >> M; long long S[N + 1], T[M + 1]; long long i, j; for (i = 1; i <= N; i++) { cin >> S[i]; } for (j = 1; j <= M; j++) { cin >> T[j]; } // calc long long sum[N + 1][M + 1]...
replace
9
10
9
10
0
sh: 1: pause: not found
p03003
C++
Runtime Error
// #pragma GCC optimize ("-O3") #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <regex> #include <set>...
// #pragma GCC optimize ("-O3") #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <regex> #include <set>...
replace
677
678
677
678
0
p03003
C++
Runtime Error
#include <algorithm> #include <array> #include <assert.h> #include <bitset> #include <cmath> // 変数名にy1が使えなくなるかも…。 #include <fstream> #include <iostream> #include <map> #include <queue> #include <set> #include <stdio.h> #include <stdlib.h> #include <string> #include <unordered_map> #include <unordered_set> #include <vec...
#include <algorithm> #include <array> #include <assert.h> #include <bitset> #include <cmath> // 変数名にy1が使えなくなるかも…。 #include <fstream> #include <iostream> #include <map> #include <queue> #include <set> #include <stdio.h> #include <stdlib.h> #include <string> #include <unordered_map> #include <unordered_set> #include <vec...
replace
33
34
33
34
0
p03003
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define FOR(i, l, r) for (long long i = (l); i < (r); ++i) #define REP(i, n) FOR(i, 0, n) #define REPS(i, n) FOR(i, 1, n + 1) #define RFOR(i, l, r) for (long long i = (l); i >= (r); --i) #define RREP(i, n) RFOR(i, n - 1, 0) #define RREPS(i, n) RFOR(i, n, 1) #define int long...
#include <bits/stdc++.h> using namespace std; #define FOR(i, l, r) for (long long i = (l); i < (r); ++i) #define REP(i, n) FOR(i, 0, n) #define REPS(i, n) FOR(i, 1, n + 1) #define RFOR(i, l, r) for (long long i = (l); i >= (r); --i) #define RREP(i, n) RFOR(i, n - 1, 0) #define RREPS(i, n) RFOR(i, n, 1) #define int long...
replace
102
103
102
103
0
p03003
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; const ll INF64 = 1LL << 60; const int INF32 = 1 << 29; const int MOD = 1000000007; template <int MOD> struct Fp { long long val; constexpr Fp(long long v = 0) noexcept : val(v % MOD) { if (val < 0) v += MOD; ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; const ll INF64 = 1LL << 60; const int INF32 = 1 << 29; const int MOD = 1000000007; template <int MOD> struct Fp { long long val; constexpr Fp(long long v = 0) noexcept : val(v % MOD) { if (val < 0) v += MOD; ...
replace
83
84
83
84
-11
p03003
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <utility> #include <vector> using namespace std; constexpr long long MOD = 1e9 + 7; int s[1010], t[1010]; long long dp[1010][1010]; int main() { in...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <utility> #include <vector> using namespace std; constexpr long long MOD = 1e9 + 7; int s[2010], t[2010]; long long dp[2010][2010]; int main() { in...
replace
14
16
14
16
0
p03003
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include ...
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include ...
replace
52
53
52
53
0
p03003
Python
Runtime Error
import itertools N, M = [int(_) for _ in input().split()] S = [int(_) for _ in input().split()] T = [int(_) for _ in input().split()] mod = 10**9 + 7 dp = [[1] * (N + 1)] + [[1] + [0] * M for _ in range(N)] for n, m in itertools.product(range(N), range(M)): dp[n + 1][m + 1] = dp[n][m + 1] + dp[n + 1][m] - dp[n][m]...
import itertools N, M = [int(_) for _ in input().split()] S = [int(_) for _ in input().split()] T = [int(_) for _ in input().split()] mod = 10**9 + 7 dp = [[1] * (M + 1)] + [[1] + [0] * M for _ in range(N)] for n, m in itertools.product(range(N), range(M)): dp[n + 1][m + 1] = dp[n][m + 1] + dp[n + 1][m] - dp[n][m]...
replace
6
7
6
7
0
p03003
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define P 1000000007 int main() { long long N, M; cin >> N >> M; vector<long long> S(N), T(M); for (long long i = 0; i < N; i++) cin >> S[i]; for (long long i = 0; i < M; i++) cin >> T[i]; vector<vector<long long>> DP(N, vector<long long>(M, 0)); for ...
#include <bits/stdc++.h> using namespace std; #define P 1000000007 int main() { long long N, M; cin >> N >> M; vector<long long> S(N), T(M); for (long long i = 0; i < N; i++) cin >> S[i]; for (long long i = 0; i < M; i++) cin >> T[i]; vector<vector<long long>> DP(N, vector<long long>(M, 0)); for ...
replace
29
30
29
32
0
p03003
C++
Memory Limit Exceeded
#include <cstdio> #include <iostream> #include <vector> using namespace std; typedef long long int ll; #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define rep3(i, m, n) for (int(i) = m; (i) <= (n); (i)++) #define rep3rev(i, m, n) for (int(i) = m; (i) >= (n); (i)--) #define all(a) (a.begin()), (a.end()) #defin...
#include <cstdio> #include <iostream> #include <vector> using namespace std; typedef long long int ll; #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define rep3(i, m, n) for (int(i) = m; (i) <= (n); (i)++) #define rep3rev(i, m, n) for (int(i) = m; (i) >= (n); (i)--) #define all(a) (a.begin()), (a.end()) #defin...
replace
14
15
14
15
MLE
p03003
C++
Runtime Error
#include <bits/stdc++.h> #define int long long using namespace std; class RSAQ { public: typedef long long ll; const int mod = 1e9 + 7; // マージ可能な主データ型 struct D { ll value; D() : value(0) {} /*適切な値にする!!!!!!*/ D(ll value) : value(value) {} bool operator<(D a) const { return value < a.value; } }...
#include <bits/stdc++.h> #define int long long using namespace std; class RSAQ { public: typedef long long ll; const int mod = 1e9 + 7; // マージ可能な主データ型 struct D { ll value; D() : value(0) {} /*適切な値にする!!!!!!*/ D(ll value) : value(value) {} bool operator<(D a) const { return value < a.value; } }...
replace
118
119
118
119
0
p03003
C++
Runtime Error
#include <bits/stdc++.h> #define int long long #define double long double #define endl "\n" #define fastio \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
#include <bits/stdc++.h> #define int long long #define double long double #define endl "\n" #define fastio \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
replace
45
47
45
48
0
p03003
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <iomanip> #include <iostream> #include <map> #include <memory.h> #include <queue> #include <set> #include <stack> #include <string> #include <time.h> #include <vector> #define P pair<int, int> #define LL long long #define LD long double...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <iomanip> #include <iostream> #include <map> #include <memory.h> #include <queue> #include <set> #include <stack> #include <string> #include <time.h> #include <vector> #define P pair<int, int> #define LL long long #define LD long double...
replace
27
29
27
29
0
p03003
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 // #define MOD 998244353 #define INF 1145141919810893364 typedef pair<int, int> PP; typedef long long ll; #define int ll #define setdouble setprecision #define REP(i, n) for (int i = 0; i < (n); ++i) #define OREP(i, n) for (int i = 1; i <= (n); ++i) #...
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 // #define MOD 998244353 #define INF 1145141919810893364 typedef pair<int, int> PP; typedef long long ll; #define int ll #define setdouble setprecision #define REP(i, n) for (int i = 0; i < (n); ++i) #define OREP(i, n) for (int i = 1; i <= (n); ++i) #...
replace
19
20
19
20
0
p03003
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #define MOD 1000000007 using namespace std; int s[1008], t[1008]; long long dp[1008][1008]; int n, m; int main() { memset(dp, 0, sizeof(dp)); int i, j; cin >> n >> m; for (i = 1; i <= n; i++) cin >> s[i]; for (i = 1; i <= m;...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #define MOD 1000000007 using namespace std; int s[2008], t[2008]; long long dp[2008][2008]; int n, m; int main() { memset(dp, 0, sizeof(dp)); int i, j; cin >> n >> m; for (i = 1; i <= n; i++) cin >> s[i]; for (i = 1; i <= m;...
replace
8
10
8
10
0
p03003
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int maxn = 2e3 + 10; const int MOD = 1e9 + 7; int a[maxn], b[maxn]; LL dp[maxn][maxn]; int main() { int n, m; scanf("%d%d", &n, &m); for (int i = 1; i <= n; i++) scanf("%d", &a[i]); for (int i = 1; i <= m; i++) scanf("%d", &b[i]);...
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int maxn = 2e3 + 10; const int MOD = 1e9 + 7; int a[maxn], b[maxn]; LL dp[maxn][maxn]; int main() { int n, m; scanf("%d%d", &n, &m); for (int i = 1; i <= n; i++) scanf("%d", &a[i]); for (int i = 1; i <= m; i++) scanf("%d", &b[i]);...
delete
26
27
26
26
-6
75db7b5d-3593-48a0-82c0-efaa3ed74ae6.out: /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03003/C++/s735334963.cpp:27: int main(): Assertion `dp[n][m] > MOD' failed.
p03003
C++
Runtime Error
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; #define int long long int constexpr int MOD = 1000000007; // 10 ** 9 + 7 constexpr int SIZE = 2010; int dp[SIZE][SIZE]; int sum[SIZE][SIZE]; void solve() { int N, M; cin >> N >> M; vector<int> s(N); for (auto ...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; #define int long long int constexpr int MOD = 1000000007; // 10 ** 9 + 7 constexpr int SIZE = 2010; int dp[SIZE][SIZE]; int sum[SIZE][SIZE]; void solve() { int N, M; cin >> N >> M; vector<int> s(N); for (auto ...
replace
42
43
42
43
0
p03003
Python
Time Limit Exceeded
N, M = map(int, input().split()) S = list(map(int, input().split())) T = list(map(int, input().split())) MOD = 10**9 + 7 dp = [[0] * (M + 2) for _ in range(N + 2)] sdp = [[0] * (M + 2) for _ in range(N + 2)] dp[0][0] = 1 sdp[1][1] = 1 for i in range(N + 1): for j in range(M + 1): if i - 1 >= 0 and j - 1 >= ...
# dp[i][j] SとTの最後の文字を採用するような文字列の個数。これにより各DPテーブルの値が排反になる。元の文字列の最後を必ず採用するので N, M = map(int, input().split()) S = list(map(int, input().split())) T = list(map(int, input().split())) MOD = 10**9 + 7 dp = [[0] * (M + 2) for _ in range(N + 2)] sdp = [[0] * (M + 2) for _ in range(N + 2)] dp[0][0] = 1 sdp[1][1] = 1 for i in ra...
insert
0
0
0
1
TLE
p03003
C++
Runtime Error
// // Created by keane on 19-6-16. // #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e3 + 50; const ll mod = 1e9 + 7; int n, m; int a[N], b[N]; ll dp[N][N]; int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= n; i++) { scanf("%d", &a[i]); } for (int i = 1; i <= m; i+...
// // Created by keane on 19-6-16. // #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 2e3 + 50; const ll mod = 1e9 + 7; int n, m; int a[N], b[N]; ll dp[N][N]; int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= n; i++) { scanf("%d", &a[i]); } for (int i = 1; i <= m; i+...
replace
6
7
6
7
0
p03003
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define reps(i, s, n) for (int(i) = (s); (i) < (n); (i)++) #define repr(i, n) for (int(i) = (n)-1; (i) >= 0; (i)--) #define all(v) (v).begin(), (v).end() #define chmax(a, b) a = (((a) < (b)) ? (b) : (a)) #define chmin(a,...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define reps(i, s, n) for (int(i) = (s); (i) < (n); (i)++) #define repr(i, n) for (int(i) = (n)-1; (i) >= 0; (i)--) #define all(v) (v).begin(), (v).end() #define chmax(a, b) a = (((a) < (b)) ? (b) : (a)) #define chmin(a,...
replace
27
28
27
28
0
p03003
C++
Time Limit Exceeded
#include <algorithm> #include <array> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <deque> #include <fstream> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define REP(i, n) for (int i = 0...
#include <algorithm> #include <array> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <deque> #include <fstream> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define REP(i, n) for (int i = 0...
replace
71
76
71
78
TLE
p03003
C++
Runtime Error
#include <algorithm> #include <iomanip> #include <iostream> #include <random> #include <vector> using namespace std; typedef long long int ll; ll mod = 1e9 + 7; ll dp[2010][2010], sum[2010][2010]; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n, m; cin >> n >> m; vector<int> s(n), t(n); ...
#include <algorithm> #include <iomanip> #include <iostream> #include <random> #include <vector> using namespace std; typedef long long int ll; ll mod = 1e9 + 7; ll dp[2010][2010], sum[2010][2010]; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n, m; cin >> n >> m; vector<int> s(n), t(m); ...
replace
16
17
16
17
0
p03003
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <vector> using namespace std; typedef long long ll; ll inf = 1e9 + 7; ll n, m, s[2020], t[2020]; ll dp[2020][2020] = {}; vector<ll> s_list[100010], t_list[100010]; /* ll solve(int k, int l) { if (dp[k][l]) return dp[k][l]; if (k * l == 0) dp[k][l] = 1; el...
#include <algorithm> #include <iostream> #include <vector> using namespace std; typedef long long ll; ll inf = 1e9 + 7; ll n, m, s[2020], t[2020]; ll dp[2020][2020] = {}; vector<ll> s_list[100010], t_list[100010]; /* ll solve(int k, int l) { if (dp[k][l]) return dp[k][l]; if (k * l == 0) dp[k][l] = 1; el...
replace
42
46
42
46
TLE
p03003
C++
Runtime Error
#include <algorithm> #include <climits> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string> #include <vect...
#include <algorithm> #include <climits> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string> #include <vect...
replace
117
118
117
118
0
p03003
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> using std::cerr; using std::cin; using...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> using std::cerr; using std::cin; using...
insert
70
70
70
72
-11
p03003
C++
Runtime Error
#include <bits/stdc++.h> #define w cout #define e '\n' #define int long long #define all(v) (begin(v), end(v)) #define pb push_back using namespace std; const int N = 1e5 + 10, MOD = 1e9 + 7; int dd[N], temp[N]; signed main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, m; cin >> n >> m; int...
#include <bits/stdc++.h> #define w cout #define e '\n' #define int long long #define all(v) (begin(v), end(v)) #define pb push_back using namespace std; const int N = 1e5 + 10, MOD = 1e9 + 7; int dd[N], temp[N]; signed main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, m; cin >> n >> m; int...
replace
17
18
17
18
0