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
p02996
C++
Runtime Error
#include <bits/stdc++.h> #define LL long long #define MP make_pair #define PB push_back #define F first #define S second #define I insert #define bull bool #define Max(a, b) ((b < a) ? a : b) #define Min(a, b) ((a < b) ? a : b) const LL N = 100005, mod = 1000000007; using namespace std; LL n, m, i, j, k, l, r, t, an...
#include <bits/stdc++.h> #define LL long long #define MP make_pair #define PB push_back #define F first #define S second #define I insert #define bull bool #define Max(a, b) ((b < a) ? a : b) #define Min(a, b) ((a < b) ? a : b) const LL N = 200005, mod = 1000000007; using namespace std; LL n, m, i, j, k, l, r, t, an...
replace
11
12
11
12
0
p02996
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep2(i, s, n) for (int i = s; i < (n); ++i) #define sz(x) int(x.size()) typedef long long ll; using namespace std; /*******-c++14 don't include-*******/ template <typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b,...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep2(i, s, n) for (int i = s; i < (n); ++i) #define sz(x) int(x.size()) typedef long long ll; using namespace std; /*******-c++14 don't include-*******/ template <typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b,...
replace
28
29
28
29
0
p02996
C++
Runtime Error
#include <algorithm> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <set> #include <string> #include <tuple> #include <vector> using namespace std; typedef long long ll; constexpr ll MOD = 1000000007; // struct UnionFind { // vector<int> par; // UnionFind(...
#include <algorithm> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <set> #include <string> #include <tuple> #include <vector> using namespace std; typedef long long ll; constexpr ll MOD = 1000000007; // struct UnionFind { // vector<int> par; // UnionFind(...
replace
57
58
57
58
0
p02996
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; struct Task { long A, B; }; bool cmp(const Task &t1, const Task &t2) { if (t1.B < t2.B) { return true; } else if (t1.B > t2.B) { return false; } else { return t1.A >= t2.A; } } int main() { int N; cin >> N; vector<Task> tsk(N); long a, b; ...
#include <bits/stdc++.h> using namespace std; struct Task { long A, B; }; bool cmp(const Task &t1, const Task &t2) { if (t1.B < t2.B) { return true; } else if (t1.B > t2.B) { return false; } else { return t1.A > t2.A; } } int main() { int N; cin >> N; vector<Task> tsk(N); long a, b; ...
replace
14
15
14
15
0
p02996
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; vector<P> lis; for (int i = 0; i < N; i++) { ll a, b; cin >> a >> b; lis.push_back(P(b, a)); } sort(lis.begin(), lis.end()); ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; vector<P> lis; for (int i = 0; i < N; i++) { ll a, b; cin >> a >> b; lis.push_back(P(b, a)); } sort(lis.begin(), lis.end()); ...
replace
21
22
21
22
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 5) >= this->size() (which is 5)
p02996
C++
Runtime Error
#include <bits/stdc++.h> #define Rint register int using namespace std; typedef long long LL; typedef pair<int, int> pii; const int N = 100003; template <typename T> inline void read(T &x) { int ch = getchar(); x = 0; bool flag = false; while ((ch < '0' || ch > '9') && ch != '-') ch = getchar(); if (ch ==...
#include <bits/stdc++.h> #define Rint register int using namespace std; typedef long long LL; typedef pair<int, int> pii; const int N = 200003; template <typename T> inline void read(T &x) { int ch = getchar(); x = 0; bool flag = false; while ((ch < '0' || ch > '9') && ch != '-') ch = getchar(); if (ch ==...
replace
5
6
5
6
0
p02996
Python
Runtime Error
import sys input = sys.stdin.readline def main(): AB = [] n = int(input()) for i in range(n): a, b = map(int, input().split()) AB.append([a, b]) AB = sorted(AB, key=lambda x: (x[1], -x[0])) time = 0 for span, dead in zip(AB): time += span if time > dead: ...
import sys input = sys.stdin.readline def main(): AB = [] n = int(input()) for i in range(n): a, b = map(int, input().split()) AB.append([a, b]) AB = sorted(AB, key=lambda x: (x[1], -x[0])) time = 0 for span, dead in AB: time += span if time > dead: ...
replace
13
14
13
14
ValueError: not enough values to unpack (expected 2, got 1)
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02996/Python/s531558055.py", line 23, in <module> main() File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02996/Python/s531558055.py", line 13, in main for span, dead in zip(AB): Value...
p02996
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int lim = 1e5 + 5; pair<int, int> jobs[lim]; bool comp(const pair<int, int> &a, const pair<int, int> &b) { return a.second < b.second; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; for (int i = 0; i < n;...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int lim = 2e5 + 5; pair<int, int> jobs[lim]; bool comp(const pair<int, int> &a, const pair<int, int> &b) { return a.second < b.second; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; for (int i = 0; i < n;...
replace
3
4
3
4
0
p02996
C++
Runtime Error
#pragma GCC optimize(2) #pragma GCC optimize(3) #pragma GCC optimize(4) #include <bits/stdc++.h> using namespace std; #define y1 y11 #define fi first #define se second #define pi acos(-1.0) #define LL long long // #define mp make_pair #define pb push_back #define ls rt << 1, l, m #define rs rt << 1 | 1, m + 1, r #defin...
#pragma GCC optimize(2) #pragma GCC optimize(3) #pragma GCC optimize(4) #include <bits/stdc++.h> using namespace std; #define y1 y11 #define fi first #define se second #define pi acos(-1.0) #define LL long long // #define mp make_pair #define pb push_back #define ls rt << 1, l, m #define rs rt << 1 | 1, m + 1, r #defin...
replace
31
32
31
32
0
p02996
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = (a); i < (b); i++) #define rrep(i, a, b) for (int i = (a); i > (b); i--) #define sq(x) ((x) * (x)) #define bit(x) bitset<32>(x) #define vsort(v) sort(v.begin(), v.end()) #define rvsort(v) sort(v.begin(), v.end(), greater<llint>()) #define...
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = (a); i < (b); i++) #define rrep(i, a, b) for (int i = (a); i > (b); i--) #define sq(x) ((x) * (x)) #define bit(x) bitset<32>(x) #define vsort(v) sort(v.begin(), v.end()) #define rvsort(v) sort(v.begin(), v.end(), greater<llint>()) #define...
replace
66
79
66
67
TLE
p02996
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; long long n, num; pair<int, int> p[100010]; int main() { cin >> n; for (int i = 0; i < n; i++) cin >> p[i].second >> p[i].first; sort(p, p + n); for (int i = 0; i < n;) { int j = i; while (p[i].first == p[j].first) num += p[j++].second; if (num...
#include <bits/stdc++.h> using namespace std; long long n, num; pair<int, int> p[200010]; int main() { cin >> n; for (int i = 0; i < n; i++) cin >> p[i].second >> p[i].first; sort(p, p + n); for (int i = 0; i < n;) { int j = i; while (p[i].first == p[j].first) num += p[j++].second; if (num...
replace
3
4
3
4
0
p02996
C++
Runtime Error
#include <algorithm> #include <iostream> #include <math.h> #include <vector> using namespace std; #define rep(i, m, n) for (int i = m; i < n; i++) #define ll long long #define MOD 1000000007 bool pair_comp_eq(pair<ll, ll> a, pair<ll, ll> b) { return a.second <= b.second; } int main(int argc, char *argv[]) { int ...
#include <algorithm> #include <iostream> #include <math.h> #include <vector> using namespace std; #define rep(i, m, n) for (int i = m; i < n; i++) #define ll long long #define MOD 1000000007 bool pair_comp_eq(pair<ll, ll> a, pair<ll, ll> b) { if (a.second == b.second) { return a.first <= b.first; } else { ...
replace
11
12
11
16
0
p02996
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; struct Pair { int A; int B; bool operator<(const Pair &X) const { return B == X.B ? A > X.A : B < X.B; } }; Pair X[100010]; int main() { int i; int N; long long iSum; ios::sync_with_stdio(false); cin.tie(0); cin >> N; for (i = 0; i < N; i++) { ...
#include <bits/stdc++.h> using namespace std; struct Pair { int A; int B; bool operator<(const Pair &X) const { return B == X.B ? A > X.A : B < X.B; } }; Pair X[200010]; int main() { int i; int N; long long iSum; ios::sync_with_stdio(false); cin.tie(0); cin >> N; for (i = 0; i < N; i++) { ...
replace
11
12
11
12
0
p02996
C++
Runtime Error
#ifndef LOCAL #pragma GCC optimize("Ofast") #endif #include <algorithm> #include <bitset> #include <cassert> #include <complex> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <unorde...
#ifndef LOCAL #pragma GCC optimize("Ofast") #endif #include <algorithm> #include <bitset> #include <cassert> #include <complex> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <unorde...
replace
253
254
253
254
0
p02996
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; pair<int, int> X[100100]; int main() { int N; cin >> N; for (int i = 0; i < N; i++) cin >> X[i].second >> X[i].first; sort(X, X + N); int Time = 0; for (int i = 0; i < N; i++) { Time += X[i].second; if (Time > X[i].first) { puts("No"); re...
#include <bits/stdc++.h> using namespace std; pair<int, int> X[200200]; int main() { int N; cin >> N; for (int i = 0; i < N; i++) cin >> X[i].second >> X[i].first; sort(X, X + N); int Time = 0; for (int i = 0; i < N; i++) { Time += X[i].second; if (Time > X[i].first) { puts("No"); re...
replace
2
3
2
3
0
p02996
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; bool compare(pair<long long, long long> a, pair<long long, long long> b) { return a.second < b.second; } int N; vector<pair<long long, long long>> v; int main() { cin >> N; for (int i = 0; i < N; ++i) cin >> v[i].first >> v[i...
#include <algorithm> #include <iostream> #include <vector> using namespace std; bool compare(pair<long long, long long> a, pair<long long, long long> b) { return a.second < b.second; } int N; vector<pair<long long, long long>> v; int main() { cin >> N; v.resize(N); for (int i = 0; i < N; ++i) cin >> v...
insert
15
15
15
17
-11
p02997
C++
Time Limit Exceeded
#include <bits/stdc++.h> const long long INF = 1LL << 60; const long long MOD = 1000000007; const double PI = acos(-1.0); #define rep(i, n) for (ll i = 0; i < (n); ++i) #define rep1(i, n) for (ll i = 1; i <= (n); ++i) #define rrep(i, n) for (ll i = (n - 1); i >= 0; --i) #define perm(c) ...
#include <bits/stdc++.h> const long long INF = 1LL << 60; const long long MOD = 1000000007; const double PI = acos(-1.0); #define rep(i, n) for (ll i = 0; i < (n); ++i) #define rep1(i, n) for (ll i = 1; i <= (n); ++i) #define rrep(i, n) for (ll i = (n - 1); i >= 0; --i) #define perm(c) ...
insert
143
143
143
145
TLE
p02997
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long int using namespace std; const ll mod = 1000000007; const ll inf = 1e18; int main() { ll n, k; cin >> n >> k; ll m = 0; vector<vector<ll>> v; if (k > (n - 2) * (n - 1) / 2) cout << -1 << endl; else { queue<vector<ll>> G; for (int i = 2; i < n; ...
#include <bits/stdc++.h> #define ll long long int using namespace std; const ll mod = 1000000007; const ll inf = 1e18; int main() { ll n, k; cin >> n >> k; ll m = 0; vector<vector<ll>> v; if (k > (n - 2) * (n - 1) / 2) cout << -1 << endl; else { queue<vector<ll>> G; for (int i = 2; i < n; ...
replace
21
22
21
22
0
p02997
C++
Runtime Error
#include <algorithm> #include <cstdio> using namespace std; const int MAXN = 105; int n, k, ans, t, la = 2; int ansn, Ans1[MAXN], Ans2[MAXN]; void Print() { printf("%d\n", ansn); for (int i = 1; i <= ansn; i++) printf("%d %d\n", Ans1[i], Ans2[i]); } int main() { scanf("%d%d", &n, &k); if ((n - 1) * (n - 2) ...
#include <algorithm> #include <cstdio> using namespace std; const int MAXN = 10005; int n, k, ans, t, la = 2; int ansn, Ans1[MAXN], Ans2[MAXN]; void Print() { printf("%d\n", ansn); for (int i = 1; i <= ansn; i++) printf("%d %d\n", Ans1[i], Ans2[i]); } int main() { scanf("%d%d", &n, &k); if ((n - 1) * (n - 2...
replace
3
4
3
4
0
p02997
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, m) for (long long i = 0; i < m; i++) #define per(i, m) for (long long i = m - 1; i >= 0; i--) #define FOR(i, n, m) for (long long i = n; i < m; i++) #define ROF(i, n, m) for (long long i = m - 1; i >= n; i--) #define SORT(v, n) ...
#include <bits/stdc++.h> #define rep(i, m) for (long long i = 0; i < m; i++) #define per(i, m) for (long long i = m - 1; i >= 0; i--) #define FOR(i, n, m) for (long long i = n; i < m; i++) #define ROF(i, n, m) for (long long i = m - 1; i >= n; i--) #define SORT(v, n) ...
replace
232
233
232
238
TLE
p02997
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long ll int b[200005]; ll int a[200005]; bool compare(const pair<ll int, int> p1, const pair<ll int, int> p2) { if (b[p1.second] == b[p2.second]) { return p1.first < p2.first; } return b[p1.second] < b[p2.second]; } i...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long ll int b[200005]; ll int a[200005]; bool compare(const pair<ll int, int> p1, const pair<ll int, int> p2) { if (b[p1.second] == b[p2.second]) { return p1.first < p2.first; } return b[p1.second] < b[p2.second]; } i...
replace
33
34
33
34
TLE
p02997
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, a) for (int(i) = 0; (i) < (a); ++(i)) #define Rep(i, a, b) for (int(i) = (a); (i) < (b); ++(i)) #define ALLIN(v) rep(i, v.size()) cin >> v[i] #define all(v) (v).begin(), (v).end() #define bet(a, x, b) a <= x &&x < b #define fi first #define se second using namespace std; using l...
#include <bits/stdc++.h> #define rep(i, a) for (int(i) = 0; (i) < (a); ++(i)) #define Rep(i, a, b) for (int(i) = (a); (i) < (b); ++(i)) #define ALLIN(v) rep(i, v.size()) cin >> v[i] #define all(v) (v).begin(), (v).end() #define bet(a, x, b) a <= x &&x < b #define fi first #define se second using namespace std; using l...
replace
42
43
42
43
TLE
p02997
C++
Time Limit Exceeded
// include //------------------------------------------ #include <bits/stdc++.h> using namespace std; // typedef //------------------------------------------ typedef long long LL; typedef vector<LL> VL; typedef vector<VL> VVL; typedef vector<string> VS; typedef pair<LL, LL> PLL; // container util //------------------...
// include //------------------------------------------ #include <bits/stdc++.h> using namespace std; // typedef //------------------------------------------ typedef long long LL; typedef vector<LL> VL; typedef vector<VL> VVL; typedef vector<string> VS; typedef pair<LL, LL> PLL; // container util //------------------...
insert
91
91
91
94
TLE
p02997
C++
Runtime Error
#include <algorithm> #include <climits> #include <complex> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> // using using namespace std; // typedef typedef long long ll; // define #define FOR(i, a, b, c) for (int i = (int)(a); i < (int)(b); i += (int)(c)) #defi...
#include <algorithm> #include <climits> #include <complex> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> // using using namespace std; // typedef typedef long long ll; // define #define FOR(i, a, b, c) for (int i = (int)(a); i < (int)(b); i += (int)(c)) #defi...
replace
104
106
104
106
-11
p02997
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; // types typedef long long ll; typedef long double ld; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<ld, ld> pdd; typedef vector<ll> vll; // macros #define ALL(a) a.begin(), a.end() #define SZ(a) ((int)a.size()) #define FI first #define SE second #def...
#include <bits/stdc++.h> using namespace std; // types typedef long long ll; typedef long double ld; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<ld, ld> pdd; typedef vector<ll> vll; // macros #define ALL(a) a.begin(), a.end() #define SZ(a) ((int)a.size()) #define FI first #define SE second #def...
replace
57
58
57
58
0
p02997
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define F first #define S second #define pii pair<int, int> #define eb emplace_back #define all(v) v.begin(), v.end() #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep3(i, l, n) for (int i = l; i < (n); ++i) #define sz(v) (int)v.size() const ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define F first #define S second #define pii pair<int, int> #define eb emplace_back #define all(v) v.begin(), v.end() #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep3(i, l, n) for (int i = l; i < (n); ++i) #define sz(v) (int)v.size() const ...
replace
92
93
92
93
0
p02997
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "debug.h" #else #define dump(...) #endif #define endl "\n" #define ll long long #define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define REP(i, x) for (int i = 0; i < (int)(x); i++) #define REPS(i, x) for (int i = 1; i <= (int)(x); i++) #...
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "debug.h" #else #define dump(...) #endif #define endl "\n" #define ll long long #define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define REP(i, x) for (int i = 0; i < (int)(x); i++) #define REPS(i, x) for (int i = 1; i <= (int)(x); i++) #...
replace
48
49
48
49
1
p02997
C++
Time Limit Exceeded
#include "bits/stdc++.h" int main() { int N, K; std::cin >> N >> K; int max = N * (N - 1) / 2 - (N - 1); int ans = -1; if (max < K) { std::cout << -1 << std::endl; return 0; } int M = N - 1 + max - K; std::cout << M << std::endl; for (int i = 2; i <= N; ++i) std::cout << 1 << " " << i <<...
#include "bits/stdc++.h" int main() { int N, K; std::cin >> N >> K; int max = N * (N - 1) / 2 - (N - 1); int ans = -1; if (max < K) { std::cout << -1 << std::endl; return 0; } int M = N - 1 + max - K; std::cout << M << std::endl; for (int i = 2; i <= N; ++i) std::cout << 1 << " " << i <<...
replace
16
21
16
19
TLE
p02997
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fast_cin() \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define MAX...
#include <bits/stdc++.h> using namespace std; #define fast_cin() \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define MAX...
replace
54
58
54
58
0
p02997
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>; #define chmax(x, y) x = max(x, y); int main() { int n, k; cin >> n >> k; int mx = (n - 1) * (n - 2) / 2; if (mx < k) { cout << -1 << endl; return 0; } vector...
#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>; #define chmax(x, y) x = max(x, y); int main() { int n, k; cin >> n >> k; int mx = (n - 1) * (n - 2) / 2; if (mx < k) { cout << -1 << endl; return 0; } vector...
replace
19
20
19
20
-11
p02997
Python
Runtime Error
from itertools import combinations n, k = map(int, input().split()) star = [] max_k = (n - 1) * (n - 2) // 2 delta = max_k - k cnt = 0 if k <= max_k: ans = [] for i in range(2, n + 1): star.append((1, i)) cnt += 1 if delta > 0: kumiawase = list(combinations(range(2, n), 2)) ...
from itertools import combinations n, k = map(int, input().split()) star = [] max_k = (n - 1) * (n - 2) // 2 delta = max_k - k cnt = 0 if k <= max_k: ans = [] for i in range(2, n + 1): star.append((1, i)) cnt += 1 if delta > 0: kumiawase = list(combinations(range(2, n + 1), 2)) ...
replace
14
15
14
15
0
p02997
Python
Runtime Error
n, k = map(int, input().split()) if k <= (n - 1) * (n - 2) // 2: raise Exception else: print(-1)
n, k = map(int, input().split()) if k <= (n - 1) * (n - 2) // 2: g = [0] * (n * n) for i in range(n * n): u = i // n v = i % n if u < v: g[i] = 1 i = 0 for _ in range(k): while g[i] == 0 or i % n == n - 1: i += 1 g[i] = 0 cnt = sum(g...
replace
3
4
3
24
1
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02997/Python/s244694894.py", line 4, in <module> raise Exception Exception
p02997
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define INF 100000000 #define YJ 1145141919 #define INF_INT_MAX 2147483647 #define INF_LL 9223372036854775 #define INF_LL_MAX 9223372036854775807 #define EPS 1e-10 #define MOD 1000000007 #define MOD9 998244353 #define Pi acos(-1) #define LL long long #define ULL unsigned ...
#include <bits/stdc++.h> using namespace std; #define INF 100000000 #define YJ 1145141919 #define INF_INT_MAX 2147483647 #define INF_LL 9223372036854775 #define INF_LL_MAX 9223372036854775807 #define EPS 1e-10 #define MOD 1000000007 #define MOD9 998244353 #define Pi acos(-1) #define LL long long #define ULL unsigned ...
replace
29
30
29
30
0
p02997
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define int long long #define ll long long #define vi vector<int> #define vii vector<pair<int, int>> #define rep(i, a, b) for (int i = a; i < b; i++) #define repD(i, a, b) for (int i = a; i > b; i--) #define pb push_back #define pii pair<int, int> #define ff first #define ...
#include <bits/stdc++.h> using namespace std; #define int long long #define ll long long #define vi vector<int> #define vii vector<pair<int, int>> #define rep(i, a, b) for (int i = a; i < b; i++) #define repD(i, a, b) for (int i = a; i > b; i--) #define pb push_back #define pii pair<int, int> #define ff first #define ...
delete
44
46
44
44
TLE
p02997
C++
Runtime Error
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> #include <cmath> typedef long long ll; using namespace std; vector<int> arr; stack<int> st; queue<int> qu; queue<pair<int, int>> qu2; priority_queue<int> pq; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, n) for (int i = 1; i <= (int)(n); i++) typede...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> #include <cmath> typedef long long ll; using namespace std; vector<int> arr; stack<int> st; queue<int> qu; queue<pair<int, int>> qu2; priority_queue<int> pq; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, n) for (int i = 1; i <= (int)(n); i++) typede...
replace
38
39
38
39
0
p02997
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vll; typedef vector<vector<ll>> vvll; typedef vector<vector<vector<ll>>> vvvll; typedef vector<bool> vb; typedef vector<vector<bool>> vvb; typedef vector<vector<vector<bool>>> vvvb; typedef pair<ll, ll> pll; typedef vector<pll> vpll...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vll; typedef vector<vector<ll>> vvll; typedef vector<vector<vector<ll>>> vvvll; typedef vector<bool> vb; typedef vector<vector<bool>> vvb; typedef vector<vector<vector<bool>>> vvvb; typedef pair<ll, ll> pll; typedef vector<pll> vpll...
insert
119
119
119
120
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p02997
C++
Runtime Error
#include <bits/stdc++.h> #define REP(i, s, n) for (int i = s; i < n; ++i) #define rep(i, n) REP(i, 0, n) #define fst first #define snd second #define pb push_back #define ALL(x) x.begin(), x.end() #define EPS (1e-9) #define equals(a, b) (fabs((a) - (b)) < EPS) using namespace std; bool LT(double a, double b) { retur...
#include <bits/stdc++.h> #define REP(i, s, n) for (int i = s; i < n; ++i) #define rep(i, n) REP(i, 0, n) #define fst first #define snd second #define pb push_back #define ALL(x) x.begin(), x.end() #define EPS (1e-9) #define equals(a, b) (fabs((a) - (b)) < EPS) using namespace std; bool LT(double a, double b) { retur...
delete
80
81
80
80
0
p02997
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = 1; i < (n); ++i) #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() #define maxs(a, b) a = max(a, b) #define mins(a, b) a = min(a, b) using namespace std; typedef long long ll; typedef pa...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = 1; i < (n); ++i) #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() #define maxs(a, b) a = max(a, b) #define mins(a, b) a = min(a, b) using namespace std; typedef long long ll; typedef pa...
replace
27
28
27
28
-11
p02997
C++
Runtime Error
#include <iostream> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int main() { int n, k; cin >> n >> k; int num = (n - 1) * (n - 2); num /= 2; if (k > num) { cout << -1 << endl; return 0; } // 辺の数 int m = (n - 1) + (num - k); pair<int, int> p[m]; for (int i = 1; i <...
#include <iostream> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int main() { int n, k; cin >> n >> k; int num = (n - 1) * (n - 2); num /= 2; if (k > num) { cout << -1 << endl; return 0; } // 辺の数 int m = (n - 1) + (num - k); pair<int, int> p[m]; for (int i = 1; i <...
insert
26
26
26
33
0
p02997
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #pragma GCC target("avx2") #pragma GCC optimization("O3") #pragma GCC optimization("unroll-loops") #define TRACE #ifdef TRACE #define trace(...) __f(#__VA_ARGS__, __VA_ARGS__) template <typename Arg1> void __f(const char *name, Arg1 &&arg1) { cout << name << ": " << arg...
#include <bits/stdc++.h> using namespace std; #pragma GCC target("avx2") #pragma GCC optimization("O3") #pragma GCC optimization("unroll-loops") #define TRACE #ifdef TRACE #define trace(...) __f(#__VA_ARGS__, __VA_ARGS__) template <typename Arg1> void __f(const char *name, Arg1 &&arg1) { cout << name << ": " << arg...
delete
36
40
36
36
0
p02997
C++
Time Limit Exceeded
#pragma GCC optimize("O3") #include <bits/stdc++.h> #define endl "\n" #define sz(x) ((ll)(x).size()) #define pb push_back #define all(x) (x).begin(), (x).end() #define prt(x) cout << (x) #define prtl(x) cout << (x) << endl #define rep(i, a, b) for (ll i = a; i < b; i++) #define rrep(i, a, b) for (ll i = a; i > b; i--) ...
#pragma GCC optimize("O3") #include <bits/stdc++.h> #define endl "\n" #define sz(x) ((ll)(x).size()) #define pb push_back #define all(x) (x).begin(), (x).end() #define prt(x) cout << (x) #define prtl(x) cout << (x) << endl #define rep(i, a, b) for (ll i = a; i < b; i++) #define rrep(i, a, b) for (ll i = a; i > b; i--) ...
insert
36
36
36
49
TLE
p02997
Python
Runtime Error
N, K = map(int, input().split()) if K > (N - 1)(N - 2) // 2: print(-1) else: M = N * (N - 1) // 2 - K cnt = 0 ans = [] for i in range(N - 1): for j in range(i + 1, N): ans.append((i + 1, j + 1)) cnt += 1 if M == cnt: break else: ...
N, K = map(int, input().split()) if K > (N - 1) * (N - 2) // 2: print(-1) else: M = N * (N - 1) // 2 - K cnt = 0 ans = [] for i in range(N - 1): for j in range(i + 1, N): ans.append((i + 1, j + 1)) cnt += 1 if M == cnt: break else:...
replace
2
3
2
3
TypeError: 'int' object is not callable
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02997/Python/s559992185.py", line 3, in <module> if K > (N - 1)(N - 2) // 2: TypeError: 'int' object is not callable
p02997
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vec; typedef vector<vec> mat; typedef pair<ll, ll> pll; const ll mod = 1e9 + 7; // const ll mod=998244353; const ll inf = 5e18; int main() { ll n; cin >> n; ll k; cin >> k; ll lim = n * (n - 1) / 2 - (n - 1); cout << lim...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vec; typedef vector<vec> mat; typedef pair<ll, ll> pll; const ll mod = 1e9 + 7; // const ll mod=998244353; const ll inf = 5e18; int main() { ll n; cin >> n; ll k; cin >> k; ll lim = n * (n - 1) / 2 - (n - 1); if (lim < k...
insert
16
16
16
20
TLE
p02997
C++
Time Limit Exceeded
#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 int64_t LINF = 8931145141919364364, LMOD = 998244353; // const int dy[]={0,-1,0,1,1,-1,-1,1}; // const int dx[]={1,0,-1,0,1,1,-1,-1}; int ma...
#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 int64_t LINF = 8931145141919364364, LMOD = 998244353; // const int dy[]={0,-1,0,1,1,-1,-1,1}; // const int dx[]={1,0,-1,0,1,1,-1,-1}; int ma...
replace
24
25
24
25
TLE
p02997
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll N, K; cin >> N >> K; if (K > ((N - 1) * (N - 2)) / 2) return -1; vector<pair<int, int>> ret; for (int i = 2; i <= N; i++) { ret.push_back(make_pair(1, i)); } int cnt = ((N - 1) * (N - 2)) / 2 - K; for (int i = 2...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll N, K; cin >> N >> K; if (N == 2) { if (K == 0) cout << 1 << endl << 1 << ' ' << 2 << endl; else cout << -1 << endl; return 0; } if (K > ((N - 1) * (N - 2)) / 2) { cout << -1 << endl; return 0; ...
replace
7
9
7
19
0
p02997
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, n) for (int i = 0; i < int(n); i++) #define FOR(i, m, n) for (int i = int(m); i < int(n); i++) #define ALL(obj) (obj).begin(), (obj).end() #define VI vector<int> #define VLL vector<long long> #define VVI vector<vector<int>> #define VVLL...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, n) for (int i = 0; i < int(n); i++) #define FOR(i, m, n) for (int i = int(m); i < int(n); i++) #define ALL(obj) (obj).begin(), (obj).end() #define VI vector<int> #define VLL vector<long long> #define VVI vector<vector<int>> #define VVLL...
replace
47
48
47
71
-6
d03add5e-89f1-4bbc-8ed4-d282d8b838e2.out: /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02997/C++/s490993811.cpp:39: int main(): Assertion `n == 0' failed.
p02997
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, K; cin >> N >> K; int count = 0; vector<vector<int>> G(N); int m = (N - 2) * (N - 1) / 2; if (K > m) { cout << -1 << endl; return 0; } for (int i = 1; i < N; i++) G[0].push_back(i); int n = m - K; for (int i = 0; i < n;...
#include <bits/stdc++.h> using namespace std; int main() { int N, K; cin >> N >> K; int count = 0; vector<vector<int>> G(N); int m = (N - 2) * (N - 1) / 2; if (K > m) { cout << -1 << endl; return 0; } for (int i = 1; i < N; i++) G[0].push_back(i); int n = m - K; int cnt = 0; for (in...
replace
18
21
18
29
0
p02997
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long int #define M 1000000007 #define mod 998244353 #define mp(x, y) make_pair(x, y) #define pb(x) push_back(x) #define pi pair<ll, ll> using namespace std; const ll N = 250001; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n, k; c...
#include <bits/stdc++.h> #define ll long long int #define M 1000000007 #define mod 998244353 #define mp(x, y) make_pair(x, y) #define pb(x) push_back(x) #define pi pair<ll, ll> using namespace std; const ll N = 250001; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n, k; c...
delete
17
28
17
17
0
p02997
C++
Time Limit Exceeded
// need #include <algorithm> #include <iostream> // data structure #include <bitset> #include <complex> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> // #include <deque> #include <array> #include <unordered_map> #include <unordered_set> #include <...
// need #include <algorithm> #include <iostream> // data structure #include <bitset> #include <complex> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> // #include <deque> #include <array> #include <unordered_map> #include <unordered_set> #include <...
replace
233
234
233
234
TLE
p02998
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define ub upper_bound #define lb upper_bound #define mp make_pair #define F first #define S second #define FOR(i, a, b) for (int(i) = (a); (i) < (b); (i)++) #define REP(i, n) FOR(i, 0, n) #define ALL(a) (a).begin(), (a).end() #de...
#include <bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define ub upper_bound #define lb upper_bound #define mp make_pair #define F first #define S second #define FOR(i, a, b) for (int(i) = (a); (i) < (b); (i)++) #define REP(i, n) FOR(i, 0, n) #define ALL(a) (a).begin(), (a).end() #de...
replace
142
143
142
143
0
p02998
C++
Runtime Error
#include <algorithm> #include <functional> #include <iostream> #include <vector> using namespace std; int main() { int N; cin >> N; vector<int> X(N), Y(N); for (int i = 0; i < N; ++i) { cin >> X[i] >> Y[i]; } vector<int> gx = X, gy = Y; sort(gx.begin(), gx.end()); gx.erase(unique(gx.begin(), gx.end(...
#include <algorithm> #include <functional> #include <iostream> #include <vector> using namespace std; int main() { int N; cin >> N; vector<int> X(N), Y(N); for (int i = 0; i < N; ++i) { cin >> X[i] >> Y[i]; } vector<int> gx = X, gy = Y; sort(gx.begin(), gx.end()); gx.erase(unique(gx.begin(), gx.end(...
replace
22
24
22
24
0
p02998
C++
Runtime Error
#include <bits/stdc++.h> #include <random> using namespace std; typedef unsigned long long ull; typedef long long ll; typedef long double ld; #define int ll // #define int __int128 // #define ll __int128 typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<int> vi; typedef vector<vi> vvi; typedef vect...
#include <bits/stdc++.h> #include <random> using namespace std; typedef unsigned long long ull; typedef long long ll; typedef long double ld; #define int ll // #define int __int128 // #define ll __int128 typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<int> vi; typedef vector<vi> vvi; typedef vect...
insert
103
103
103
105
0
p02998
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int ll #define rep(i, n) for (int i = 0, i##_cond = (n); i < i##_cond; ++i) #define FOR(i, a, b) for (int i = (a), i##_cond = (b); i < i##_cond; ++i) using ll = long long; using vi = vector<int>; // rank無しなのでlog n class UnionFind { public: vi data; UnionFind(...
#include <bits/stdc++.h> using namespace std; #define int ll #define rep(i, n) for (int i = 0, i##_cond = (n); i < i##_cond; ++i) #define FOR(i, a, b) for (int i = (a), i##_cond = (b); i < i##_cond; ++i) using ll = long long; using vi = vector<int>; // rank無しなのでlog n class UnionFind { public: vi data; UnionFind(...
replace
46
47
46
47
0
p02998
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; class UnionFind { public: // parent node index if not root index // minus size of the tree if root index std::vector<int> data; UnionFind(int n) { data.resize(n, -1); } int find(int x) { if (data[x] < 0) { return x; } else { ...
#include <bits/stdc++.h> using namespace std; using ll = long long; class UnionFind { public: // parent node index if not root index // minus size of the tree if root index std::vector<int> data; UnionFind(int n) { data.resize(n, -1); } int find(int x) { if (data[x] < 0) { return x; } else { ...
replace
42
43
42
43
TLE
p02998
C++
Time Limit Exceeded
#include "bits/stdc++.h" using namespace std; #define ll long long int #define rep(i, n) for (int i = 0; i < n; i++) #define rrep(i, n) for (int i = n; i >= 0; i--) #define REP(i, s, t) for (int i = s; i <= t; i++) #define RREP(i, s, t) for (int i = s; i >= t; i--) #define dump(x) cerr << #x << " = " << (x) << endl; #d...
#include "bits/stdc++.h" using namespace std; #define ll long long int #define rep(i, n) for (int i = 0; i < n; i++) #define rrep(i, n) for (int i = n; i >= 0; i--) #define REP(i, s, t) for (int i = s; i <= t; i++) #define RREP(i, s, t) for (int i = s; i >= t; i--) #define dump(x) cerr << #x << " = " << (x) << endl; #d...
insert
25
25
25
26
TLE
p02998
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; scanf("%d", &n); int N = 101; vector<vector<int>> g(2 * N); rep(i, n) { int x, y; scanf("%d%d", &x, &y); x--, y--; g[x].push_back(y + N); g[y + N].push_back(x); } ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; (i) < (int)(n); (i)++) using namespace std; int main() { int n; scanf("%d", &n); int N = 101010; vector<vector<int>> g(2 * N); rep(i, n) { int x, y; scanf("%d%d", &x, &y); x--, y--; g[x].push_back(y + N); g[y + N].push_back(x); ...
replace
7
8
7
8
0
p02998
C++
Runtime Error
#include <algorithm> #include <iomanip> #include <iostream> #include <set> #include <string> #include <vector> using namespace std; const int V = 10005; vector<int> to[V * 2]; vector<int> cnt; vector<int> visited(V * 2); void dfs(int v) { if (visited[v]) return; visited[v] = true; cnt[v / V]++; for (a...
#include <algorithm> #include <iomanip> #include <iostream> #include <set> #include <string> #include <vector> using namespace std; const int V = 100005; vector<int> to[V * 2]; vector<int> cnt; vector<int> visited(V * 2); void dfs(int v) { if (visited[v]) return; visited[v] = true; cnt[v / V]++; for (...
replace
9
10
9
10
0
p02998
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using Graph = vector<vector<int64_t>>; static const int64_t MAX = 10; static vector<bool> seen(MAX * 2, false); pair<int64_t, int64_t> dfs(const Graph &g, int64_t v, bool isX = true) { if (seen[v]) return {0, 0}; seen[v] = true; pair<int64_t, int64_t> num = {0,...
#include <bits/stdc++.h> using namespace std; using Graph = vector<vector<int64_t>>; static const int64_t MAX = 1e5; static vector<bool> seen(MAX * 2, false); pair<int64_t, int64_t> dfs(const Graph &g, int64_t v, bool isX = true) { if (seen[v]) return {0, 0}; seen[v] = true; pair<int64_t, int64_t> num = {0...
replace
4
5
4
5
0
p02998
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; template <class T> using vt = vector<T>; template <class T> using vvt = vector<vt<T>>; template <class T> using ttt = tuple<T, T>; using tii = tuple<int, int>; using vi = vector<int>; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define pb push...
#include <bits/stdc++.h> using namespace std; using ll = long long; template <class T> using vt = vector<T>; template <class T> using vvt = vector<vt<T>>; template <class T> using ttt = tuple<T, T>; using tii = tuple<int, int>; using vi = vector<int>; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define pb push...
replace
67
68
67
68
0
p02998
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define MAXNUM 111 #define rep(i, s, t) for (int i = s; i < t; i++) #define pii pair<int, int> typedef long long ll; pii num[MAXNUM]; int dset[MAXNUM * 2], allx[MAXNUM], ally[MAXNUM], xsize, ysize; int ssizex[MAXNUM * 2], ssizey[MAXNUM * 2]; int fa(int a) { if (dset[a] !=...
#include <bits/stdc++.h> using namespace std; #define MAXNUM 111111 #define rep(i, s, t) for (int i = s; i < t; i++) #define pii pair<int, int> typedef long long ll; pii num[MAXNUM]; int dset[MAXNUM * 2], allx[MAXNUM], ally[MAXNUM], xsize, ysize; int ssizex[MAXNUM * 2], ssizey[MAXNUM * 2]; int fa(int a) { if (dset[a]...
replace
2
3
2
3
0
p02998
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<ll, ll> P; typedef pair<int, int> Pi; #define rep(i, n) for (ll i = 0; i < n; i++) #define FOR(i, a, b) for (ll i = a; i < b; i++) #define fi first #define se second #define endl "\n" template <typename T> inline b...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<ll, ll> P; typedef pair<int, int> Pi; #define rep(i, n) for (ll i = 0; i < n; i++) #define FOR(i, a, b) for (ll i = a; i < b; i++) #define fi first #define se second #define endl "\n" template <typename T> inline b...
replace
109
110
109
110
-11
p02998
C++
Runtime Error
// Author: πα #include <bits/stdc++.h> using namespace std; #define long int64_t const int N = 1e5 + 5; vector<int> g[N]; bool vis[N]; int cl, cr, ce; void dfs(int u) { if (vis[u]) return; vis[u] = 1; if (u < N) cl++, ce += g[u].size(); else cr++; for (auto v : g[u]) dfs(v); } int main() {...
// Author: πα #include <bits/stdc++.h> using namespace std; #define long int64_t const int N = 1e5 + 5; vector<int> g[N + N]; bool vis[N + N]; int cl, cr, ce; void dfs(int u) { if (vis[u]) return; vis[u] = 1; if (u < N) cl++, ce += g[u].size(); else cr++; for (auto v : g[u]) dfs(v); } int ...
replace
7
9
7
9
0
p02998
C++
Runtime Error
// template version 1.12 using namespace std; #include <bits/stdc++.h> #include <iostream> // varibable settings #define infile "../test/sample-1.in" #define int long long //{{{ const int INF = 1e18; const int MOD = 1e9 + 7; //}}} // define basic macro {{{ #define _overload3(_1, _2, _3, name, ...) name #define _rep(i...
// template version 1.12 using namespace std; #include <bits/stdc++.h> #include <iostream> // varibable settings #define infile "../test/sample-1.in" #define int long long //{{{ const int INF = 1e18; const int MOD = 1e9 + 7; //}}} // define basic macro {{{ #define _overload3(_1, _2, _3, name, ...) name #define _rep(i...
replace
87
88
87
88
0
p02998
C++
Runtime Error
#include <algorithm> #include <iostream> #include <map> #include <set> #include <stdlib.h> #include <string> #include <utility> #include <vector> #define llint long long using namespace std; typedef pair<llint, llint> P; struct UnionFind { int size; vector<int> parent; UnionFind() {} UnionFind(int size) { ...
#include <algorithm> #include <iostream> #include <map> #include <set> #include <stdlib.h> #include <string> #include <utility> #include <vector> #define llint long long using namespace std; typedef pair<llint, llint> P; struct UnionFind { int size; vector<int> parent; UnionFind() {} UnionFind(int size) { ...
replace
63
64
63
64
0
p02998
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define mem(arr, i) fill(arr, arr + sizeof(arr), i) #define MEM(arr, i) memset(arr, i, sizeof(arr)) #define Push push_back #define Pair make_pair #define ALL(x) (x).begin(), (x).end() #define X first #define Y second #define ACCEL ...
#include <bits/stdc++.h> using namespace std; #define mem(arr, i) fill(arr, arr + sizeof(arr), i) #define MEM(arr, i) memset(arr, i, sizeof(arr)) #define Push push_back #define Pair make_pair #define ALL(x) (x).begin(), (x).end() #define X first #define Y second #define ACCEL ...
replace
102
103
102
103
0
p02998
C++
Runtime Error
#include <algorithm> #include <iostream> #include <utility> #include <vector> using namespace std; using ll = long long int; constexpr int MAX = 10005; int n; vector<vector<int>> to(MAX * 2); vector<bool> visited(MAX * 2, false); vector<ll> cnt(2, 0); ll ret = 0; void dfs(int v) { if (visited[v]) return; visi...
#include <algorithm> #include <iostream> #include <utility> #include <vector> using namespace std; using ll = long long int; constexpr int MAX = 100005; int n; vector<vector<int>> to(MAX * 2); vector<bool> visited(MAX * 2, false); vector<ll> cnt(2, 0); ll ret = 0; void dfs(int v) { if (visited[v]) return; vis...
replace
6
7
6
7
0
p02998
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define reps(i, x, n) for (int i = x; i < (n); i++) #define rrep(i, n) for (int i = (n)-1; i >= 0; i--) #define all(X) (X).begin(), (X).end() #define X first #define Y second #define pb push_back #define eb emplace_back using namespace std; type...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define reps(i, x, n) for (int i = x; i < (n); i++) #define rrep(i, n) for (int i = (n)-1; i >= 0; i--) #define all(X) (X).begin(), (X).end() #define X first #define Y second #define pb push_back #define eb emplace_back using namespace std; type...
replace
108
109
108
109
0
p02998
C++
Runtime Error
#include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <algorithm> #include <string> #include <vector> using namespace std; typedef long long ll; const ll mod = 1000000007; class mint { public: ll x; mint(ll x = 0) : x(x % mod) {} mint &operator+=(const mint rhs) { x += rhs.x...
#include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <algorithm> #include <string> #include <vector> using namespace std; typedef long long ll; const ll mod = 1000000007; class mint { public: ll x; mint(ll x = 0) : x(x % mod) {} mint &operator+=(const mint rhs) { x += rhs.x...
replace
56
57
56
57
0
p02998
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll N; map<ll, vector<ll>> XY; // y, x map<ll, ll> YX; map<ll, ll> Par, Rank; // root x, (#x's, ys) map<ll, pair<ll, set<ll>>> Rect; ll R; ll find(ll x) { if (!Par.count(x)) return x; return Par[x] = find(Par[x]); } void merge(ll x, ll x2)...
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll N; map<ll, vector<ll>> XY; // y, x map<ll, ll> YX; map<ll, ll> Par, Rank; // root x, (#x's, ys) map<ll, pair<ll, set<ll>>> Rect; ll R; ll find(ll x) { if (!Par.count(x)) return x; return Par[x] = find(Par[x]); } void merge(ll x, ll x2)...
insert
25
25
25
27
0
p02998
C++
Runtime Error
#include <algorithm> #include <array> #include <assert.h> #include <bitset> #include <chrono> #include <cmath> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <memory> #include <queue> #include <random> #include <set> #include <stack> #include <s...
#include <algorithm> #include <array> #include <assert.h> #include <bitset> #include <chrono> #include <cmath> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <memory> #include <queue> #include <random> #include <set> #include <stack> #include <s...
replace
98
99
98
99
-11
p02998
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <tuple> #include ...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <tuple> #include ...
replace
57
58
57
58
0
p02998
C++
Time Limit Exceeded
#include "bits/stdc++.h" using namespace std; #define int long long #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, a, b) for (int i = (b - 1); i >= (a); i--) #define REP(i, n) for (int i = 0; i < (n); i++) #define RREP(i, n) for (int i = (n - 1); i >= 0; i--) #define REP1(i, n) for (int i = 1; i <...
#include "bits/stdc++.h" using namespace std; #define int long long #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, a, b) for (int i = (b - 1); i >= (a); i--) #define REP(i, n) for (int i = 0; i < (n); i++) #define RREP(i, n) for (int i = (n - 1); i >= 0; i--) #define REP1(i, n) for (int i = 1; i <...
replace
99
100
99
100
TLE
p02998
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int ll #define ll long long #define I32_MAX 2147483647 #define I64_MAX 9223372036854775807LL #define I64_MAX2 1223372036854775807LL #define INF I64_MAX2 #define MOD 1000000007 // #define MOD 998244353 #define MEM_SIZE 101010 #define DEBUG_OUT true #define ALL(x) (x)...
#include <bits/stdc++.h> using namespace std; #define int ll #define ll long long #define I32_MAX 2147483647 #define I64_MAX 9223372036854775807LL #define I64_MAX2 1223372036854775807LL #define INF I64_MAX2 #define MOD 1000000007 // #define MOD 998244353 #define MEM_SIZE 101010 #define DEBUG_OUT true #define ALL(x) (x)...
replace
53
54
53
54
0
p02998
C++
Runtime Error
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <unordered_map> #include <vector> #define ll long long #define ...
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <unordered_map> #include <vector> #define ll long long #define ...
replace
71
72
71
72
0
p02998
C++
Runtime Error
// #include <bits/stdc++.h> #include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <set> #include <string> #include <vector> using namespace std; #define ll long long #define debug(x) cerr << "\n" << #x << ": " << x << "\n" #define rep(i, n) for (int i = 0; i < (int)(n); ++...
// #include <bits/stdc++.h> #include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <set> #include <string> #include <vector> using namespace std; #define ll long long #define debug(x) cerr << "\n" << #x << ": " << x << "\n" #define rep(i, n) for (int i = 0; i < (int)(n); ++...
replace
39
40
39
40
0
p02998
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e5 + 5; int fa[N]; int n1[N], n2[N]; vector<int> edge[N]; int Find(int v) { return v == fa[v] ? v : fa[v] == Find(fa[v]); } int main() { ios::sync_with_stdio(false); cin.tie(0); int n, m = 0; cin >> n; for (int i = 0; i < ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e5 + 5; int fa[N]; int n1[N], n2[N]; vector<int> edge[N]; int Find(int v) { return v == fa[v] ? v : fa[v] = Find(fa[v]); } int main() { ios::sync_with_stdio(false); cin.tie(0); int n, m = 0; cin >> n; for (int i = 0; i < n...
replace
11
12
11
12
0
p02999
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 unsigned long long int ULL; #define PB push_back #define MP make_pair #define F first #define S second #define SZ(a) (int)(a.size()) #defin...
#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 unsigned long long int ULL; #define PB push_back #define MP make_pair #define F first #define S second #define SZ(a) (int)(a.size()) #defin...
replace
83
87
83
87
0
p02999
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define endl "\n...
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define endl "\n...
delete
51
57
51
51
0
p02999
C++
Runtime Error
#include <stdio.h> int main(void) { int x, a, result; scanf("%d %d", x, a); if (x < a) result = 0; else result = 10; printf("%d", result); return 0; }
#include <stdio.h> int main(void) { int x, a, result; scanf("%d %d", &x, &a); if (x < a) result = 0; else result = 10; printf("%d", result); return 0; }
replace
4
5
4
5
-11
p02999
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define ok() puts(ok ? "Yes" : "No"); using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> ii; typedef vector<vi> vvi; typedef vector<ii> vii; typedef vector<bool> vb; typedef vector<vb> vvb; typedef set<int> s...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define ok() puts(ok ? "Yes" : "No"); using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> ii; typedef vector<vi> vvi; typedef vector<ii> vii; typedef vector<bool> vb; typedef vector<vb> vvb; typedef set<int> s...
replace
24
25
24
28
0
p02999
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int X, A; cin >> X >> A; cout << X / A * 10 << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int X, A; cin >> X >> A; if (X < A) { cout << 0 << endl; } else { cout << 10 << endl; } }
replace
6
7
6
11
0
p02999
C++
Runtime Error
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; cout << ((int)(a / b) * 10) << endl; }
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; cout << (a >= b ? 10 : 0) << endl; }
replace
8
9
8
9
0
p02999
C++
Runtime Error
#include <stdio.h> int main(void) { int a, x; scanf("%d %d", a, x); if (x < a) { printf("0"); } else { printf("10"); } return 0; }
#include <stdio.h> int main(void) { int a, x; scanf("%d %d", &a, &x); if (x > a) { printf("0"); } else { printf("10"); } return 0; }
replace
3
5
3
5
-11
p02999
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main(void) { int X, A; cin >> X >> A; cout << ((X / A) ? 1 : 0) * 10 << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main(void) { int X, A; cin >> X >> A; if (X < A) cout << "0\n"; else cout << "10\n"; return 0; }
replace
7
8
7
12
0
p02999
C++
Runtime Error
#include <algorithm> #include <iomanip> #include <iostream> #include <math.h> #include <queue> #include <string> #include <vector> using namespace std; int main() { int x, a; cin >> x >> a; if (x / a == 0) { cout << 0 << endl; } else { cout << 10 << endl; } }
#include <algorithm> #include <iomanip> #include <iostream> #include <math.h> #include <queue> #include <string> #include <vector> using namespace std; int main() { int x, a; cin >> x >> a; if (a == 0) { cout << 10 << endl; } else if (x / a == 0) { cout << 0 << endl; } else { cout << 10 << endl; ...
replace
12
13
12
15
0
p02999
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vvi = vector<vi>; using vl = vector<ll>; using P = pair<int, int>; using PL = pair<ll, ll>; using vp = vector<P>; using vpl = vector<PL>; constexpr const int INF = 1 << 30, MOD = 1000000007; constexpr const ll LINF = 1ll <...
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vvi = vector<vi>; using vl = vector<ll>; using P = pair<int, int>; using PL = pair<ll, ll>; using vp = vector<P>; using vpl = vector<PL>; constexpr const int INF = 1 << 30, MOD = 1000000007; constexpr const ll LINF = 1ll <...
replace
124
125
124
125
0
p02999
C++
Runtime Error
#include <bits/stdc++.h> #define syosu(x) fixed << setprecision(x) using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> P; typedef pair<double, double> pdd; typedef pair<ll, ll> pll; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<double> vd; typedef vector<vd...
#include <bits/stdc++.h> #define syosu(x) fixed << setprecision(x) using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> P; typedef pair<double, double> pdd; typedef pair<ll, ll> pll; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<double> vd; typedef vector<vd...
replace
31
32
31
35
0
p02999
C++
Runtime Error
#include <iostream> using namespace std; int main(int argc, char *argv[]) { if (atoi(argv[1]) < atoi(argv[2])) { cout << 0; } else { cout << 10; } return 0; }
#include <iostream> using namespace std; int main(int argc, char *argv[]) { int x, a; cin >> x >> a; if (x < a) { cout << 0; } else { cout << 10; } return 0; }
replace
5
6
5
8
-11
p02999
C++
Runtime Error
#include <bits/stdc++.h> #define sz(c) int(c.size()) #define rep(i, a, b) for (int i = a; i < (b); ++i) #define per(i, a, b) for (int i = (b)-1; i >= (a); --i) using namespace std; using ll = long long; int main() { cin.tie(0); ios_base::sync_with_stdio(0); cout << fixed << setprecision(10); int x, a; cin >...
#include <bits/stdc++.h> #define sz(c) int(c.size()) #define rep(i, a, b) for (int i = a; i < (b); ++i) #define per(i, a, b) for (int i = (b)-1; i >= (a); --i) using namespace std; using ll = long long; int main() { cin.tie(0); ios_base::sync_with_stdio(0); cout << fixed << setprecision(10); int x, a; cin >...
replace
14
15
14
15
0
p02999
Python
Runtime Error
x, a = map(int, input()) if x < a: print("0") if x >= a: print("10")
x, a = map(int, input().split()) if x < a: print("0") if x >= a: print("10")
replace
0
1
0
1
ValueError: invalid literal for int() with base 10: ' '
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02999/Python/s299776695.py", line 1, in <module> x, a = map(int, input()) ValueError: invalid literal for int() with base 10: ' '
p02999
Python
Runtime Error
# -*- coding: utf-8 -*- x, a = int(input()), int(input()) if x < a: print("0") else: print("10")
# -*- coding: utf-8 -*- x, a = map(int, input().split()) if x < a: print("0") else: print("10")
replace
2
3
2
3
ValueError: invalid literal for int() with base 10: '3 5'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02999/Python/s027313793.py", line 3, in <module> x, a = int(input()), int(input()) ValueError: invalid literal for int() with base 10: '3 5'
p02999
Python
Runtime Error
X, A = int(input().split("")) if X < A: print(0) else: print(10)
X, A = map(int, input().split(" ")) if X < A: print(0) else: print(10)
replace
0
1
0
1
ValueError: empty separator
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02999/Python/s387668120.py", line 1, in <module> X, A = int(input().split('')) ValueError: empty separator
p02999
Python
Runtime Error
X, A = map(int, input()) if X < A: print(0) else: print(10)
X, A = map(int, input().split()) if X < A: print(0) else: print(10)
replace
0
1
0
1
ValueError: invalid literal for int() with base 10: ' '
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02999/Python/s897076551.py", line 1, in <module> X, A = map(int, input()) ValueError: invalid literal for int() with base 10: ' '
p02999
Python
Runtime Error
x, a = list(input()) print("100"[x >= a :: 2])
x, a = map(int, input().split()) print(int("100"[x < a :: 2]))
replace
0
2
0
2
ValueError: too many values to unpack (expected 2)
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02999/Python/s110286285.py", line 1, in <module> x, a = list(input()) ValueError: too many values to unpack (expected 2)
p02999
Python
Runtime Error
x, a = map(int, input()) if x < a: print(0) else: print(10)
# A Rounding x, a = map(int, input().split()) if x < a: print(0) else: print(10)
replace
0
1
0
3
ValueError: invalid literal for int() with base 10: ' '
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02999/Python/s947229710.py", line 1, in <module> x, a = map(int, input()) ValueError: invalid literal for int() with base 10: ' '
p02999
C++
Runtime Error
// --------------------<optimizations>-------------------- #pragma GCC optimize("O3") //(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\ #pragma comment(linker, "/stack:200000000") //(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)\ #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> using namespace std;...
// --------------------<optimizations>-------------------- #pragma GCC optimize("O3") //(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\ #pragma comment(linker, "/stack:200000000") //(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)\ #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> using namespace std;...
delete
65
70
65
65
0
p02999
Python
Runtime Error
x, a = map(int, input()) if x < a: print(0) else: print(10)
x, a = map(int, input().split()) if x < a: print(0) else: print(10)
replace
0
1
0
1
ValueError: invalid literal for int() with base 10: ' '
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02999/Python/s478583937.py", line 1, in <module> x, a = map(int, input()) ValueError: invalid literal for int() with base 10: ' '
p03000
C++
Runtime Error
#include <algorithm> #include <fstream> #include <iostream> #include <vector> using namespace std; typedef long long ll; int main(int argc, const char *argv[]) { cin.tie(0); ios::sync_with_stdio(false); ll n, x; cin >> n >> x; vector<ll> l(n); for (ll i = 0; i < n; i++) cin >> l[i]; vector<ll> d(...
#include <algorithm> #include <fstream> #include <iostream> #include <vector> using namespace std; typedef long long ll; int main(int argc, const char *argv[]) { cin.tie(0); ios::sync_with_stdio(false); ll n, x; cin >> n >> x; vector<ll> l(n); for (ll i = 0; i < n; i++) cin >> l[i]; vector<ll> d(...
replace
25
26
25
26
0
p03000
C++
Runtime Error
#include <bits/stdc++.h> #define REP(i, n) for (int(i) = 0; (i) < (n); (i)++) using namespace std; typedef long long ll; const ll mod = 1e9 + 7; int main() { cin.tie(0); ios::sync_with_stdio(false); int N, X; cin >> N >> X; vector<int> L(N); REP(i, N) cin >> L.at(i); int counter = 0; int l = 0; while...
#include <bits/stdc++.h> #define REP(i, n) for (int(i) = 0; (i) < (n); (i)++) using namespace std; typedef long long ll; const ll mod = 1e9 + 7; int main() { cin.tie(0); ios::sync_with_stdio(false); int N, X; cin >> N >> X; vector<int> L(N); REP(i, N) cin >> L.at(i); int counter = 0; int l = 0; while...
insert
16
16
16
20
0
p03000
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, X; cin >> N >> X; vector<int> D(N + 1); D.at(0) = 0; for (int i = 1; i <= N + 1; i++) { int L; cin >> L; int DN = D.at(i - 1) + L; if (DN > X) { cout << i << endl; break; } else if (i == N + 1) { cout <...
#include <bits/stdc++.h> using namespace std; int main() { int N, X; cin >> N >> X; vector<int> D(N + 2); D.at(0) = 0; for (int i = 1; i <= N + 1; i++) { int L; cin >> L; int DN = D.at(i - 1) + L; if (DN > X) { cout << i << endl; break; } else if (i == N + 1) { cout <...
replace
7
8
7
8
0