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
p03212
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define FOR(var, begin, end) for (int var = (begin); var < (end); var++) #define RFOR(var, begin, end) for (int var = (begin)-1; var >= (end); var--) #define REP(var, length) FOR(var, 0, length) #define RREP(var, length) RFOR(var, length, 0) #define SO...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define FOR(var, begin, end) for (int var = (begin); var < (end); var++) #define RFOR(var, begin, end) for (int var = (begin)-1; var >= (end); var--) #define REP(var, length) FOR(var, 0, length) #define RREP(var, length) RFOR(var, length, 0) #define SO...
replace
13
14
13
14
0
p03212
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { long N; cin >> N; long ans = 0; long i, j; int chk[4] = {0, 0, 0, 0}; long tmp = 0; int logi; int tmpi; int chk7; for (i = 357; i <= N; i += 2) { tmp = i; logi = 1; chk[0] = 0; chk[1] = 0; chk[2] = 0; chk[3] = 0; ...
#include <bits/stdc++.h> using namespace std; int main() { long N; cin >> N; long ans = 0; long i, j; int chk[4] = {0, 0, 0, 0}; long tmp = 0; int logi; int tmpi; int chk7; for (i = 357; i <= N; i += 2) { tmp = i; logi = 1; chk[0] = 0; chk[1] = 0; chk[2] = 0; chk[3] = 0; ...
replace
22
23
22
23
TLE
p03212
C++
Runtime Error
#include <algorithm> #include <iostream> #include <stdio.h> #include <string> using namespace std; int ans = 0; void cnt(int n, string s, char add) { int a, b, c; a = b = c = 0; s += add; for (int i = 0; i < s.length(); i++) { if (s[i] == '3') a++; else if (s[i] == '5') b++; else if (s...
#include <algorithm> #include <iostream> #include <stdio.h> #include <string> using namespace std; int ans = 0; void cnt(int n, string s, char add) { int a, b, c; a = b = c = 0; s += add; for (int i = 0; i < s.length(); i++) { if (s[i] == '3') a++; else if (s[i] == '5') b++; else if (s...
replace
22
23
22
23
0
p03212
C++
Time Limit Exceeded
#include <algorithm> #include <climits> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <typeinfo> #include <utility> #include <vector> using namespace std; typedef long long int ll; typedef pair<int, i...
#include <algorithm> #include <climits> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <typeinfo> #include <utility> #include <vector> using namespace std; typedef long long int ll; typedef pair<int, i...
insert
50
50
50
56
TLE
p03213
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using pll = pair<ll, ll>; using plll = pair<ll, pll>; using graph = vector<vector<int>>; const ll MOD = 1000000007; const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1, 0, -1}; ll abs1(ll a) { if (a >= 0) return a; ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using pll = pair<ll, ll>; using plll = pair<ll, pll>; using graph = vector<vector<int>>; const ll MOD = 1000000007; const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1, 0, -1}; ll abs1(ll a) { if (a >= 0) return a; ...
insert
196
196
196
200
0
p03213
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(v) v.begin(), v.end() using namespace std; typedef long long ll; vector<pair<ll, int>> prime_factorization(ll n) { vector<pair<ll, int>> res; for (ll i = 2; i * i <= n; i++) { if (n % i) continue; res.emplace_back(i,...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(v) v.begin(), v.end() using namespace std; typedef long long ll; vector<pair<ll, int>> prime_factorization(ll n) { vector<pair<ll, int>> res; for (ll i = 2; i * i <= n; i++) { if (n % i) continue; res.emplace_back(i,...
insert
38
38
38
42
TLE
p03213
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; string to_string(string s) { return '"' + s + '"'; } string to_string(bool b) { return (b ? "true" : "false"); } template <typename A, typename B> string to_string(pair<A, B> p) { return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; } template <typename...
#include <bits/stdc++.h> using namespace std; string to_string(string s) { return '"' + s + '"'; } string to_string(bool b) { return (b ? "true" : "false"); } template <typename A, typename B> string to_string(pair<A, B> p) { return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; } template <typename...
replace
65
66
65
66
0
p03213
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; int N, n, ans; map<int, int> x; vector<int> w; const int MOD = 1e9 + 7; const int MAX = 100; ll fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void comb_init() { fac[0] = fac[1] = 1; finv[0] = fi...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; int N, n, ans; map<int, int> x; vector<int> w; const int MOD = 1e9 + 7; const int MAX = 100; ll fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void comb_init() { fac[0] = fac[1] = 1; finv[0] = fi...
insert
81
81
81
85
0
p03213
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; #define DUMP(x) cout << #x << " = " << (x) << endl; #define FOR(i, m, n) for (ll i = m; i < n; i++) #define IFOR(i, m, n) for (ll i = n - 1; i >= m; i--) #define REP(i, n) FOR(i, 0, n) #define IREP(i, n) IFOR(i, 0, n) #define FO...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; #define DUMP(x) cout << #x << " = " << (x) << endl; #define FOR(i, m, n) for (ll i = m; i < n; i++) #define IFOR(i, m, n) for (ll i = n - 1; i >= m; i--) #define REP(i, n) FOR(i, 0, n) #define IREP(i, n) IFOR(i, 0, n) #define FO...
replace
46
47
46
47
-6
munmap_chunk(): invalid pointer
p03213
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; void primes(long N, vector<long> &p) { long i = 2; while (N != 1) { if (0 == N % i) { N /= i; p.at(i)++; } else i++; } return; } long comb(long N, long P) { long S = 1; for (long i = 1; i <= P; i++) { S *= N; S /= i; N--; ...
#include <bits/stdc++.h> using namespace std; void primes(long N, vector<long> &p) { long i = 2; while (N != 1) { if (0 == N % i) { N /= i; p.at(i)++; } else i++; } return; } long comb(long N, long P) { long S = 1; for (long i = 1; i <= P; i++) { S *= N; S /= i; N--; ...
replace
47
48
47
48
0
p03213
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; long kaijo(long n) { long ret = 1; for (int i = 1; i <= n; i++) { ret *= i; } return ret; } long com(long n, long r) { long ans = kaijo(n) / kaijo(r) / kaijo(n - r); return ans; } int main() { int N; cin >> N; vector<long> a(N); if (N <= 9) { ...
#include <bits/stdc++.h> using namespace std; long kaijo(long n) { long ret = 1; for (int i = 1; i <= n; i++) { ret *= i; } return ret; } long com(long n, long r) { long ans = kaijo(n) / kaijo(r) / kaijo(n - r); return ans; } int main() { int N; cin >> N; vector<long> a(100); if (N <= 9) { ...
replace
20
21
20
21
0
p03213
C++
Runtime Error
#pragma once #include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ...
#pragma once #include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ...
replace
51
52
51
52
-6
*** stack smashing detected ***: terminated
p03213
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; map<int, int> Map; template <class T> void fact(T n) { for (T i = 2; i * i <= n; i++) { while (n % i == 0) { Map[i]++; n /= i; } } if (n == 1) return; Map[n]++; } int main() { int n; cin >> n; for (int i = 1; i ...
#include <bits/stdc++.h> using namespace std; using ll = long long; map<int, int> Map; template <class T> void fact(T n) { for (T i = 2; i * i <= n; i++) { while (n % i == 0) { Map[i]++; n /= i; } } if (n == 1) return; Map[n]++; } int main() { int n; cin >> n; if (n < 10) { ...
insert
21
21
21
25
0
p03213
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <queue> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef pair<ll, ll> curr; const int MOD = 998244353; int combi(int n, int k) { if (n == k |...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <queue> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef pair<ll, ll> curr; const int MOD = 998244353; int combi(int n, int k) { if (n == k |...
replace
75
76
75
77
TLE
p03213
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cmath> #include <deque> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <utility> #include <vector> using namespace std; typedef long long ll; ll mod = 1e9 + 7; #define rep(i, n) for (int i = 0; i < (n); ++...
#include <algorithm> #include <cassert> #include <cmath> #include <deque> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <utility> #include <vector> using namespace std; typedef long long ll; ll mod = 1e9 + 7; #define rep(i, n) for (int i = 0; i < (n); ++...
replace
39
40
39
40
-11
p03213
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fs first #define sc second #define mp make_pair #define pb push_back #define eb emplace_back #define ALL(A) A.begin(), A.end() #define RALL(A) A.rbegin(), A.rend() typedef unsigned long long LL; typedef pair<int, int> P; const LL mod = 1000000007; const LL LINF = 1L...
#include <bits/stdc++.h> using namespace std; #define fs first #define sc second #define mp make_pair #define pb push_back #define eb emplace_back #define ALL(A) A.begin(), A.end() #define RALL(A) A.rbegin(), A.rend() typedef unsigned long long LL; typedef pair<int, int> P; const LL mod = 1000000007; const LL LINF = 1L...
delete
14
51
14
14
0
p03213
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> d(76, 0); for (int i = 2; i <= n; i++) { int X = i; for (int div = 2; div <= i; div++) { int cnt = 0; while (X % div == 0) { cnt++; X /= div; } d[div] += cnt; } } int ...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> d(101, 0); for (int i = 2; i <= n; i++) { int X = i; for (int div = 2; div <= i; div++) { int cnt = 0; while (X % div == 0) { cnt++; X /= div; } d[div] += cnt; } } int...
replace
6
7
6
7
0
p03213
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fs first #define sc second #define mp make_pair #define pb push_back #define eb emplace_back #define ALL(A) A.begin(), A.end() #define RALL(A) A.rbegin(), A.rend() typedef unsigned long long LL; typedef pair<int, int> P; const LL mod = 1000000007; const LL LINF = 1L...
#include <bits/stdc++.h> using namespace std; #define fs first #define sc second #define mp make_pair #define pb push_back #define eb emplace_back #define ALL(A) A.begin(), A.end() #define RALL(A) A.rbegin(), A.rend() typedef unsigned long long LL; typedef pair<int, int> P; const LL mod = 1000000007; const LL LINF = 1L...
replace
15
16
15
16
0
p03214
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<double> v(n); for (auto &e : v) cin >> e; double ave = 0; for (auto &e : v) ave += e; ave = ave / n; int argi = 0; for (int i = 0; i < n; ++i) { if (abs(v[i] - ave) < abs(v[argi] - ave)) i = argi; } ...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<double> v(n); for (auto &e : v) cin >> e; double ave = 0; for (auto &e : v) ave += e; ave = ave / n; int argi = 0; for (int i = 0; i < n; ++i) { if (abs(v[i] - ave) < abs(v[argi] - ave)) argi = i; } ...
replace
15
16
15
16
TLE
p03215
C++
Runtime Error
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <utility> #include <vector> using namespace std; typedef long long ll; #define DEBUG #ifdef DEB...
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <utility> #include <vector> using namespace std; typedef long long ll; #define DEBUG #ifdef DEB...
replace
22
23
22
23
0
p03215
C++
Runtime Error
#include <bits/stdc++.h> #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 per(i, a, b) for (int i = a; i >= b; --i) #define rvc(i, S) for (int i = 0; i < (int)S.size(); ++i) #define pb push_back #define fi first #define se second #define debug(...) fprintf(st...
#include <bits/stdc++.h> #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 per(i, a, b) for (int i = a; i >= b; --i) #define rvc(i, S) for (int i = 0; i < (int)S.size(); ++i) #define pb push_back #define fi first #define se second #define debug(...) fprintf(st...
replace
10
11
10
11
0
p03215
C++
Runtime Error
#include <cstdio> #define ll long long using namespace std; ll a[1010], sum[100010]; int n, m, cnt = 0; int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= n; i++) scanf("%lld", &a[i]); for (int i = 1; i <= n; i++) { ll tot = 0; for (int j = i; j <= n; j++) tot += a[j], sum[++cnt] = tot; ...
#include <cstdio> #define ll long long using namespace std; ll a[1010], sum[1000010]; int n, m, cnt = 0; int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= n; i++) scanf("%lld", &a[i]); for (int i = 1; i <= n; i++) { ll tot = 0; for (int j = i; j <= n; j++) tot += a[j], sum[++cnt] = tot; ...
replace
3
4
3
4
0
p03215
C++
Runtime Error
#include <bits/stdc++.h> #define int long long int using namespace std; template <typename T, typename U> using P = pair<T, U>; template <typename T> using V = vector<T>; template <typename T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <typename T> bool chmin(T &a,...
#include <bits/stdc++.h> #define int long long int using namespace std; template <typename T, typename U> using P = pair<T, U>; template <typename T> using V = vector<T>; template <typename T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <typename T> bool chmin(T &a,...
replace
91
92
91
92
0
p03215
C++
Runtime Error
#include <cstdio> #define maxn 1010 typedef long long ll; int a[maxn]; ll s[maxn]; int main() { int n, k; scanf("%d%d", &n, &k); for (int i = 1; i <= n; ++i) scanf("%d", a + i); int t = 0; for (int i = 1; i <= n; ++i) { ll sum = 0; for (int j = i; j <= n; ++j) sum += a[j], s[++t] = sum; }...
#include <cstdio> #define maxn 1010 typedef long long ll; int a[maxn]; ll s[maxn * maxn]; int main() { int n, k; scanf("%d%d", &n, &k); for (int i = 1; i <= n; ++i) scanf("%d", a + i); int t = 0; for (int i = 1; i <= n; ++i) { ll sum = 0; for (int j = i; j <= n; ++j) sum += a[j], s[++t] = s...
replace
5
6
5
6
0
p03215
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define reps(i, s, n) for (int i = (int)(s); i < (int)(n); i++) const ll mod = ll(1e9) + 7; const int INF = int(1e9); void judge(vector<ll> &p2, int exp, int K, ll ans) { ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define reps(i, s, n) for (int i = (int)(s); i < (int)(n); i++) const ll mod = ll(1e9) + 7; const int INF = int(1e9); void judge(vector<ll> &p2, int exp, int K, ll ans) { ...
insert
15
15
15
16
-11
p03215
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; // #include <boost/multiprecision/cpp_int.hpp> // using multiInt = boost::multiprecision::cpp_int; using ll = long long int; using ld = long double; using pii = pair<int, int>; using pll = pair<ll, ll>; template <typename Q_temp> using smaller_queue = priority_queue<Q_temp...
#include <bits/stdc++.h> using namespace std; // #include <boost/multiprecision/cpp_int.hpp> // using multiInt = boost::multiprecision::cpp_int; using ll = long long int; using ld = long double; using pii = pair<int, int>; using pll = pair<ll, ll>; template <typename Q_temp> using smaller_queue = priority_queue<Q_temp...
replace
43
45
43
45
0
p03215
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, s, t) for (int i = (s); i < (t); ++i) #define per(i, s, t) for (int i = ((t)-1); i >= s; --i) #define repb(i, s, t) for (int i = (s); i <= (t); ++i) #define lepb(i, s, t) for (int i = (s); i >= (t); --i) #define pb push_back #define mp make_pair #define all(x...
#include <bits/stdc++.h> using namespace std; #define rep(i, s, t) for (int i = (s); i < (t); ++i) #define per(i, s, t) for (int i = ((t)-1); i >= s; --i) #define repb(i, s, t) for (int i = (s); i <= (t); ++i) #define lepb(i, s, t) for (int i = (s); i >= (t); --i) #define pb push_back #define mp make_pair #define all(x...
replace
32
34
32
34
TLE
p03215
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 // #define INF 10000000000000009 #define INF 9223372036854775807 typedef long long ll; #define REP(i, n) for (int i = 0; i < (n); ++i) #define OREP(i, n) for (int i = 1; i <= (n); ++i) #define ORREP(i, n) for (int i = (n); i >= 1; --i) #define ZREP(i,...
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 // #define INF 10000000000000009 #define INF 9223372036854775807 typedef long long ll; #define REP(i, n) for (int i = 0; i < (n); ++i) #define OREP(i, n) for (int i = 1; i <= (n); ++i) #define ORREP(i, n) for (int i = (n); i >= 1; --i) #define ZREP(i,...
replace
23
24
23
24
0
p03215
C++
Runtime Error
#include <algorithm> #include <bitset> #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> #include <set> #include ...
#include <algorithm> #include <bitset> #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> #include <set> #include ...
replace
45
46
45
46
0
p03215
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define INF 1000000005 #define MOD 1000000007 #define EPS 1e-10 #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define rrep(i, n) for (int i = (int)(n)-1; i >= 0; --i) #define srep(i, s, t) for (int i = (int)(s); i < (int)(t); ++i) #define each(a, b) for (auto &(a) : ...
#include <bits/stdc++.h> #define ll long long #define INF 1000000005 #define MOD 1000000007 #define EPS 1e-10 #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define rrep(i, n) for (int i = (int)(n)-1; i >= 0; --i) #define srep(i, s, t) for (int i = (int)(s); i < (int)(t); ++i) #define each(a, b) for (auto &(a) : ...
replace
63
64
63
64
0
p03215
C++
Runtime Error
#include <cstring> #include <iostream> using namespace std; typedef long long int LL; LL sum[1005]; LL t[100005]; bool con[100005]; // concern int main() { LL n, m, p; int i, j, k; LL s = 0; LL a, b; memset(con, true, sizeof(con)); cin >> n >> m; p = n * (n + 1) / 2; for (i = 0; i < n; i++) { cin >...
#include <cstring> #include <iostream> using namespace std; typedef long long int LL; LL sum[1005]; LL t[1000005]; bool con[1000005]; // concern int main() { LL n, m, p; int i, j, k; LL s = 0; LL a, b; memset(con, true, sizeof(con)); cin >> n >> m; p = n * (n + 1) / 2; for (i = 0; i < n; i++) { cin...
replace
5
7
5
7
0
p03215
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; unsigned long sums[500050]; void solve() { int N, K; cin >> N >> K; vector<unsigned long> imos(N + 1); for (int i = 0; i < N; i++) { long a; cin >> a; imos[i + 1] = a + imos[i]; } unsigned long ans = 0; for (int l = 0; l < N; l++) for (int...
#include "bits/stdc++.h" using namespace std; unsigned long sums[5000050]; void solve() { int N, K; cin >> N >> K; vector<unsigned long> imos(N + 1); for (int i = 0; i < N; i++) { long a; cin >> a; imos[i + 1] = a + imos[i]; } unsigned long ans = 0; for (int l = 0; l < N; l++) for (in...
replace
4
5
4
5
0
p03215
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
470
471
470
471
0
p03215
C++
Runtime Error
#include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <algorithm> #include <cassert> #include <cfloat> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <regex> #include <set> #...
#include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <algorithm> #include <cassert> #include <cfloat> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <regex> #include <set> #...
replace
62
63
62
63
0
p03215
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <complex> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include...
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <complex> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include...
replace
43
44
43
44
0
p03216
C++
Runtime Error
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #define x first #define y second #define endl '\n' #define mp make_pair #define up_b upper_bound #define low_b lower_bound #define sz(x) (int)x.size() #define bit __builtin_popcount #define all(x) x.begin(), x.end() #define show(x) cout << (#x) << " is ...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #define x first #define y second #define endl '\n' #define mp make_pair #define up_b upper_bound #define low_b lower_bound #define sz(x) (int)x.size() #define bit __builtin_popcount #define all(x) x.begin(), x.end() #define show(x) cout << (#x) << " is ...
replace
38
39
38
39
0
p03216
C++
Runtime Error
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <utility> #include <vector> using namespace std; #define int long long...
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <utility> #include <vector> using namespace std; #define int long long...
replace
100
101
100
101
0
p03216
C++
Runtime Error
#include <algorithm> #include <bitset> #include <chrono> #include <climits> #include <cmath> #include <ctime> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <utility> #inclu...
#include <algorithm> #include <bitset> #include <chrono> #include <climits> #include <cmath> #include <ctime> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <utility> #inclu...
replace
45
48
45
48
0
p03216
C++
Time Limit Exceeded
#include <iostream> #include <vector> using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(0); int n, q; string s; cin >> n >> s >> q; for (int i = 0; i < n; ++i) s = s + "*"; n *= 2; vector<ll> prefM(n), prefC(n); for (int i = 0; i < n; ++i) { prefM[i] = 0; i...
#include <iostream> #include <vector> using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(0); int n, q; string s; cin >> n >> s >> q; string g(n, '*'); s = s + g; n *= 2; vector<ll> prefM(n), prefC(n); for (int i = 0; i < n; ++i) { prefM[i] = 0; if (s[i] == 'M'...
replace
12
14
12
14
TLE
p03216
C++
Runtime Error
#include "bits/stdc++.h" #define int long long #define fi first #define se second using namespace std; const long long INF = 1e18; const long long MD = 1e9 + 7; int n; string s; int a[1000006], pref[100006][4], dp[100006][4]; signed main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n; cin...
#include "bits/stdc++.h" #define int long long #define fi first #define se second using namespace std; const long long INF = 1e18; const long long MD = 1e9 + 7; int n; string s; int a[1000006], pref[1000006][4], dp[1000006][4]; signed main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n; c...
replace
9
10
9
10
0
p03216
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define inf 999999999 #define loop(i, a, b) for (int i = (a), i##len = (b); i < i##len; ++i) #define rep(i, n) loop(i, 0, n) #define lin long long #define lfl long double lin n; string s; lin q; void solve(lin k) { queue<lin> d; queue<lin> m; lin ad = 0; lin res =...
#include <bits/stdc++.h> using namespace std; #define inf 999999999 #define loop(i, a, b) for (int i = (a), i##len = (b); i < i##len; ++i) #define rep(i, n) loop(i, 0, n) #define lin long long #define lfl long double lin n; string s; lin q; void solve(lin k) { queue<lin> d; queue<lin> m; lin ad = 0; lin res =...
replace
25
26
25
26
0
p03216
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #incl...
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #incl...
replace
29
32
29
32
0
p03216
C++
Runtime Error
#include <bits/stdc++.h> typedef long long i64; using std::cin; using std::cout; using std::endl; int main() { int n; scanf("%d", &n); std::string s; cin >> s; int q; scanf("%d", &q); std::vector<i64> sum(n + 1, 0); std::vector<int> latte; for (int i = 0; i < n; i++) sum[i + 1] = sum[i] + (s[i] ...
#include <bits/stdc++.h> typedef long long i64; using std::cin; using std::cout; using std::endl; int main() { int n; scanf("%d", &n); std::string s; cin >> s; int q; scanf("%d", &q); std::vector<i64> sum(n + 1, 0); std::vector<int> latte; for (int i = 0; i < n; i++) sum[i + 1] = sum[i] + (s[i] ...
replace
32
33
32
33
0
p03216
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; template <typename T> void out(T x) { cout << x << endl; exit(0); } #define watch(x) cout << (#x) << " is " << (x) << endl using ll = long long; const ll mod = 1e9 + 7; const int maxn = 1e6 + 5; template <typename T> struct bit1 { T add(T x, T y) { return x + y; }...
#include <bits/stdc++.h> using namespace std; template <typename T> void out(T x) { cout << x << endl; exit(0); } #define watch(x) cout << (#x) << " is " << (x) << endl using ll = long long; const ll mod = 1e9 + 7; const int maxn = 1e6 + 5; template <typename T> struct bit1 { T add(T x, T y) { return x + y; }...
replace
56
57
56
57
0
p03216
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 = (n); i >= 0; i--) #define loop(i, r, n) for (int i = (r); i < (n); i++) #define pb push_back #define all(in) in.begin(), in.end() template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; retu...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define rrep(i, n) for (int i = (n); i >= 0; i--) #define loop(i, r, n) for (int i = (r); i < (n); i++) #define pb push_back #define all(in) in.begin(), in.end() template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; retu...
replace
38
39
38
39
0
p03216
C++
Runtime Error
#include <bits/stdc++.h> #define x first #define y second #define mp make_pair // everything goes according to my plan #define pb push_back #define sz(a) (int)(a.size()) #define vec vector // shimkenttin kyzdary, dzyn, dzyn, dzyn... #define y1 Y_U_NO_y1 #define left Y_U_NO_left #define right Y_U_NO_right #ifdef Local...
#include <bits/stdc++.h> #define x first #define y second #define mp make_pair // everything goes according to my plan #define pb push_back #define sz(a) (int)(a.size()) #define vec vector // shimkenttin kyzdary, dzyn, dzyn, dzyn... #define y1 Y_U_NO_y1 #define left Y_U_NO_left #define right Y_U_NO_right #ifdef Local...
replace
59
60
59
60
0
p03216
C++
Runtime Error
#include <algorithm> #include <cmath> #include <deque> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stdio.h> #include <vector> using namespace std; #define int long long #define rep(s, i, n) for (int i = s; i < n; i++) #define c(n) cout << n << endl; #define ic(n) ...
#include <algorithm> #include <cmath> #include <deque> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stdio.h> #include <vector> using namespace std; #define int long long #define rep(s, i, n) for (int i = s; i < n; i++) #define c(n) cout << n << endl; #define ic(n) ...
replace
378
380
378
382
-11
p03216
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> using namespace std; #define ll long long #define N 1000010 char getc() { char c = getchar(); while ((c < 'A' || c > 'Z') && (c < 'a' || c > 'z') && (c < '0' || c > '9')) c = getchar(); return c; ...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> using namespace std; #define ll long long #define N 1000010 char getc() { char c = getchar(); while ((c < 'A' || c > 'Z') && (c < 'a' || c > 'z') && (c < '0' || c > '9')) c = getchar(); return c; ...
delete
31
38
31
31
TLE
p03216
C++
Runtime Error
#include <bits/stdc++.h> #define Int long long using namespace std; int main() { int n; cin >> n; string s; cin >> s; int U; cin >> U; while (U--) { Int ans = 0, res = 0, add = 0; int tmp; cin >> tmp; tmp--; queue<Int> q; for (int i = 0; i < n; i++) { if (s[i] == 'D') { ...
#include <bits/stdc++.h> #define Int long long using namespace std; int main() { int n; cin >> n; string s; cin >> s; int U; cin >> U; while (U--) { Int ans = 0, res = 0, add = 0; int tmp; cin >> tmp; tmp--; queue<Int> q; for (int i = 0; i < n; i++) { if (s[i] == 'D') { ...
replace
25
26
25
26
0
p03216
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long signed main() { cin.tie(0); ios_base::sync_with_stdio(0); cout << fixed << setprecision(12); int N; cin >> N; string S; cin >> S; vector<int> cumb(2 * N + 1, 0), cumc(2 * N + 1, 0), cumbb(2 * N + 1, 0); for (int i = 0; i < 2 * N ...
#include <bits/stdc++.h> using namespace std; #define int long long signed main() { cin.tie(0); ios_base::sync_with_stdio(0); cout << fixed << setprecision(12); int N; cin >> N; string S; cin >> S; vector<int> cumb(2 * N + 1, 0), cumc(2 * N + 1, 0), cumbb(2 * N + 1, 0); for (int i = 0; i < 2 * N ...
insert
23
23
23
25
0
p03216
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; long d[1111111], m[1111111], dm[1111111]; int main() { int n, q; string s; cin >> n >> s >> q; for (int i = 0; i < n; i++) d[i + 1] = d[i] + (s[i] == 'D'), m[i + 1] = m[i] + (s[i] == 'M'), dm[i + 1] = dm[i] + d[i] * (s[i] == 'M'); for (int i = 0; i...
#include <bits/stdc++.h> using namespace std; long d[1111111], m[1111111], dm[1111111]; int main() { int n, q; string s; cin >> n >> s >> q; for (int i = 0; i < n; i++) d[i + 1] = d[i] + (s[i] == 'D'), m[i + 1] = m[i] + (s[i] == 'M'), dm[i + 1] = dm[i] + d[i] * (s[i] == 'M'); for (int i = 0; i...
replace
20
21
20
22
0
p03216
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n; cin >> n; string s; cin >> s; ll q; cin >> q; vector<ll> d, m, c; for (ll i = 0; i < n; i++) { if (s[i] == 'D') d.push_back(i); if (s[i] == 'M') m.push_back(i); if (s[i] == 'C') c.push_ba...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n; cin >> n; string s; cin >> s; ll q; cin >> q; vector<ll> d, m, c; for (ll i = 0; i < n; i++) { if (s[i] == 'D') d.push_back(i); if (s[i] == 'M') m.push_back(i); if (s[i] == 'C') c.push_ba...
replace
25
27
25
27
0
p03216
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define REP(i, n) for (int i =...
#include <algorithm> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define REP(i, n) for (int i =...
replace
109
110
109
110
0
p03216
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define ll...
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define ll...
replace
59
60
59
60
TLE
p03216
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using LL = long long; #define FOR(i, x, y) \ for (decay<decltype(y)>::type i = (x), _##i = (y); i < _##i; ++i) #define FORD(i, x, y) \ for (decay<decltype(...
#include <bits/stdc++.h> using namespace std; using LL = long long; #define FOR(i, x, y) \ for (decay<decltype(y)>::type i = (x), _##i = (y); i < _##i; ++i) #define FORD(i, x, y) \ for (decay<decltype(...
replace
37
38
37
38
0
p03216
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define F first #define S second using namespace std; using ll = long long; typedef pair<int, int> P; ll Mod = 1000000007; template <typename T> struct BIT { int n; vector<T> d; BIT(int n = 0) : n(n), d(n + 1) {} void add(int i, T x = 1) { for (i++; i <= n; i += i & -i) { d[i...
#include <bits/stdc++.h> #pragma GCC target("avx") #pragma GCC optimize("O3") #define F first #define S second using namespace std; using ll = long long; typedef pair<int, int> P; ll Mod = 1000000007; template <typename T> struct BIT { int n; vector<T> d; BIT(int n = 0) : n(n), d(n + 1) {} void add(int i, T x ...
insert
1
1
1
3
TLE
p03216
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long typedef pair<ll, ll> P; typedef pair<ll, P> PP; const ll MOD = 1e9 + 7; int main() { ll n, q; string s; cin >> n >> s >> q; for (int i = 0; i < 100; i++) s += '.'; for (int cn = 0; cn < q; cn++) { ll k, ans = 0; cin >> k; ll c...
#include <bits/stdc++.h> using namespace std; #define ll long long typedef pair<ll, ll> P; typedef pair<ll, P> PP; const ll MOD = 1e9 + 7; int main() { ll n, q; string s; cin >> n >> s >> q; for (int i = 0; i <= n; i++) s += '.'; for (int cn = 0; cn < q; cn++) { ll k, ans = 0; cin >> k; ll cn...
replace
11
12
11
12
0
p03216
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define MOD (long long int)(1e9 + 7) #define ll long long int #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define reps(i, n) for (int i = 1; i <= (int)(n); i++) #define REP(i, n) for (int i = n - 1; i >= 0; i--) #define REPS(i, n) for (int i = n; i > 0; i--) #defin...
#include <bits/stdc++.h> using namespace std; #define MOD (long long int)(1e9 + 7) #define ll long long int #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define reps(i, n) for (int i = 1; i <= (int)(n); i++) #define REP(i, n) for (int i = n - 1; i >= 0; i--) #define REPS(i, n) for (int i = n; i > 0; i--) #defin...
replace
59
60
59
60
TLE
p03216
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(v) begin(v), end(v) #define fi first #define se second template <typename A, typename B> inline bool chmax(A &a, B b) { if (a < b) { a = b; return 1; } return 0; } ...
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(v) begin(v), end(v) #define fi first #define se second template <typename A, typename B> inline bool chmax(A &a, B b) { if (a < b) { a = b; return 1; } return 0; } ...
replace
42
43
42
43
0
p03216
C++
Runtime Error
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cctype> #include <cfenv> #include <chrono> #include <climits> #include <cmath> #include <complex> #include <cstdint> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <functional> #include <iomanip> #inc...
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cctype> #include <cfenv> #include <chrono> #include <climits> #include <cmath> #include <complex> #include <cstdint> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <functional> #include <iomanip> #inc...
replace
61
63
61
63
0
p03216
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <cstdlib> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef vector<ll> vl; typedef vector<vl> vvl; typedef vecto...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdlib> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef vector<ll> vl; typedef vector<vl> vvl; typedef vecto...
replace
73
77
73
79
0
p03216
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #define maxn 1000005 #define ll long long #define ld double #define mod 998244353 using namespace std; char inp[maxn]; struct th { ll a[maxn]; th() { memset(a, 0, sizeof(a)); } void add(int pl, int num) { a[pl] += num...
#include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #define maxn 2000005 #define ll long long #define ld double #define mod 998244353 using namespace std; char inp[maxn]; struct th { ll a[maxn]; th() { memset(a, 0, sizeof(a)); } void add(int pl, int num) { a[pl] += num...
replace
5
6
5
6
0
p03216
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define N 1001000 int n, q, m; char s[N]; int main() { scanf("%d", &n); scanf("%s", s + 1); for (scanf("%d", &q); q; q--) { scanf("%d", &m); int l = 1, r = 0, sm = 0, sc = 0; long long res = 0, ans = 0; for (; r < m; r++) { if (s[r + 1] == 'C')...
#include <bits/stdc++.h> using namespace std; #define N 2001000 int n, q, m; char s[N]; int main() { scanf("%d", &n); scanf("%s", s + 1); for (scanf("%d", &q); q; q--) { scanf("%d", &m); int l = 1, r = 0, sm = 0, sc = 0; long long res = 0, ans = 0; for (; r < m; r++) { if (s[r + 1] == 'C')...
replace
2
3
2
3
0
p03216
C++
Runtime Error
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <map> #include <numeric> #include <queue> #include <set> #include <vector> using namespace std; typedef long long int lli; int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; } lli gcd(lli a, l...
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <map> #include <numeric> #include <queue> #include <set> #include <vector> using namespace std; typedef long long int lli; int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; } lli gcd(lli a, l...
replace
21
22
21
22
0
p03217
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; // when range [l, r), has property notP~P, want first P. // when return r, means not found. template <typename T> T bs_first(T l, T r, function<bool(T)> f) { assert(l < r); T mid; while (l != r) { mid = l + (r - l) / 2; if (f(mid)) { r = mid; } els...
#include <bits/stdc++.h> using namespace std; // when range [l, r), has property notP~P, want first P. // when return r, means not found. template <typename T> T bs_first(T l, T r, function<bool(T)> f) { assert(l < r); T mid; while (l != r) { mid = l + (r - l) / 2; if (f(mid)) { r = mid; } els...
insert
79
79
79
84
-6
0b5b30b4-ba2c-4903-8186-4437cc6f730a.out: /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03217/C++/s995041324.cpp:9: T bs_first(T, T, std::function<bool(_CharT)>) [with T = int]: Assertion `l < r' failed.
p03217
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(false);...
#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(false);...
replace
97
98
97
98
-11
p03217
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #define infll 0x3f3f3f3f3f3f3f3fll 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 ...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #define infll 0x3f3f3f3f3f3f3f3fll 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 ...
replace
30
31
30
32
0
p03217
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <iterator>...
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <iterator>...
replace
94
97
94
97
TLE
p03219
C++
Runtime Error
#include <bits/stdc++.h> #define MAXN 100100 #define pii pair<int, int> #define pb push_back typedef long long ll; using namespace std; int a, b; int main() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); #endif ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> a >> b; cout << a + b / 2; }
#include <bits/stdc++.h> #define MAXN 100100 #define pii pair<int, int> #define pb push_back typedef long long ll; using namespace std; int a, b; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> a >> b; cout << a + b / 2; }
delete
11
14
11
11
0
p03219
C++
Time Limit Exceeded
#include <cstdio> #include <iostream> using namespace std; int main() { int x, y; int ans = 0; while (scanf("%d%d", &x, &y)) { ans = 0; ans = x + y / 2; printf("%d\n", ans); } return 0; }
#include <cstdio> #include <iostream> using namespace std; int main() { int x, y; int ans = 0; scanf("%d%d", &x, &y); ans = 0; ans = x + y / 2; printf("%d\n", ans); return 0; }
replace
8
13
8
12
TLE
p03219
Python
Runtime Error
x, y = map(int(), input().split(" ")) print(x + y // 2)
x, y = map(int, input().split(" ")) print(x + y // 2)
replace
0
1
0
1
TypeError: 'int' object is not callable
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03219/Python/s777207884.py", line 1, in <module> x, y = map(int(), input().split(' ')) TypeError: 'int' object is not callable
p03219
Python
Runtime Error
x, y = map(int, input().split()) print(int(x + y / 2)) x, y = map(int, input().split()) print(int(x + y / 2))
x, y = map(int, input().split()) print(int(x + y / 2))
delete
3
6
3
3
EOFError: EOF when reading a line
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03219/Python/s372051841.py", line 4, in <module> x, y = map(int, input().split()) EOFError: EOF when reading a line
p03219
Python
Runtime Error
def solve(): x, y = map(int, input()) return x + y // 2 if __name__ == "__main__": print(solve())
def solve(): x, y = map(int, input().split()) return x + y // 2 if __name__ == "__main__": print(solve())
replace
1
2
1
2
ValueError: invalid literal for int() with base 10: ' '
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03219/Python/s803037603.py", line 7, in <module> print(solve()) File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03219/Python/s803037603.py", line 2, in solve x, y = map(int, input()) ...
p03219
C++
Runtime Error
/* !!!!!! !!!!!!!!!! !!!!!!!!!!!!!!! !!!!!!!!!!!!!! !!!!!!!!!!!!!!! !!!!!!!!!!!! !!!!!!!!!!!! !!!!!!!!!!!! !!!!!!!! ...
/* !!!!!! !!!!!!!!!! !!!!!!!!!!!!!!! !!!!!!!!!!!!!! !!!!!!!!!!!!!!! !!!!!!!!!!!! !!!!!!!!!!!! !!!!!!!!!!!! !!!!!!!! ...
replace
58
59
58
59
0
p03219
C++
Runtime Error
// Devarshi #include <bits/stdc++.h> using namespace std; #define mp make_pair #define mt make_tuple #define fi first #define se second #define pb push_back #define ll long long #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define rep(i, n) for (i = 0; i < n; i++) #define forn(i, n) ...
// Devarshi #include <bits/stdc++.h> using namespace std; #define mp make_pair #define mt make_tuple #define fi first #define se second #define pb push_back #define ll long long #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define rep(i, n) for (i = 0; i < n; i++) #define forn(i, n) ...
replace
44
52
44
46
0
p03219
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); freopen("input.txt", "r", stdin); int x, y; cin >> x >> y; cout << x + y / 2 << "\n"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); // freopen("input.txt", "r", stdin); int x, y; cin >> x >> y; cout << x + y / 2 << "\n"; return 0; }
replace
6
7
6
7
0
p03219
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define LL long long int main() { #ifndef ONLINE_JUDGE freopen("input.in", "r", stdin); freopen("output.out", "w", stdout); #endif ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int x, y; cin >> x >> y; cout << (x + y / 2) << endl; }
#include <bits/stdc++.h> using namespace std; #define LL long long int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int x, y; cin >> x >> y; cout << (x + y / 2) << endl; }
delete
6
10
6
6
0
p03220
Python
Runtime Error
n = int(input()) t, a = map(int, input().split()) list = [int(i) for i in input().split()] dif_list = [] answer = 0 for i in range(n): t_i = t - list(i) * 0.006 t_i_dif = abs(a - t_i) dif_list.append(t_i_dif) if min(dif_list) == t_i_dif: answer = i + 1 print(answer)
n = int(input()) t, a = map(int, input().split()) list = [int(i) for i in input().split()] dif_list = [] answer = 0 for i in range(n): t_i = t - list[i] * 0.006 t_i_dif = abs(a - t_i) dif_list.append(t_i_dif) if min(dif_list) == t_i_dif: answer = i + 1 print(answer)
replace
8
9
8
9
TypeError: 'list' object is not callable
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03220/Python/s862713349.py", line 9, in <module> t_i = t - list(i) * 0.006 TypeError: 'list' object is not callable
p03220
C++
Runtime Error
#include <algorithm> #include <cstdlib> #include <iostream> #include <map> #include <string> using namespace std; int main() { int N, T, A; int H[N + 10], min = 100000, B[N + 10], ans; double tem; cin >> N >> T >> A; for (int i = 0; i < N; i++) { cin >> H[i]; } for (int i = 0; i < N; i++) { tem =...
#include <algorithm> #include <cstdlib> #include <iostream> #include <map> #include <string> using namespace std; int main() { int N, T, A; int H[1009], ans; double tem, B[1009], min = 10000000; cin >> N >> T >> A; for (int i = 0; i < N; i++) { cin >> H[i]; } for (int i = 0; i < N; i++) { tem = T...
replace
8
10
8
10
0
p03220
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; double abs(double x, double y) { if (x >= y) { return x - y; } else { return y - x; } } int main() { int N, T, A; vector<int> H(N); for (int i = 0; i < N; i++) { cin >> H.at(i); } int ans = 1; double tem = abs(A, T - 0.006 * H.at(0)); for (i...
#include <bits/stdc++.h> using namespace std; double abs(double x, double y) { if (x >= y) { return x - y; } else { return y - x; } } int main() { int N, T, A; cin >> N >> T >> A; vector<int> H(N); for (int i = 0; i < N; i++) { cin >> H.at(i); } int ans = 1; double tem = abs(A, T - 0.00...
insert
12
12
12
13
0
p03220
C++
Runtime Error
/* chirag11032000 Chirag Thakur */ #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; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; typede...
/* chirag11032000 Chirag Thakur */ #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; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; typede...
replace
44
45
44
45
0
Time taken: 35ms
p03220
C++
Runtime Error
// Author: Jinhai Chen #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> using namespace std; const int INF = 0x3f3f3f3f; typedef long long ll; int n, A, t; const int maxn = 1e5 + 10; double h[maxn], a[maxn]; int main() { #ifndef ONLINE_JUDGE freopen("data.in", "r", stdin...
// Author: Jinhai Chen #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> using namespace std; const int INF = 0x3f3f3f3f; typedef long long ll; int n, A, t; const int maxn = 1e5 + 10; double h[maxn], a[maxn]; int main() { #ifndef ONLINE_JUDGE // freopen("data.in","r",stdin)...
replace
15
16
15
16
0
p03220
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; map<double, int> score; for (int i = 0; i < a; i++) { double d; cin >> d; score[b - d * 0.006] = i + 1; } double MIN = 10000000; int minkey = 0; for (auto p : score) { auto key = p.first; aut...
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; map<double, int> score; for (int i = 0; i < a; i++) { double d; cin >> d; score[b - d * 0.006] = i + 1; } double MIN = 10000000; double minkey = 0; for (auto p : score) { auto key = p.first; ...
replace
13
14
13
14
0
p03220
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) int main() { int n, t, a; cin >> n >> t >> a; int h[100]; rep(i, n) { cin >> h[i]; } float tmp, dif = FLT_MAX; int ans; rep(i, n) { tmp = t - h[i] * 0.006; if (dif > abs(tmp - a)) { ans = i + 1; ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) int main() { int n, t, a; cin >> n >> t >> a; int h[1000]; rep(i, n) { cin >> h[i]; } float tmp, dif = FLT_MAX; int ans; rep(i, n) { tmp = t - h[i] * 0.006; if (dif > abs(tmp - a)) { ans = i + 1; ...
replace
6
7
6
7
0
p03220
Python
Runtime Error
n = int(input()) t, a = map(int, input().split()) t *= 1000 a *= 1000 lst = list(map(int, input().split())) tmp = abs(t - 6 * lst[0] - a) tmpa = 0 for i in range(1, n): temp = abs(t - 6 * lst[i] - a) if temp < tmp: tmp = tmp tmpa = i print(tmpa + 1) n = int(input()) t, a = map(int, input().split...
n = int(input()) t, a = map(int, input().split()) t *= 1000 a *= 1000 lst = list(map(int, input().split())) tmp = abs(t - 6 * lst[0] - a) tmpa = 0 for i in range(1, n): temp = abs(t - 6 * lst[i] - a) if temp < tmp: tmp = temp tmpa = i print(tmpa + 1)
delete
0
13
0
0
EOFError: EOF when reading a line
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03220/Python/s164286419.py", line 14, in <module> n = int(input()) EOFError: EOF when reading a line
p03220
C++
Runtime Error
#include <bits/stdc++.h> #define foreach(i, v) \ for (__typeof((v).begin()) i = (v).begin(); i != (v).end(); ++i) #define BETWEEN(a, x, b) (a <= x && x < b) using namespace std; typedef long long ll; int main(int argc, char *argv[]) { ios::sync_with_stdio(...
#include <bits/stdc++.h> #define foreach(i, v) \ for (__typeof((v).begin()) i = (v).begin(); i != (v).end(); ++i) #define BETWEEN(a, x, b) (a <= x && x < b) using namespace std; typedef long long ll; int main(int argc, char *argv[]) { ios::sync_with_stdio(...
replace
17
18
17
18
0
p03220
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define endl "\n" #define pb push_back #define f(i, n) for (i = 0; i < n; i++) #define F(i, a, b) for (i = a; a <= b; i++) #define arr(a, n) \ for (i = 0; i < n; i++) ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define endl "\n" #define pb push_back #define f(i, n) for (i = 0; i < n; i++) #define F(i, a, b) for (i = a; a <= b; i++) #define arr(a, n) \ for (i = 0; i < n; i++) ...
replace
51
57
51
57
-11
p03220
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> using namespace std; #define M 1003 int main() { int N, T, A, H[N]; double ret[N], re[N]; cin >> N >> T >> A; for (int i = 0; i < N; i++) { cin >> H[i]; ret[i] = abs(T - H[i] * 0.006 - A); re[i] = ret[i]; } sort(re, re + N); for (int i ...
#include <algorithm> #include <cmath> #include <iostream> using namespace std; #define M 1003 int main() { int N, T, A, H[M]; double ret[M], re[M]; cin >> N >> T >> A; for (int i = 0; i < N; i++) { cin >> H[i]; ret[i] = abs(T - H[i] * 0.006 - A); re[i] = ret[i]; } sort(re, re + N); for (int i ...
replace
6
8
6
8
0
p03220
Python
Runtime Error
N = int(input()) T, A = map(int, input().split()) (*H,) = [map(int, input().split())] min = 10000000 ans = 0 for i in range(N): if min > abs(A - T + H[i] * 0.006): min = abs(A - T + H[i] * 0.006) ans = i print(ans)
N = int(input()) T, A = map(int, input().split()) H = list(map(int, input().split())) X = [abs(A - (T - h * 0.006)) for h in H] print(X.index(min(X)) + 1)
replace
2
10
2
5
TypeError: unsupported operand type(s) for *: 'map' and 'float'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03220/Python/s870153227.py", line 7, in <module> if min > abs(A - T + H[i] * 0.006): TypeError: unsupported operand type(s) for *: 'map' and 'float'
p03220
Python
Runtime Error
n = int(input()) t, a = map(int, input().split()) b = [abs(a - (t - i * 0.006)) for i in list(map(int, input().split()))] print(b.index(min(b) + 1))
n = int(input()) t, a = map(int, input().split()) b = [abs(a - (t - i * 0.006)) for i in list(map(int, input().split()))] print(b.index(min(b)) + 1)
replace
3
4
3
4
ValueError: 2.0 is not in list
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03220/Python/s852227382.py", line 4, in <module> print(b.index(min(b) + 1)) ValueError: 2.0 is not in list
p03220
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, T, A; cin >> N >> T >> A; vector<int> H(N); int res = 0; int cc = 1 << 30; for (int i = 1; i <= N; i++) { cin >> H.at(i); int d = (T * 1000 - H.at(i) * 6) - A * 1000; if (d < 0) d = -d; if (cc > d) cc = d, res = ...
#include <bits/stdc++.h> using namespace std; int main() { int N, T, A; cin >> N >> T >> A; vector<int> H(N + 10); int res = 0; int cc = 1 << 30; for (int i = 1; i <= N; i++) { cin >> H.at(i); int d = (T * 1000 - H.at(i) * 6) - A * 1000; if (d < 0) d = -d; if (cc > d) cc = d, r...
replace
7
8
7
8
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 2) >= this->size() (which is 2)
p03221
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; #define rep(i, n) for (int i = 0; i < n; ++i) #define MOD (int)1e9 + 7 #define INF (int)2e9 int main() { int n, m; cin >> n >> m; int p[m], y[m]; map<int, vector<int>> mp; rep(i, m) { cin >> p[i] >> y[i]; m...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; #define rep(i, n) for (int i = 0; i < n; ++i) #define MOD (int)1e9 + 7 #define INF (int)2e9 int main() { int n, m; cin >> n >> m; int p[m], y[m]; map<int, vector<int>> mp; rep(i, m) { cin >> p[i] >> y[i]; m...
replace
24
31
24
28
TLE
p03221
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <string> #include <unordered_map> #include <utility> #include <vector> using namespace std; int main() { int N, M, i; cin >> N; cin >> M; vector<pair<int, int>> p(M); vector<int> Y(M); vector<int> app(M); vector<string> S...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <string> #include <unordered_map> #include <utility> #include <vector> using namespace std; int main() { int N, M, i; cin >> N; cin >> M; vector<pair<int, int>> p(M); vector<int> Y(M); vector<int> app(N); vector<string> S...
replace
18
19
18
19
0
p03221
C++
Runtime Error
#include <algorithm> #include <iomanip> #include <iostream> #include <vector> #define REP(i, n) for (int i = 0; i < (n); i++) #define PB push_back #define MP make_pair #define FI first #define SE second #define ALL(c) c.begin(), c.end() using namespace std; int main() { int N, M; cin >> N >> M; vector<vector<pa...
#include <algorithm> #include <iomanip> #include <iostream> #include <vector> #define REP(i, n) for (int i = 0; i < (n); i++) #define PB push_back #define MP make_pair #define FI first #define SE second #define ALL(c) c.begin(), c.end() using namespace std; int main() { int N, M; cin >> N >> M; vector<vector<pa...
replace
23
24
23
24
0
p03221
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) struct cities { int pref, city, idx; bool operator<(const cities &c) const { return (pref < c.pref || city < c.city); } }; int main() { int n, m, x = 0, y; cin >> n >> m; vector<cities> v(m); vector<pair...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) struct cities { int pref, city, idx; bool operator<(const cities &c) const { return (pref < c.pref || (pref == c.pref && city < c.city)); } }; int main() { int n, m, x = 0, y; cin >> n >> m; vector<cities>...
replace
6
7
6
7
0
p03221
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <regex> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #pragma region _define #define f(i, a, b) for (int i = a; i < b; i++) #define f_vI(v, ...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <regex> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #pragma region _define #define f(i, a, b) for (int i = a; i < b; i++) #define f_vI(v, ...
replace
82
84
82
84
0
p03221
Python
Time Limit Exceeded
n, m = map(int, input().split()) pys = [list(map(int, input().split())) for _ in range(m)] map_ = {} for i, (p, y) in enumerate(pys): map_.setdefault(p, []) for j in range(len(map_[p])): if y < pys[map_[p][j]][1]: map_[p].insert(j, i) break else: map_[p].append(i) ans...
n, m = map(int, input().split()) pys = [list(map(int, input().split())) for _ in range(m)] map_ = {} for i, (p, y) in enumerate(pys): map_.setdefault(p, []) map_[p].append(i) for val in map_.values(): val.sort(key=lambda i: pys[i][1]) ans = [None] * m for key, val in map_.items(): for num, i in enumer...
replace
5
11
5
10
TLE
p03221
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define pb...
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define pb...
replace
35
37
35
37
0
p03221
Python
Runtime Error
import collections City = collections.namedtuple("City", ("number", "pref", "year")) n, m = [int(i) for i in input().split()] cities = [] for i in range(m): pref, year = input().split() city = City(i, int(pref), int(year)) cities.append(city) id_numbers = [] cities.sort(key=lambda x: x.year) cities.sort(k...
import collections City = collections.namedtuple("City", ("number", "pref", "year")) n, m = [int(i) for i in input().split()] cities = [] for i in range(m): pref, year = input().split() city = City(i, int(pref), int(year)) cities.append(city) id_numbers = [] cities.sort(key=lambda x: x.year) cities.sort(k...
replace
23
24
23
24
0
p03221
C++
Runtime Error
/* * * * Author: Hamkor * * */ #include <bits/stdc++.h> using namespace std; /* * * * * * * * * * */ #define ll long long #define ld long double #define PII pair<int, int> #define PLL pair<ll, ll> #define VI vector<int> #define VII vector<pair<int, int>> #define VLL vector<pair<ll, ll>> #define PB push_back...
/* * * * Author: Hamkor * * */ #include <bits/stdc++.h> using namespace std; /* * * * * * * * * * */ #define ll long long #define ld long double #define PII pair<int, int> #define PLL pair<ll, ll> #define VI vector<int> #define VII vector<pair<int, int>> #define VLL vector<pair<ll, ll>> #define PB push_back...
replace
36
37
36
37
0