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
p03026
Python
Runtime Error
def inpl(): return list(map(int, input().split())) class UnionFind: def __init__(self, N): # par = parent self.par = [i for i in range(N)] self.N = N self.hop = {i: -1 for i in range(N)} self.adj = [[] for i in range(N)] return def root(self, x): if...
import sys sys.setrecursionlimit(110000) def inpl(): return list(map(int, input().split())) class UnionFind: def __init__(self, N): # par = parent self.par = [i for i in range(N)] self.N = N self.hop = {i: -1 for i in range(N)} self.adj = [[] for i in range(N)] ...
insert
0
0
0
5
0
p03026
C++
Time Limit Exceeded
/*********************************************************** *This code By @1353055672(Ligen) * *[Warning]You're not excepted to understand this code! * *STOI GDOI APIO CTS NOIP 2019 RP++ * ***********************************************************/ // #pragma GCC...
/*********************************************************** *This code By @1353055672(Ligen) * *[Warning]You're not excepted to understand this code! * *STOI GDOI APIO CTS NOIP 2019 RP++ * ***********************************************************/ // #pragma GCC...
insert
132
132
132
133
TLE
p03026
C++
Time Limit Exceeded
// Copyright lzt #include <algorithm> #include <cmath> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <queue> #include <set> #include <stdio.h> #include <string> #include <vector> using namespace std; typedef long long ll; typedef std::pair<int, int> pii; typedef long...
// Copyright lzt #include <algorithm> #include <cmath> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <queue> #include <set> #include <stdio.h> #include <string> #include <vector> using namespace std; typedef long long ll; typedef std::pair<int, int> pii; typedef long...
replace
68
69
68
69
TLE
p03026
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long #define double long double #define fo(a, b) for (int a = 0; a < b; a++) #define Sort(a) sort(a.begin(), a.end()) #define rev(a) reverse(a.begin(), a.end()) #define fi first #define se second #define sz size() #define bgn begin() #define en end() #defin...
#include <bits/stdc++.h> using namespace std; #define int long long #define double long double #define fo(a, b) for (int a = 0; a < b; a++) #define Sort(a) sort(a.begin(), a.end()) #define rev(a) reverse(a.begin(), a.end()) #define fi first #define se second #define sz size() #define bgn begin() #define en end() #defin...
replace
374
375
374
375
0
p03026
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; #define int long long typedef vector<int> VI; // typedef pair<int, int> pii; #define fore(i, a) for (auto &i : a) #def...
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; #define int long long typedef vector<int> VI; // typedef pair<int, int> pii; #define fore(i, a) for (auto &i : a) #def...
replace
60
61
60
62
TLE
p03026
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { // # of Nodes int N; cin >> N; // Links to connect node a & b vector<vector<int>> ab(N + 1, vector<int>(0)); for (int i = 1; i < N; i++) { int a, b; cin >> a; cin >> b; if (a > b) swap(a, b); ab.at(a).push_back(b); } /...
#include <bits/stdc++.h> using namespace std; int main() { // # of Nodes int N; cin >> N; // Links to connect node a & b vector<vector<int>> ab(N + 1, vector<int>(0)); for (int i = 1; i < N; i++) { int a, b; cin >> a; cin >> b; ab.at(a).push_back(b); swap(a, b); ab.at(a).push_back(b...
replace
13
15
13
15
0
p03026
C++
Runtime Error
#include <bits/stdc++.h> #define int long long int using namespace std; vector<vector<int>> v; int n; int vis[1005] = {0}; int ans[1005] = {0}; int cnt; void dfs(int i, int a[]) { vis[i] = 1; ans[i] = a[cnt]; cnt--; for (auto j : v[i]) { if (vis[j] == 0) dfs(j, a); } } signed main() { cin >> n; ...
#include <bits/stdc++.h> #define int long long int using namespace std; vector<vector<int>> v; int n; int vis[10005] = {0}; int ans[10005] = {0}; int cnt; void dfs(int i, int a[]) { vis[i] = 1; ans[i] = a[cnt]; cnt--; for (auto j : v[i]) { if (vis[j] == 0) dfs(j, a); } } signed main() { cin >> n...
replace
5
7
5
7
0
p03026
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i <= (n); i++) #define co(x) cout << (x) << "\n" #define cosp(x) cout << (x) << " " #define ce(x) cerr << (x) << "\n" #define cesp(x) cerr << (x) << " " #define pb push_...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i <= (n); i++) #define co(x) cout << (x) << "\n" #define cosp(x) cout << (x) << " " #define ce(x) cerr << (x) << "\n" #define cesp(x) cerr << (x) << " " #define pb push_...
replace
17
18
17
18
0
p03026
C++
Memory Limit Exceeded
#include <algorithm> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define ll int64_t #define Rep(i, n) for (ll i = 0; i < n; i++) using namespace std; vector<vector<ll>> graph; vector<ll...
#include <algorithm> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define ll int #define Rep(i, n) for (ll i = 0; i < n; i++) using namespace std; vector<vector<ll>> graph; vector<ll> de...
replace
12
13
12
13
MLE
p03026
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define F first #define S second #define R cin >> #define Z class #define ll long long #define ln cout << '\n' #define in(a) insert(a) #define pb(a) push_back(a) #define pd(a) printf("%.10f\n", a) #define mem(a) memset(a, 0, sizeof(a)) #define all(c) (c).begin(), (c).end() ...
#include <bits/stdc++.h> using namespace std; #define F first #define S second #define R cin >> #define Z class #define ll long long #define ln cout << '\n' #define in(a) insert(a) #define pb(a) push_back(a) #define pd(a) printf("%.10f\n", a) #define mem(a) memset(a, 0, sizeof(a)) #define all(c) (c).begin(), (c).end() ...
replace
73
74
73
75
-11
p03027
C++
Runtime Error
#include <bits/stdc++.h> #define FOR(i, k, n) for (int i = (k); i < (n); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) begin(x), end(x) using namespace std; using vecint = vector<int>; using ll = int64_t; constexpr ll MOD = 1000003; // a^-1 mod p ll inv(ll a, ll p) { return (a == 1 ? 1 : (1 - p * inv(p % a, a)) ...
#include <bits/stdc++.h> #define FOR(i, k, n) for (int i = (k); i < (n); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) begin(x), end(x) using namespace std; using vecint = vector<int>; using ll = int64_t; constexpr ll MOD = 1000003; // a^-1 mod p ll inv(ll a, ll p) { return (a == 1 ? 1 : (1 - p * inv(p % a, a)) ...
insert
38
38
38
40
0
p03027
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; // #define int ll using PII = pair<ll, ll>; #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) x.begin(), x.end() template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); } template ...
#include <bits/stdc++.h> using namespace std; using ll = long long; // #define int ll using PII = pair<ll, ll>; #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) x.begin(), x.end() template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); } template ...
replace
193
194
193
194
0
p03027
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> P; typedef pair<int, P> P1; typedef pair<P, P> P2; #define pu push #define pb push_back #define mp make_pair #define eps 1e-7 #define INF 1000000000 #define fi ...
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> P; typedef pair<int, P> P1; typedef pair<P, P> P2; #define pu push #define pb push_back #define mp make_pair #define eps 1e-7 #define INF 1000000000 #define fi ...
replace
67
68
67
68
-11
p03027
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define start...
#include <bits/stdc++.h> using namespace std; #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define start...
replace
69
73
69
83
0
p03027
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #define MOD 1000003 using namespace std; typedef long long ll; template <typename Tp> inline void getint(Tp &num) { register int ch, neg = 0; while (!isdigit(ch = getchar())) if (ch == '-') n...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #define MOD 1000003 using namespace std; typedef long long ll; template <typename Tp> inline void getint(Tp &num) { register int ch, neg = 0; while (!isdigit(ch = getchar())) if (ch == '-') n...
replace
43
47
43
53
0
p03027
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define mp make_pair #define pb push_back #define all(x) (x).begin(), (x).end() #define YES() printf("YES\n") #define NO() printf("NO\n") #define Yes() printf("Yes\n") #define No() printf("No\n") #define in(x, y, h, w) x >= 0 && x < h &&y >= 0 && y < w #define int long lon...
#include <bits/stdc++.h> using namespace std; #define mp make_pair #define pb push_back #define all(x) (x).begin(), (x).end() #define YES() printf("YES\n") #define NO() printf("NO\n") #define Yes() printf("Yes\n") #define No() printf("No\n") #define in(x, y, h, w) x >= 0 && x < h &&y >= 0 && y < w #define int long lon...
replace
80
83
80
88
0
p03027
C++
Runtime Error
#include <bits/stdc++.h> #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 fore(i, a) for (auto &i : a) // #define all(x) (x).begin(),(x).end() // #pragma GCC optimize ("-O3") using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(f...
#include <bits/stdc++.h> #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 fore(i, a) for (auto &i : a) // #define all(x) (x).begin(),(x).end() // #pragma GCC optimize ("-O3") using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(f...
replace
86
95
86
87
-11
p03027
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdint> #include <cstdio> #include <ctime> #include <deque> #include <float.h> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <math.h> #include <numeric> #include <queue> #include...
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdint> #include <cstdio> #include <ctime> #include <deque> #include <float.h> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <math.h> #include <numeric> #include <queue> #include...
insert
280
280
280
288
0
p03027
C++
Runtime Error
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; struct __INIT { __INIT() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(15); } } __init; #define max3(a, b, c) max(a, max(b, c)) #define min3(a, b, c) min(a, min(b, c)) #define MOD 1000003 #define INF (...
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; struct __INIT { __INIT() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(15); } } __init; #define max3(a, b, c) max(a, max(b, c)) #define min3(a, b, c) min(a, min(b, c)) #define MOD 1000003 #define INF (...
replace
60
62
60
65
0
p03027
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef vector<int> VI; typedef pair<int, int> ii; typedef long long LL; #define pb push_back const int INF = 2147483647; const int MOD = 1000003; int pot[MOD + 5], z, x, d, n, licz, mian, r; // rozwiązuje równanie ax=1(%MOD), gdy MOD pierwsze int inverse(int a, int n = M...
#include <bits/stdc++.h> using namespace std; typedef vector<int> VI; typedef pair<int, int> ii; typedef long long LL; #define pb push_back const int INF = 2147483647; const int MOD = 1000003; int pot[MOD + 5], z, x, d, n, licz, mian, r; // rozwiązuje równanie ax=1(%MOD), gdy MOD pierwsze int inverse(int a, int n = M...
replace
54
56
54
56
0
p03027
C++
Runtime Error
// --------------------------------------------------<TEMPLATE>-------------------------------------------------- // --------------------<optimizations>-------------------- #pragma GCC optimize("O3") //(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\ #pragma comment(linker, "/stack:200000000") //(UNCOMMENT WHEN TRYING TO BR...
// --------------------------------------------------<TEMPLATE>-------------------------------------------------- // --------------------<optimizations>-------------------- #pragma GCC optimize("O3") //(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\ #pragma comment(linker, "/stack:200000000") //(UNCOMMENT WHEN TRYING TO BR...
replace
266
267
266
268
0
p03027
C++
Runtime Error
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #ifdef ONLINE_JUDGE #define LLD "%I64d" #else #define LLD "%lld" #endif #define fu(a, b, c) for (int a = b; a <= (int)c; ++a) #define fd(a, b, c) for (int a = b; a >= (int)c; --a) #define cu(a, b, c) for (int a = b; a...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #ifdef ONLINE_JUDGE #define LLD "%I64d" #else #define LLD "%lld" #endif #define fu(a, b, c) for (int a = b; a <= (int)c; ++a) #define fd(a, b, c) for (int a = b; a >= (int)c; --a) #define cu(a, b, c) for (int a = b; a...
replace
86
91
86
97
0
p03027
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <ctime> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef pair<int, int> P; typedef long long ll; const int mod = 1000003; /* class UnionF...
#include <algorithm> #include <cmath> #include <cstdio> #include <ctime> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef pair<int, int> P; typedef long long ll; const int mod = 1000003; /* class UnionF...
insert
97
97
97
101
0
p03027
C++
Runtime Error
#include <bits/stdc++.h> // using namespace std; #pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #define rep(i, j, n) for (ll i = (ll)(j); i < (ll)(n); i++) #define REP(i, j, n) for (ll i = (ll)(j); i...
#include <bits/stdc++.h> // using namespace std; #pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #define rep(i, j, n) for (ll i = (ll)(j); i < (ll)(n); i++) #define REP(i, j, n) for (ll i = (ll)(j); i...
insert
294
294
294
295
0
p03027
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long using namespace std; vector<ll> fct, invfct; ll mod_pow(ll n, ll p, ll mod) { // 繰り返し二乗法で (n^p) % mod を求める if (p == 0) return 1; ll res = mod_pow(n * n % mod, p / 2, mod); if (p % 2 == 1) res = res * n % mod; return res; } ll calc(ll x, ll n, ll mod) { ...
#include <bits/stdc++.h> #define ll long long using namespace std; vector<ll> fct, invfct; ll mod_pow(ll n, ll p, ll mod) { // 繰り返し二乗法で (n^p) % mod を求める if (p == 0) return 1; ll res = mod_pow(n * n % mod, p / 2, mod); if (p % 2 == 1) res = res * n % mod; return res; } ll calc(ll x, ll n, ll mod) { ...
replace
33
34
33
34
-11
p03027
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; #define REP(i, n) for (ll i = 0; i < n; i++) #define REP1(i, n) for (ll i = 1; i < n; i++) #define REPR(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, m, n) for (ll i = m; i < n; i++) #define VSORT(v) sort(v.begin(), v.end()) #define VRSORT(v) sort(v.rbegin(), v.ren...
#include "bits/stdc++.h" using namespace std; #define REP(i, n) for (ll i = 0; i < n; i++) #define REP1(i, n) for (ll i = 1; i < n; i++) #define REPR(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, m, n) for (ll i = m; i < n; i++) #define VSORT(v) sort(v.begin(), v.end()) #define VRSORT(v) sort(v.rbegin(), v.ren...
insert
162
162
162
166
0
p03027
C++
Runtime Error
#include <algorithm> #include <iostream> #include <math.h> #include <vector> using namespace std; typedef long long ll; ll inf = 1000003; ll pw(ll x, ll y) { if (y == 0) return 1; else if (y == 1) return x % inf; else if (y % 2 == 0) return pw(x, y / 2) * pw(x, y / 2) % inf; else return pw(x, ...
#include <algorithm> #include <iostream> #include <math.h> #include <vector> using namespace std; typedef long long ll; ll inf = 1000003; ll pw(ll x, ll y) { if (y == 0) return 1; else if (y == 1) return x % inf; else if (y % 2 == 0) return pw(x, y / 2) * pw(x, y / 2) % inf; else return pw(x, ...
replace
41
42
41
42
-11
p03027
C++
Runtime Error
#include <bits/stdc++.h> #define mod 1000003 #define fr first #define se second #define ll long long #define PI 3.1415926535 #define pb push_back #define mpr make_pair #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() #define senky_bansal ios_base::sync_with_stdio(false); #define IIIT_ALLAHABAD ...
#include <bits/stdc++.h> #define mod 1000003 #define fr first #define se second #define ll long long #define PI 3.1415926535 #define pb push_back #define mpr make_pair #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() #define senky_bansal ios_base::sync_with_stdio(false); #define IIIT_ALLAHABAD ...
delete
29
33
29
29
TLE
p03027
Python
Time Limit Exceeded
# https://atcoder.jp/contests/m-solutions2019/submissions/5741430 from operator import mul MOD = 10**6 + 3 def inv(n): return pow(n, MOD - 2, MOD) def mod_mul(x, y): return mul(x, y) % MOD fact = [1] for n in range(1, MOD): fact.append(mod_mul(fact[-1], n)) # d>1 の数列を d=1 となる数列に変換する # MODの倍数を...
# https://atcoder.jp/contests/m-solutions2019/submissions/5741430 from operator import mul import sys input = sys.stdin.readline MOD = 10**6 + 3 def inv(n): return pow(n, MOD - 2, MOD) def mod_mul(x, y): return mul(x, y) % MOD fact = [1] for n in range(1, MOD): fact.append(mod_mul(fact[-1], n)) ...
insert
2
2
2
5
TLE
p03027
C++
Runtime Error
/* -*- coding: utf-8 -*- * * e.cc: E - Product of Arithmetic Progression */ #include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> ...
/* -*- coding: utf-8 -*- * * e.cc: E - Product of Arithmetic Progression */ #include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> ...
replace
71
72
71
72
0
p03027
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) //~ #define MOD 1000000007 #define MOD 1000003 #define INF 0x3f3f3f3f #define INFL 0x3f3f3f3f3f3f3f3f using namespace std; typedef long long ll; typedef pair<int, int> P; ll ppow(ll a, ll b) { a %= MOD; ll res = 1; while (b) { if (b & 1...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) //~ #define MOD 1000000007 #define MOD 1000003 #define INF 0x3f3f3f3f #define INFL 0x3f3f3f3f3f3f3f3f using namespace std; typedef long long ll; typedef pair<int, int> P; ll ppow(ll a, ll b) { a %= MOD; ll res = 1; while (b) { if (b & 1...
replace
92
93
92
93
0
p03027
C++
Runtime Error
#include <algorithm> #include <iostream> #include <math.h> #include <queue> #include <stdlib.h> #include <string.h> #include <string> #include <vector> using namespace std; int mod = 1000003; ///////////// modの計算 long long mod_adjust(long long a) { // 余りをとる(0~mod-1に調整する) if (a > mod) { return a % mod; ...
#include <algorithm> #include <iostream> #include <math.h> #include <queue> #include <stdlib.h> #include <string.h> #include <string> #include <vector> using namespace std; int mod = 1000003; ///////////// modの計算 long long mod_adjust(long long a) { // 余りをとる(0~mod-1に調整する) if (a > mod) { return a % mod; ...
insert
133
133
133
134
0
p03027
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define int long long #define double long double #define mod 1000003 #define P pair<long long, long long> #define all(a) a.begin(), a.end() #define INF 10000000000000000 template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define int long long #define double long double #define mod 1000003 #define P pair<long long, long long> #define all(a) a.begin(), a.end() #define INF 10000000000000000 template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; ...
replace
57
61
57
61
0
p03027
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) > (b) ? (a) : (b)) #define REP(i, n) for (int i = 0; i < n; i++) #define FOR(i, n1, n2) for (int i = n1; i < n2; i++) #define speed_up \ ios_base...
#include <bits/stdc++.h> using namespace std; #define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) > (b) ? (a) : (b)) #define REP(i, n) for (int i = 0; i < n; i++) #define FOR(i, n1, n2) for (int i = n1; i < n2; i++) #define speed_up \ ios_base...
replace
67
70
67
71
0
p03027
C++
Runtime Error
#include <bits/stdc++.h> #define int long long #define ll long long using ull = unsigned long long; using namespace std; const int INF = 1ll << 50; const int MOD = 1000003; #define dump(x) \ if (dbg) { ...
#include <bits/stdc++.h> #define int long long #define ll long long using ull = unsigned long long; using namespace std; const int INF = 1ll << 50; const int MOD = 1000003; #define dump(x) \ if (dbg) { ...
insert
107
107
107
108
0
p03027
C++
Runtime Error
#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; using ll = long long; typedef pair<ll, ll> P; #define fi first #define se second #define all(v) (v).begin(), (v).end() const ll inf = (1e18); const ll mod = 1000003; // ios_base::sync_with_stdio(false); // cin.tie(NULL); ll gcd(ll a, ll b) { retur...
#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; using ll = long long; typedef pair<ll, ll> P; #define fi first #define se second #define all(v) (v).begin(), (v).end() const ll inf = (1e18); const ll mod = 1000003; // ios_base::sync_with_stdio(false); // cin.tie(NULL); ll gcd(ll a, ll b) { retur...
replace
88
93
88
92
0
p03027
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> pii; typedef pair<double, double> pdd; #define MEM(a, b) memset(a, (b), sizeof(a)) #define SZ(i) ll(i.size()) #define FOR(i, j, k, in) for (ll i = j; i < k; i += in) #define RFOR(i, j, k, in) for (ll i = j; i >= k; i -= in) #define...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> pii; typedef pair<double, double> pdd; #define MEM(a, b) memset(a, (b), sizeof(a)) #define SZ(i) ll(i.size()) #define FOR(i, j, k, in) for (ll i = j; i < k; i += in) #define RFOR(i, j, k, in) for (ll i = j; i >= k; i -= in) #define...
replace
99
100
99
106
0
p03027
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector<int> vi; typedef vector<ll> vl; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define REP(i, n) for (int i = 0; i < (n); ++i) #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define FORR(i,...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector<int> vi; typedef vector<ll> vl; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define REP(i, n) for (int i = 0; i < (n); ++i) #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define FORR(i,...
replace
316
317
316
317
0
p03027
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <limits.h> #include <list> #include <map> #include <numeric> #inclu...
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <limits.h> #include <list> #include <map> #include <numeric> #inclu...
replace
121
122
121
122
0
p03028
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define N 5 int n, ans; bitset<N> a[N], f[N], g[N]; char s[N][N]; int main() { scanf("%d", &n); for (int i = 2; i <= n; ++i) { scanf("%s", s[i] + 1); for (int j = 1; j < i; ++j) { a[i][j] = s[i][j] - '0'; a[j][i] = a[i][j] ^ 1; } } for (i...
#include <bits/stdc++.h> using namespace std; #define N 2005 int n, ans; bitset<N> a[N], f[N], g[N]; char s[N][N]; int main() { scanf("%d", &n); for (int i = 2; i <= n; ++i) { scanf("%s", s[i] + 1); for (int j = 1; j < i; ++j) { a[i][j] = s[i][j] - '0'; a[j][i] = a[i][j] ^ 1; } } for...
replace
4
5
4
5
0
p03028
C++
Runtime Error
#pragma GCC optimize(3) #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/priority_queue.hpp> #include <ext/pb_ds/tree_policy.hpp> #define MAXN 2005 #define INF 1000000000 #define MOD 1000000007 #define F first #define S second using namespace std; using namespace __gnu_pbds; typedef...
#pragma GCC optimize(3) #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/priority_queue.hpp> #include <ext/pb_ds/tree_policy.hpp> #define MAXN 2005 #define INF 1000000000 #define MOD 1000000007 #define F first #define S second using namespace std; using namespace __gnu_pbds; typedef...
replace
46
47
46
47
0
p03028
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cassert> #include <ciso646> #include <cmath> #include <complex> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <unordered_map> #in...
#include <algorithm> #include <bitset> #include <cassert> #include <ciso646> #include <cmath> #include <complex> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <unordered_map> #in...
replace
69
81
69
73
TLE
p03028
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) #define all(c) c.begin(), c.end() #define pb push_back #define fs first #define sc second #define chmin(x, y) x = min(x, y) #define chmax(x, y) x = max(x, y) using namespace std; template...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) #define all(c) c.begin(), c.end() #define pb push_back #define fs first #define sc second #define chmin(x, y) x = min(x, y) #define chmax(x, y) x = max(x, y) using namespace std; template...
replace
88
94
88
94
TLE
p03028
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x, to) for (x = 0; x < (to); x++) #define FORR(x, arr) for (auto &x : arr) #define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++) #define ALL(a) (a.begin()), ...
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x, to) for (x = 0; x < (to); x++) #define FORR(x, arr) for (auto &x : arr) #define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++) #define ALL(a) (a.begin()), ...
replace
36
41
36
40
TLE
p03028
C++
Time Limit Exceeded
#include <bits/stdc++.h> int main() { std::cin.tie(0); std::cin.sync_with_stdio(false); size_t n; std::cin >> n; constexpr size_t max = 2002; auto a = std::vector<std::bitset<max>>(n + 2); auto insert = [&](size_t i, size_t j, bool k) { a[i][j] = k; a[j][i] = !k; }; for (size_t i = 1; i <= n; ...
#include <bits/stdc++.h> int main() { std::cin.tie(0); std::cin.sync_with_stdio(false); size_t n; std::cin >> n; constexpr size_t max = 2002; auto a = std::vector<std::bitset<max>>(n + 2); auto insert = [&](size_t i, size_t j, bool k) { a[i][j] = k; a[j][i] = !k; }; for (size_t i = 1; i <= n; ...
replace
28
33
28
29
TLE
p03029
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define mod 1000000007 #define pll pair<long long, long long> #define pdd pair<long double, long double> #define mp make_pair #define pb push_back #define pf push_front priority_queue<pll, vector<pll>, greater<pll>> pq; priority_queue<ll, vector<ll>, g...
#include <bits/stdc++.h> using namespace std; #define ll long long #define mod 1000000007 #define pll pair<long long, long long> #define pdd pair<long double, long double> #define mp make_pair #define pb push_back #define pf push_front priority_queue<pll, vector<pll>, greater<pll>> pq; priority_queue<ll, vector<ll>, g...
replace
21
22
21
22
0
p03029
C++
Runtime Error
#include <iostream> int main(void) { int A, P; std::cin >> A >> P; P += 3 * A; return P / 2; }
#include <iostream> int main(void) { int A, P; std::cin >> A >> P; P += 3 * A; std::cout << P / 2; return 0; }
replace
6
7
6
8
3
p03029
C++
Runtime Error
#include <iostream> using namespace std; int main(void) { int apple = 0; int apple_block = 0; int apple_pie = 0; cin >> apple; cin >> apple_block; apple_pie = ((3 * apple) + apple_block) / 2; cout << apple_pie << endl; return apple_pie; }
#include <iostream> using namespace std; int main(void) { int apple = 0; int apple_block = 0; int apple_pie = 0; cin >> apple; cin >> apple_block; apple_pie = ((3 * apple) + apple_block) / 2; cout << apple_pie << endl; return 0; }
replace
16
17
16
17
3
p03029
C++
Runtime Error
#include <bits/stdc++.h> #include <ext/numeric> #define __ \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define pi aco...
#include <bits/stdc++.h> #include <ext/numeric> #define __ \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define pi aco...
replace
18
20
18
20
0
p03029
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; // typedefs typedef long long LL; typedef vector<int> VI; typedef vector<LL> VL; typedef vector<VI> VVI; typedef vector<VL> VVL; typedef pair<int, int> PII; typedef pair<double, double> PDD; typedef pair<LL, LL> PLL; typedef vector<PII> VII; typedef vector<PLL> VLL; // ...
#include <bits/stdc++.h> using namespace std; // typedefs typedef long long LL; typedef vector<int> VI; typedef vector<LL> VL; typedef vector<VI> VVI; typedef vector<VL> VVL; typedef pair<int, int> PII; typedef pair<double, double> PDD; typedef pair<LL, LL> PLL; typedef vector<PII> VII; typedef vector<PLL> VLL; // ...
replace
139
143
139
143
0
p03029
C++
Runtime Error
#include <iostream> int main() { int a, p; std::cin >> a >> p; std::cout << (a * 3 + p) / 2 << std::endl; return 1; }
#include <iostream> int main() { int a, p; std::cin >> a >> p; std::cout << (a * 3 + p) / 2 << std::endl; return 0; }
replace
7
8
7
8
1
p03029
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll MOD = 1e9 + 7; int main() { int A, P; cin >> A >> P; cout << 3 * A / P << endl; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll MOD = 1e9 + 7; int main() { int A, P; cin >> A >> P; cout << (3 * A + P) / 2 << endl; return 0; }
replace
9
10
9
10
0
p03029
C++
Runtime Error
#include <iostream> using namespace std; int main() { int a, b, c, d; cin >> a >> b; c = a * 3; d = c + b; cout << d % 0 << endl; }
#include <iostream> using namespace std; int main() { int a, b, c, d; cin >> a >> b; c = a * 3; d = c + b; cout << d / 2 << endl; }
replace
8
9
8
9
-8
p03029
C++
Runtime Error
#include <algorithm> #include <iostream> #include <math.h> #include <vector> using namespace std; typedef long long ll; int main(void) { int a, p; cin >> a >> p; cout << 3 * a / p << endl; }
#include <algorithm> #include <iostream> #include <math.h> #include <vector> using namespace std; typedef long long ll; int main(void) { int a, p; cin >> a >> p; cout << (3 * a + p) / 2 << endl; }
replace
10
11
10
11
0
p03029
C++
Runtime Error
#include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { int A = atoi(argv[1]); int P = atoi(argv[2]); printf("%d\n", ((3 * A) + P) / 2); return 0; }
#include <stdio.h> #include <stdlib.h> int main() { int A; int P; scanf("%d %d\n", &A, &P); int a = 3 * A + P; int b = (a - a % 2) / 2; printf("%d\n", b); return 0; }
replace
3
8
3
10
-11
p03029
Python
Runtime Error
A, P = map(int, input.split(" ")) print((3 * A + P) // 2)
A, P = map(int, input().split(" ")) print((3 * A + P) // 2)
replace
0
1
0
1
AttributeError: 'builtin_function_or_method' object has no attribute 'split'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03029/Python/s942506931.py", line 1, in <module> A, P = map(int, input.split(" ")) AttributeError: 'builtin_function_or_method' object has no attribute 'split'
p03029
Python
Runtime Error
a, p = map(int, input()) print((3 * a + p) // 2)
a, p = map(int, input().split()) print((3 * a + p) // 2)
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/p03029/Python/s938793340.py", line 1, in <module> a, p = map(int, input()) ValueError: invalid literal for int() with base 10: ' '
p03029
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(void) { int a, p; cin >> a >> p; cout << (3 * a) / p; return 0; }
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(void) { int a, p; cin >> a >> p; int kep = 3 * a + p; cout << kep / 2; return 0; }
replace
7
8
7
9
0
p03030
C++
Runtime Error
#include <algorithm> #include <iostream> #include <math.h> #include <string> #include <vector> using namespace std; int main() { string A[20], sub1; int B[20], sub2, C[20], N; int i, j; cin >> N; for (i = 0; i < N; i++) { cin >> A[i] >> B[i]; C[i] = i + 1; } for (i = 0; i < N - 1; i++) { for ...
#include <algorithm> #include <iostream> #include <math.h> #include <string> #include <vector> using namespace std; int main() { string A[100], sub1; int B[100], sub2, C[100], N; int i, j; cin >> N; for (i = 0; i < N; i++) { cin >> A[i] >> B[i]; C[i] = i + 1; } for (i = 0; i < N - 1; i++) { f...
replace
8
10
8
10
0
p03030
C++
Runtime Error
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <set> #include <string> #include <time.h> #include <vector> using namespace std; typedef long long ll; static const ll INF = (ll)1 << 62; static const ll MOD = 1e9 + 7; #define rep(i, s, n) for (ll i = s; i < n; i++) #define repe(i, s, n...
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <set> #include <string> #include <time.h> #include <vector> using namespace std; typedef long long ll; static const ll INF = (ll)1 << 62; static const ll MOD = 1e9 + 7; #define rep(i, s, n) for (ll i = s; i < n; i++) #define repe(i, s, n...
replace
19
22
19
21
0
p03030
C++
Runtime Error
#include <algorithm> #include <iostream> #include <numeric> #include <vector> using namespace std; int main() { int N; cin >> N; vector<pair<string, int>> Guide(N + 1); for (int i = 1; i <= N; i++) { string S; int P; cin >> S >> P; Guide[i] = {S, P}; } vector<int> Index(N); iota(Index.beg...
#include <algorithm> #include <iostream> #include <numeric> #include <vector> using namespace std; int main() { int N; cin >> N; vector<pair<string, int>> Guide(N + 1); for (int i = 1; i <= N; i++) { string S; int P; cin >> S >> P; Guide[i] = {S, P}; } vector<int> Index(N); iota(Index.beg...
replace
23
24
23
24
0
p03030
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...
replace
46
54
46
47
0
p03030
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { long long N; cin >> N; using col = tuple<string, long long, long long>; vector<col> p(N); for (int i = 0; i < N; i++) { string a; int b; cin >> a >> b; auto g = make_tuple(a, b, i); p.at(i) = g; } sort(p.begin(), p.end()); ...
#include <bits/stdc++.h> using namespace std; int main() { long long N; cin >> N; using col = tuple<string, long long, long long>; vector<col> p(N); for (int i = 0; i < N; i++) { string a; int b; cin >> a >> b; auto g = make_tuple(a, b, i); p.at(i) = g; } sort(p.begin(), p.end()); ...
insert
19
19
19
22
0
p03030
C++
Runtime Error
#include <bits/stdc++.h> typedef long long int ll; typedef unsigned long long int ull; typedef long double ld; typedef std::pair<int, int> pii; typedef std::pair<ll, ll> pll; typedef std::pair<double, double> pdd; using namespace std; #define fastio() \ i...
#include <bits/stdc++.h> typedef long long int ll; typedef unsigned long long int ull; typedef long double ld; typedef std::pair<int, int> pii; typedef std::pair<ll, ll> pll; typedef std::pair<double, double> pdd; using namespace std; #define fastio() \ i...
delete
40
47
40
40
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p03030
C++
Runtime Error
/** * Name: Ajay Subhash Jadhav * Institute: International Institute of Technology Hyderabad */ #include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <ctime> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string.h> #...
/** * Name: Ajay Subhash Jadhav * Institute: International Institute of Technology Hyderabad */ #include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <ctime> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string.h> #...
delete
55
56
55
55
0
p03030
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; struct info { string cn; int score, sn; bool operator<(const info &rhs) { if (cn != rhs.cn) return cn < rhs.cn; return score > rhs.score; } } cities[100]; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { cin >> cities[i].cn >> ...
#include <bits/stdc++.h> using namespace std; struct info { string cn; int score, sn; bool operator<(const info &rhs) { if (cn != rhs.cn) return cn < rhs.cn; return score > rhs.score; } } cities[103]; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { cin >> cities[i].cn >> ...
replace
12
13
12
13
0
p03030
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (long long i = 0; i < n; i++) #define REP1(i, n) for (long long i = 1; i <= n; i++) #define ITE(arr) for (auto ite = (arr).begin(); ite != (arr).end(); ite++) #define ALL(a) (a.begin()), (a.end()) #define ZERO(a) memset(a, 0, sizeof(a)) #define MINUS(a...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (long long i = 0; i < n; i++) #define REP1(i, n) for (long long i = 1; i <= n; i++) #define ITE(arr) for (auto ite = (arr).begin(); ite != (arr).end(); ite++) #define ALL(a) (a.begin()), (a.end()) #define ZERO(a) memset(a, 0, sizeof(a)) #define MINUS(a...
insert
40
40
40
41
0
p03030
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define INF 2e9 + 5 #define ll long long bool compare(const pair<string, pair<int, int>> &a, const pair<string, pair<int, int>> &b) { if (a.first < b.first) return true; if (a.first == b.first) return a.second.first > b.second.first; } int main() {...
#include <bits/stdc++.h> using namespace std; #define INF 2e9 + 5 #define ll long long bool compare(const pair<string, pair<int, int>> &a, const pair<string, pair<int, int>> &b) { if (a.first < b.first) return true; if (a.first == b.first) return a.second.first > b.second.first; return false...
insert
11
11
11
12
0
p03030
C++
Runtime Error
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int n; vector<pair<string, int>> array, copy; cin >> n; array.resize(n); for (int i = 0; i < n; i++) { cin >> array[i].first >> array[i].second; } copy = array; sort(array.begin(), array...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int n; vector<pair<string, int>> array, copy; cin >> n; array.resize(n); for (int i = 0; i < n; i++) { cin >> array[i].first >> array[i].second; } copy = array; sort(array.begin(), array...
replace
21
23
21
28
0
p03030
C++
Runtime Error
#if defined(__GNUC__) #include <bits/stdc++.h> #define __int32 __int32_t // __GNUC__ #else #include "bits/stdc++.h" #endif using namespace std; #define int long long #define itn __int32 #define REP(i, n) for (itn(i) = 0; (i) < (n); ++(i)) #define REP2(i, x, n) for (itn(i) = x; (i) < (n); ++(i)) #define ALL(x) (x).beg...
#if defined(__GNUC__) #include <bits/stdc++.h> #define __int32 __int32_t // __GNUC__ #else #include "bits/stdc++.h" #endif using namespace std; #define int long long #define itn __int32 #define REP(i, n) for (itn(i) = 0; (i) < (n); ++(i)) #define REP2(i, x, n) for (itn(i) = x; (i) < (n); ++(i)) #define ALL(x) (x).beg...
replace
44
45
44
45
-11
p03030
C++
Runtime Error
#include <stdio.h> #include <string.h> int main() { int i, j; int num; scanf("%d", &num); /* 文字列 */ int score[101]; int sort[101]; char moji[101][10], tmp[10]; int test; /* 3つの文字列を入力 */ for (i = 1; i < num + 1; i++) { sort[i] = i; scanf("%s %d", moji[i], &score[i]); } for (i = 2; i <...
#include <stdio.h> #include <string.h> int main() { int i, j; int num; scanf("%d", &num); /* 文字列 */ int score[101]; int sort[101]; char moji[101][20], tmp[20]; int test; /* 3つの文字列を入力 */ for (i = 1; i < num + 1; i++) { sort[i] = i; scanf("%s %d", moji[i], &score[i]); } for (i = 2; i <...
replace
11
12
11
12
-6
*** stack smashing detected ***: terminated
p03030
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; pair<pair<string, int>, int> a[100]; cin >> n; for (int i = 0; i < n; i++) { int b; string x; cin >> x; cin >> b; a[i] = make_pair(make_pair(x, b), i); } for (int i = 0; i < n - 1; i++) for (int j = n; j >= i + 1; j--)...
#include <bits/stdc++.h> using namespace std; int main() { int n; pair<pair<string, int>, int> a[111]; cin >> n; for (int i = 0; i < n; i++) { int b; string x; cin >> x; cin >> b; a[i] = make_pair(make_pair(x, b), i); } for (int i = 0; i < n - 1; i++) for (int j = n; j >= i + 1; j--)...
replace
4
5
4
5
0
p03030
Python
Runtime Error
n = int(input()) a = [] for i in range(n): s, p = list(map(int, input().split())) a.append((s, -int(p), i)) a.sort() for _, _, i in a: print(i + 1)
n = int(input()) a = [] for i in range(n): s, p = input().split() a.append((s, -int(p), i)) a.sort() for _, _, i in a: print(i + 1)
replace
3
4
3
4
ValueError: invalid literal for int() with base 10: 'khabarovsk'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03030/Python/s542428073.py", line 4, in <module> s, p = list(map(int, input().split())) ValueError: invalid literal for int() with base 10: 'khabarovsk'
p03030
C++
Runtime Error
#include <algorithm> #include <chrono> #include <cmath> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> PII; typedef pair<ll, ll> PLL; #define f...
#include <algorithm> #include <chrono> #include <cmath> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> PII; typedef pair<ll, ll> PLL; #define f...
insert
38
38
38
40
0
p03030
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; typedef vector<int> vec1; typedef vector<string> vec2; int main() { int n; cin >> n; vector<tuple<string, int, int>> t; for (int i = 1; i < n; i++) { string s; int p; cin >> s >> p; p = -p; t.push_back(tie(s, p, i)); } ...
#include <bits/stdc++.h> using namespace std; using ll = long long; typedef vector<int> vec1; typedef vector<string> vec2; int main() { int n; cin >> n; vector<tuple<string, int, int>> t; for (int i = 1; i < n + 1; i++) { string s; int p; cin >> s >> p; p = -p; t.push_back(tie(s, p, i)); ...
replace
11
12
11
12
0
p03030
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; typedef pair<string, int> guide; int main() { int N; cin >> N; vector<guide> G; vector<guide> C; for (int i = 0; i < N; i++) { string s; int p; cin >> s >> p; G.push_back(guide(s, p)); C.push_back(guide(s, p))...
#include <algorithm> #include <iostream> #include <vector> using namespace std; typedef pair<string, int> guide; int main() { int N; cin >> N; vector<guide> G; vector<guide> C; for (int i = 0; i < N; i++) { string s; int p; cin >> s >> p; G.push_back(guide(s, p)); C.push_back(guide(s, p))...
replace
22
23
22
23
-11
p03030
C++
Runtime Error
#include <bits/stdc++.h> #define ff first #define ss second #define ll long long #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { #ifndef ONLINE_JUDGE freopen("inp.txt", "r", stdin); freopen("outp.txt", "w", stdout); #endif ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(N...
#include <bits/stdc++.h> #define ff first #define ss second #define ll long long #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; cin >> n; map<string, vector<pair<int, int>>> m; for (int i = 1; i <= n; i++...
delete
8
12
8
8
0
p03030
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int num_of_tuple = 0; cin >> num_of_tuple; string a; int b = 0; vector<tuple<string, int, int>> v(num_of_tuple); for (int i = 0; i < num_of_tuple; ++i) { cin >> a >> b; v.at(i) = make_tuple(a, b, 1 + i); // 3番目の要素にインデックスの代わりを入れる ...
#include <bits/stdc++.h> using namespace std; int main() { int num_of_tuple = 0; cin >> num_of_tuple; string a; int b = 0; vector<tuple<string, int, int>> v(num_of_tuple); for (int i = 0; i < num_of_tuple; ++i) { cin >> a >> b; v.at(i) = make_tuple(a, b, 1 + i); // 3番目の要素にインデックスの代わりを入れる ...
replace
25
26
25
26
0
p03030
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main(void) { int N; cin >> N; vector<int> P(N); vector<string> S(N), C(N); vector<int> Q(N), R(N); for (int i = 0; i < N; i++) { cin >> S[i] >> P[i]; C[i] = S[i]; Q[i] = R[i] = 0; } sort(C.begin(), C.end()); for (int i = 0; i < N; i++) { ...
#include <bits/stdc++.h> using namespace std; int main(void) { int N; cin >> N; vector<int> P(N); vector<string> S(N), C(N); vector<int> Q(N), R(N); for (int i = 0; i < N; i++) { cin >> S[i] >> P[i]; C[i] = S[i]; Q[i] = R[i] = 0; } sort(C.begin(), C.end()); for (int i = 0; i < N; i++) { ...
replace
17
18
17
18
0
p03030
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { pair<pair<string, int>, int> p[120]; int n, a; string s; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%s%d", &s, &a); p[i] = make_pair(make_pair(s, -a), i); } sort(p, p + n); for (int i = 0; i < n; i++) printf("%d\n", p[i]....
#include <bits/stdc++.h> using namespace std; int main() { pair<pair<string, int>, int> p[120]; int n, a; string s; scanf("%d", &n); for (int i = 0; i < n; i++) { cin >> s >> a; p[i] = make_pair(make_pair(s, -a), i); } sort(p, p + n); for (int i = 0; i < n; i++) printf("%d\n", p[i].second +...
replace
9
10
9
10
-11
p03030
C++
Runtime Error
// in the name of god // if you read this code please search about imam hussain #include <bits/stdc++.h> using namespace std; typedef long long ll; #define pb push_back #define endl "\n"; #define migmig \ ios::sync_with_stdio(false); ...
// in the name of god // if you read this code please search about imam hussain #include <bits/stdc++.h> using namespace std; typedef long long ll; #define pb push_back #define endl "\n"; #define migmig \ ios::sync_with_stdio(false); ...
replace
25
27
25
28
0
p03030
Python
Runtime Error
#!/usr/bin/env python3 n = int(input()) res = [(i, *input().split()) for i in range(n)] res.sort(key=lambda x: (x[1], -int(x[2]))) for r in res: print(r[0] + 1)
#!/usr/bin/env python3 n = int(input()) res = [[i] + input().split() for i in range(n)] res.sort(key=lambda x: (x[1], -int(x[2]))) for r in res: print(r[0] + 1)
replace
2
3
2
3
0
p03030
C++
Runtime Error
// gauravsinghh #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define ll long long int #define ld long double #define db double #define pii pair<int, int> #define pll pair<long long, long long> #define sii set<int>...
// gauravsinghh #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define ll long long int #define ld long double #define db double #define pii pair<int, int> #define pll pair<long long, long long> #define sii set<int>...
replace
82
84
82
86
0
p03030
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; int n, c[105]; vector<pair<string, int>> f; int main() { cin >> n; for (int i = 0; i < n; i++) { string s; int p; cin >> s >> p; c[p] = i + 1; f.push_back({s, p}); } sort(f.begin(), f.end()); int cnt = 1; for...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int n, c[105]; vector<pair<string, int>> f; int main() { cin >> n; for (int i = 0; i < n; i++) { string s; int p; cin >> s >> p; c[p] = i + 1; f.push_back({s, p}); } sort(f.begin(), f.end()); int cnt = 1; for...
replace
18
21
18
27
0
p03030
C++
Runtime Error
#include <algorithm> #include <iostream> #include <map> #include <vector> using namespace std; int main() { int N; cin >> N; string RestrunStr[100]; int RestrunNum[100]; for (int i = 1; i <= N; i++) { int P; string S; cin >> S >> P; RestrunStr[i] = S; RestrunNum[i] = P; } map<int, i...
#include <algorithm> #include <iostream> #include <map> #include <vector> using namespace std; int main() { int N; cin >> N; string RestrunStr[255]; int RestrunNum[255]; for (int i = 1; i <= N; i++) { int P; string S; cin >> S >> P; RestrunStr[i] = S; RestrunNum[i] = P; } map<int, i...
replace
9
11
9
11
0
p03030
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { char in[120]; pair<pair<string, int>, int> p[11]; int a; cin >> a; for (int i = 0; i < a; i++) { int t; cin >> in >> t; // string tmp = in; p[i] = make_pair(make_pair(in, -t), i); } sort(p, p + a); for (int i = 0; i < a; i++...
#include <bits/stdc++.h> using namespace std; int main() { char in[120]; pair<pair<string, int>, int> p[110]; int a; cin >> a; for (int i = 0; i < a; i++) { int t; cin >> in >> t; // string tmp = in; p[i] = make_pair(make_pair(in, -t), i); } sort(p, p + a); for (int i = 0; i < a; i+...
replace
5
6
5
6
0
p03030
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>; struct restaurant { int no; string name; int pt; }; int cmp(const void *v1, const void *v2) { restaurant *r1 = (restaurant *)v1; restaurant *r2 = (restaurant *)v2; ...
#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>; struct restaurant { int no; string name; int pt; }; int cmp(const void *v1, const void *v2) { restaurant *r1 = (restaurant *)v1; restaurant *r2 = (restaurant *)v2; ...
replace
33
37
33
37
-11
p03030
Python
Runtime Error
N = int(input()) SP = [(i + 1, input().split()) for i in range(N)] P = [[0, 0, 0] for _ in range(N)] for i in range(N): P[i][0] = SP[i][0] P[i][1] = SP[i][1][0] P[i][2] = int(SP[i][1][1]) P.sort(key=lambda x: x[1][1], reverse=True) P.sort(key=lambda x: x[1][0]) for p in P: print(p[0])
N = int(input()) SP = [(i + 1, input().split()) for i in range(N)] P = [[0, 0, 0] for _ in range(N)] for i in range(N): P[i][0] = SP[i][0] P[i][1] = SP[i][1][0] P[i][2] = int(SP[i][1][1]) P.sort(key=lambda x: x[2], reverse=True) P.sort(key=lambda x: x[1]) for p in P: print(p[0])
replace
7
9
7
9
0
p03030
C++
Runtime Error
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <ve...
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <ve...
replace
50
51
50
57
0
p03030
Python
Runtime Error
# input N = int(input()) SA = [str(input()) for i in range(N)] # process cities = list(set([x.split()[0] for x in SA])) cities.sort() for y in cities: each_SA = [i for i in SA if y in i] each_points = [int(x.split()[1]) for x in each_SA] each_points.sort(reverse=True) for j in each_points: pri...
# input N = int(input()) SA = [str(input()) for i in range(N)] # process cities = list(set([x.split()[0] for x in SA])) cities.sort() for y in cities: each_SA = [] for i in SA: if i.split()[0] == y: each_SA.append(i) each_points = [int(x.split()[1]) for x in each_SA] each_points.so...
replace
9
10
9
13
0
p03030
Python
Runtime Error
# ABC128-B # ソートが大事な問題 import itemgetter a = int(input()) book = [] for i in range(a): array = input().split() book.append((array[0], int(array[1]) * -1, i)) ans = sorted(book, key=itemgetter(0, 1)) for i in range(a): print(ans[i][2] + 1)
# ABC128-B # ソートが大事な問題 from operator import itemgetter a = int(input()) book = [] for i in range(a): array = input().split() book.append((array[0], int(array[1]) * -1, i)) ans = sorted(book, key=itemgetter(0, 1)) for i in range(a): print(ans[i][2] + 1)
replace
2
3
2
3
ModuleNotFoundError: No module named 'itemgetter'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03030/Python/s634731574.py", line 3, in <module> import itemgetter ModuleNotFoundError: No module named 'itemgetter'
p03030
C++
Runtime Error
// ROAD TO GREEN #include <algorithm> #include <bitset> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <unordered_map> #include <vector> #define ll long long #define uint unsigned int #define ull unsigned ll #define mp make_pair #define...
// ROAD TO GREEN #include <algorithm> #include <bitset> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <unordered_map> #include <vector> #define ll long long #define uint unsigned int #define ull unsigned ll #define mp make_pair #define...
insert
40
40
40
42
0
p03031
C++
Runtime Error
#include <algorithm> #include <iostream> #include <tuple> #include <vector> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> s(M); for (int i = 0; i < N; i++) { int k; cin >> k; for (int j = 0; j < k; j++) { int a; cin >> a; s[i] |= (1 << --a); } } ve...
#include <algorithm> #include <iostream> #include <tuple> #include <vector> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> s(M); for (int i = 0; i < M; i++) { int k; cin >> k; for (int j = 0; j < k; j++) { int a; cin >> a; s[i] |= (1 << --a); } } ve...
replace
10
11
10
11
0
p03031
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<vector<int>> vv(m); for (int i = 0; i < m; i++) { int k; cin >> k; for (int j = 0; j < k; j++) { int h; cin >> h; vv[i].push_back(--h); } } vector<int> swi(m); for (auto &x : swi)...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<vector<int>> vv(m); for (int i = 0; i < m; i++) { int k; cin >> k; for (int j = 0; j < k; j++) { int h; cin >> h; vv[i].push_back(--h); } } vector<int> swi(m); for (auto &x : swi)...
replace
21
22
21
22
TLE
p03031
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <stdio.h> #include <string> #include <vector> #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef v...
#include <algorithm> #include <bitset> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <stdio.h> #include <string> #include <vector> #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef v...
replace
71
72
71
72
0
p03031
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; ++i) #define all(x) (x).begin(), (x).end() #define endl "\n" using ll = long long; using P = pair<int, int>; using mp = map<string, int>; const int MOD = 1e9 + 7; const int INF = 1001001001; int main() { ios_base::sync_with_std...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; ++i) #define all(x) (x).begin(), (x).end() #define endl "\n" using ll = long long; using P = pair<int, int>; using mp = map<string, int>; const int MOD = 1e9 + 7; const int INF = 1001001001; int main() { ios_base::sync_with_std...
replace
32
33
32
33
0
p03031
C++
Runtime Error
// auto 関数名 = [(&:ラムダ外の引数をとる時))](引数の型1 引数名1, 引数の型2, // 引数名2, ...) { 関数の処理 }; //inside main() define function. take care of // }; // for (int tmp = 0; tmp < (1 << ビット数); tmp++) { // bitset<ビット数> s(tmp); // // (ビット列sに対する処理) // } // sort(配列変数.begin(), 配列変数.end()); // do { // // 順列に対する処理 // } while (next_per...
// auto 関数名 = [(&:ラムダ外の引数をとる時))](引数の型1 引数名1, 引数の型2, // 引数名2, ...) { 関数の処理 }; //inside main() define function. take care of // }; // for (int tmp = 0; tmp < (1 << ビット数); tmp++) { // bitset<ビット数> s(tmp); // // (ビット列sに対する処理) // } // sort(配列変数.begin(), 配列変数.end()); // do { // // 順列に対する処理 // } while (next_per...
replace
30
31
30
31
0
p03031
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <sstream> #include <stack> #include <string> #include <unordered_map> #include <vector> using ll = long long; int main() { int N, M; std::cin >> N >> M; // i番目のスイッチのつけられる電球の番号...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <sstream> #include <stack> #include <string> #include <unordered_map> #include <vector> using ll = long long; int main() { int N, M; std::cin >> N >> M; // i番目のスイッチのつけられる電球の番号...
replace
50
51
50
51
0
p03031
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> P; typedef pair<int, P> P1; typedef pair<P, P> P2; #define pu push #define pb push_back #define mp make_pair #define eps 1e-7 #define INF 1000000000 #define mod...
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> P; typedef pair<int, P> P1; typedef pair<P, P> P2; #define pu push #define pb push_back #define mp make_pair #define eps 1e-7 #define INF 1000000000 #define mod...
replace
37
39
37
41
-11
p03031
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int n, m; cin >> n >> m; vector<vector<int>> s(m); for (int i = 0; i < n; i++) { int k; cin >> k; for (int j = 0; j < k; j++) { int temp; cin >> temp; temp--; s[i].push_back(temp); } } v...
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int n, m; cin >> n >> m; vector<vector<int>> s(m); for (int i = 0; i < m; i++) { int k; cin >> k; for (int j = 0; j < k; j++) { int temp; cin >> temp; temp--; s[i].push_back(temp); } } v...
replace
8
9
8
9
0