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
p02609
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using V = vector<int>; using VV = vector<V>; using VVV = vector<VV>; using VL = vector<ll>; using VVL = vector<VL>; using VVVL = vector<VVL>; template <class T> using VE = vector<T>; template <class T> using P = pair<T, ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using V = vector<int>; using VV = vector<V>; using VVV = vector<VV>; using VL = vector<ll>; using VVL = vector<VL>; using VVVL = vector<VVL>; template <class T> using VE = vector<T>; template <class T> using P = pair<T, ...
insert
80
80
80
99
0
p02609
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <iostream> #include <math.h> #include <queue> #include <string> #include <vector> #define all(x) (x).begin(), (x).end() typedef long long ll; using namespace std; int main() { int N; cin >> N; string X; cin >> X; vector<int> vu(N), vd(N), u(N), d(N); int mod...
#include <algorithm> #include <bitset> #include <iostream> #include <math.h> #include <queue> #include <string> #include <vector> #define all(x) (x).begin(), (x).end() typedef long long ll; using namespace std; int main() { int N; cin >> N; string X; cin >> X; vector<int> vu(N), vd(N), u(N), d(N); int mod...
replace
73
75
73
75
TLE
p02609
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <string> #include <unordered_map> #include <vector> ...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <string> #include <unordered_map> #include <vector> ...
replace
28
30
28
33
TLE
p02609
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define debug(x) cout << x #define pb push_back #include <string.h> ll modex(ll a, ll b, ll mod) { ll ans = 1; while (b) { if (b % 2) ans = (ans * a) % mod; a = (a * a) % mod; b /= 2; } return ans; } ll count(ll val) { ll cnt...
#include <bits/stdc++.h> using namespace std; #define ll long long #define debug(x) cout << x #define pb push_back #include <string.h> ll modex(ll a, ll b, ll mod) { ll ans = 1; while (b) { if (b % 2) ans = (ans * a) % mod; a = (a * a) % mod; b /= 2; } return ans; } ll count(ll val) { ll cnt...
replace
49
51
49
52
0
p02609
C++
Runtime Error
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using pll = pair<long long, long long>; constexpr char ln = '\n'; // constexpr long long MOD = 1000000007LL; constexpr long long INF = 1001001001LL; constexpr long long LINF = 100100100100100100...
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using pll = pair<long long, long long>; constexpr char ln = '\n'; // constexpr long long MOD = 1000000007LL; constexpr long long INF = 1001001001LL; constexpr long long LINF = 100100100100100100...
replace
50
51
50
54
0
p02609
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define pb push_back #define ll long long int #define mp make_pair #define S second #define F first ll mod = 1e9 + 7; #define fastIO \ ios_base::sync_with_stdio(false); ...
#include <bits/stdc++.h> using namespace std; #define pb push_back #define ll long long int #define mp make_pair #define S second #define F first ll mod = 1e9 + 7; #define fastIO \ ios_base::sync_with_stdio(false); ...
replace
24
25
24
26
-11
p02609
C++
Runtime Error
#include <bits/stdc++.h> #define pb push_back #define fi first #define se second #define int long long using namespace std; const int N = 500077; int n, m, d, t; char a[N]; int s1 = 0, s2 = 0; int binpow(int a, int n, int k) { if (n == 0) return 1 % k; if (n % 2 == 1) return binpow(a, n - 1, k) * a % k; ...
#include <bits/stdc++.h> #define pb push_back #define fi first #define se second #define int long long using namespace std; const int N = 500077; int n, m, d, t; char a[N]; int s1 = 0, s2 = 0; int binpow(int a, int n, int k) { if (n == 0) return 1 % k; if (n % 2 == 1) return binpow(a, n - 1, k) * a % k; ...
insert
77
77
77
78
0
p02609
C++
Runtime Error
#include <algorithm> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <vector> const int MOD = 1e9 + 7; const int MOOD = 998244353; #define PI 3.14159265359 typedef long long ll; using namespace std; int...
#include <algorithm> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <vector> const int MOD = 1e9 + 7; const int MOOD = 998244353; #define PI 3.14159265359 typedef long long ll; using namespace std; int...
replace
55
56
55
58
0
p02609
C++
Runtime Error
#include <bits/stdc++.h> #define REP(i, a, b) for (int i = a; i < b; i++) #define int long long #define mod 1000000009 #define garou \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); using namespace std; i...
#include <bits/stdc++.h> #define REP(i, a, b) for (int i = a; i < b; i++) #define int long long #define mod 1000000009 #define garou \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); using namespace std; i...
replace
50
51
50
53
0
p02609
C++
Runtime Error
#include <bits/stdc++.h> #define sz(x) ((int)x.size()) #define pb push_back #define ii pair<int, int> #define iii pair<ii, int> #define ppb pop_back #define st first #define nd second #define ll long long #define N 500005 #define inf 2000000005 #define MOD 1000000007 #define LOG 14 #define EPS 0.000000001 using namespa...
#include <bits/stdc++.h> #define sz(x) ((int)x.size()) #define pb push_back #define ii pair<int, int> #define iii pair<ii, int> #define ppb pop_back #define st first #define nd second #define ll long long #define N 500005 #define inf 2000000005 #define MOD 1000000007 #define LOG 14 #define EPS 0.000000001 using namespa...
insert
37
37
37
51
0
p02609
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define FIN \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); typedef long lo...
#include <bits/stdc++.h> using namespace std; #define FIN \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); typedef long lo...
replace
81
84
81
85
0
p02609
C++
Runtime Error
#ifndef LOCAL #pragma GCC optimize("O3") #endif #include "bits/stdc++.h" #include <ext/pb_ds/assoc_container.hpp> // Common file #include <ext/pb_ds/detail/standard_policies.hpp> #include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update using namespace std; using namespace __gnu_pbds; #define ...
#ifndef LOCAL #pragma GCC optimize("O3") #endif #include "bits/stdc++.h" #include <ext/pb_ds/assoc_container.hpp> // Common file #include <ext/pb_ds/detail/standard_policies.hpp> #include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update using namespace std; using namespace __gnu_pbds; #define ...
insert
108
108
108
125
0
p02609
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define rep(i, n) for (int i = 0; i < n; i++) const ll MOD = 1000000007; const long double PI = 3.14159265358979; const ll MAX = 0; ll ff(ll x, ll n, ll a) { if (x == 0) { return a; } x %= n; ll nx = x; ll nn = 0; while (nx > 0) { i...
#include <bits/stdc++.h> using namespace std; #define ll long long #define rep(i, n) for (int i = 0; i < n; i++) const ll MOD = 1000000007; const long double PI = 3.14159265358979; const ll MAX = 0; ll ff(ll x, ll n, ll a) { if (x == 0) { return a; } x %= n; ll nx = x; ll nn = 0; while (nx > 0) { i...
replace
100
101
100
101
0
p02609
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
62
63
62
63
0
p02609
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include...
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include...
replace
87
88
87
89
0
p02609
C++
Runtime Error
#define _USE_MATH_DEFINES #include <algorithm> #include <bitset> #include <cctype> #include <climits> #include <cmath> #include <cstdint> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <new> #include <queue> #include <set> #include <sstream> #include <stack> #include...
#define _USE_MATH_DEFINES #include <algorithm> #include <bitset> #include <cctype> #include <climits> #include <cmath> #include <cstdint> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <new> #include <queue> #include <set> #include <sstream> #include <stack> #include...
insert
73
73
73
78
0
p02609
C++
Runtime Error
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <vector> #define F first #define S second #define all(a) a.begin(), a.end() #define setDP(arr) memset(arr, -1, sizeof arr) #define ...
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <vector> #define F first #define S second #define all(a) a.begin(), a.end() #define setDP(arr) memset(arr, -1, sizeof arr) #define ...
replace
75
76
75
77
0
p02609
C++
Runtime Error
#include <bits/stdc++.h> #define int long long typedef long long ll; using namespace std; const ll MAXN = 200000; const ll INF = 1001001001; const ll MOD = 1000000007; ll N, ans = 0, tmp = 0, tmpp = 0, tmpn = 0; vector<ll> A; string S; ll modpow(ll a, ll n, ll mod) { ll res = 1; while (n > 0) { if (n & 1) ...
#include <bits/stdc++.h> #define int long long typedef long long ll; using namespace std; const ll MAXN = 200000; const ll INF = 1001001001; const ll MOD = 1000000007; ll N, ans = 0, tmp = 0, tmpp = 0, tmpn = 0; vector<ll> A; string S; ll modpow(ll a, ll n, ll mod) { ll res = 1; while (n > 0) { if (n & 1) ...
insert
32
32
32
65
0
p02609
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> using namespace std; long long N, num = 0, xx, uu, dd; char str[400000]; inline long long calc(long long ...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> using namespace std; long long N, num = 0, xx, uu, dd; char str[400000]; inline long long calc(long long ...
replace
39
40
39
41
0
p02609
C++
Runtime Error
// #pragma warning(disable:4996) #include <algorithm> #include <bitset> #include <cassert> #include <functional> #include <iomanip> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <vector> // #include ...
// #pragma warning(disable:4996) #include <algorithm> #include <bitset> #include <cassert> #include <functional> #include <iomanip> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <vector> // #include ...
insert
112
112
112
116
0
p02609
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; int pcnt(int x) { return __builtin_popcount(x); } int f(int x) { if (x == 0) return 0; return f(x % pcnt(x)) + 1; } int main() { int n; cin >> n; string s; cin >> s; vector<int> x(n); for (int i = 0; i < n; ++i) x[i] = s[i] -...
#include <bits/stdc++.h> using namespace std; using ll = long long; int pcnt(int x) { return __builtin_popcount(x); } int f(int x) { if (x == 0) return 0; return f(x % pcnt(x)) + 1; } int main() { int n; cin >> n; string s; cin >> s; vector<int> x(n); for (int i = 0; i < n; ++i) x[i] = s[i] -...
insert
30
30
30
33
0
p02609
C++
Runtime Error
#define _GLIBCXX_DEBUG #define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using vi = vector<int>; using vvi = vector<vi>; using vl = vector<ll>; #define rep0(TMS) for (int CNT = 0; CNT < (int)(TMS); CNT++) #define rep(CNT, GOAL) for (int CNT = 0; CN...
#define _GLIBCXX_DEBUG #define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using vi = vector<int>; using vvi = vector<vi>; using vl = vector<ll>; #define rep0(TMS) for (int CNT = 0; CNT < (int)(TMS); CNT++) #define rep(CNT, GOAL) for (int CNT = 0; CN...
insert
174
174
174
193
0
p02609
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); int n; string s; cin >> n >> s; int cnt = 0; for (auto c : s) { cnt += (c == '1'); } auto poly = [&](int mod) { vector<int> r(n); r[0] = 1; for (int i = 1; i < n; i++) { r[i] = r[i - 1...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); int n; string s; cin >> n >> s; int cnt = 0; for (auto c : s) { cnt += (c == '1'); } // special if (cnt == 0) { for (int i = 0; i < n; i++) { cout << 1 << '\n'; } return 0; } if ...
insert
14
14
14
35
0
p02609
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; #define p_ary(ary, a, b) \ do { \ cout << "["; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; #define p_ary(ary, a, b) \ do { \ cout << "["; ...
replace
71
72
71
72
TLE
p02609
C++
Runtime Error
#pragma GCC optimize("O3") // コンパイラ最適化用 #define _GLIBCXX_DEBUG // 配列に[]でアクセス時のエラー表示 #include <bits/stdc++.h> using namespace std; typedef long long ll; // forループ関係 // 引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか // Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはメントされる #define REP(i, n) for (ll i = 0; i < ll(n); i++) #define REP...
#pragma GCC optimize("O3") // コンパイラ最適化用 #define _GLIBCXX_DEBUG // 配列に[]でアクセス時のエラー表示 #include <bits/stdc++.h> using namespace std; typedef long long ll; // forループ関係 // 引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか // Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはメントされる #define REP(i, n) for (ll i = 0; i < ll(n); i++) #define REP...
insert
62
62
62
64
0
p02609
C++
Runtime Error
#ifndef DEBUG #pragma GCC optimize("O3,unroll-loops") #pragma loop_opt(on) #endif #include <bits/stdc++.h> using namespace std; #ifdef DEBUG #define FAST ; #else #define FAST \ ios::sync_with_stdio(0); ...
#ifndef DEBUG #pragma GCC optimize("O3,unroll-loops") #pragma loop_opt(on) #endif #include <bits/stdc++.h> using namespace std; #ifdef DEBUG #define FAST ; #else #define FAST \ ios::sync_with_stdio(0); ...
insert
37
37
37
39
0
p02609
C++
Runtime Error
#include <algorithm> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; using ll = long long; using ld = long double; usi...
#include <algorithm> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; using ll = long long; using ld = long double; usi...
insert
69
69
69
85
0
p02609
C++
Runtime Error
#pragma region head #include <bits/stdc++.h> using namespace std; #define pb push_back #define fi first #define se second #define mp make_pair #define all(x) (x).begin(), (x).end() #define rep(i, n) for (int i = 0; i < (n); ++i) #define repp(i, a, b) for (int i = a; i <= (b); ++i) #define repr(i, a, b) for (int i = a; ...
#pragma region head #include <bits/stdc++.h> using namespace std; #define pb push_back #define fi first #define se second #define mp make_pair #define all(x) (x).begin(), (x).end() #define rep(i, n) for (int i = 0; i < (n); ++i) #define repp(i, a, b) for (int i = a; i <= (b); ++i) #define repr(i, a, b) for (int i = a; ...
insert
93
93
93
125
0
p02609
Python
Runtime Error
import math def f(n): pop = 0 ntemp = n for i in range(int(math.log2(n)) + 1): pop += ntemp % 2 ntemp //= 2 return n % pop n = int(input()) S = input() popcount = 0 for i in range(n): popcount += int(S[i]) Sint = int(S, 2) remminus = Sint % (popcount - 1) remplus = Sint % (popcou...
import math def f(n): pop = 0 ntemp = n for i in range(int(math.log2(n)) + 1): pop += ntemp % 2 ntemp //= 2 return n % pop n = int(input()) S = input() popcount = 0 for i in range(n): popcount += int(S[i]) # 1が1個しかない場合の例外処理 if popcount == 1: if S[-1] == 1: ans = [2] ...
insert
17
17
17
34
0
p02609
C++
Runtime Error
// #include<bits/stdc++.h> #include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <memory> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <utility> #include <v...
// #include<bits/stdc++.h> #include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <memory> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <utility> #include <v...
insert
175
175
175
177
0
p02609
Python
Runtime Error
N = int(input()) X = input() Xi = int(X, 2) c0 = X.count("1") Xp = Xi % (c0 + 1) Xm = Xi % (c0 - 1) for i, x in enumerate(X): if x == "1": if c0 == 1: print(0) continue y = (Xm - pow(2, N - 1 - i, c0 - 1)) % (c0 - 1) else: y = (Xp + pow(2, N - 1 - i, c0 + 1)) % ...
N = int(input()) X = input() Xi = int(X, 2) c0 = X.count("1") Xp = Xi % (c0 + 1) if c0 != 1: Xm = Xi % (c0 - 1) for i, x in enumerate(X): if x == "1": if c0 == 1: print(0) continue y = (Xm - pow(2, N - 1 - i, c0 - 1)) % (c0 - 1) else: y = (Xp + pow(2, N - 1...
replace
6
7
6
9
0
p02609
Python
Runtime Error
def main(): N = int(input()) (*X,) = map(int, input()) memo = [-1] * 21 def f(x): ret = 0 while x > 0: x = x % bin(x)[2:].count("1") ret += 1 return ret for x in range(21): memo[x] = f(x) cnt = X.count(1) pow2_0_1 = [1] pow2_1_...
def main(): N = int(input()) (*X,) = map(int, input()) memo = [-1] * 21 def f(x): ret = 0 while x > 0: x = x % bin(x)[2:].count("1") ret += 1 return ret for x in range(21): memo[x] = f(x) cnt = X.count(1) if cnt == 1: ans =...
insert
17
17
17
35
0
p02609
Python
Runtime Error
from functools import lru_cache N = int(input()) X = input() @lru_cache(maxsize=None) def popcount(x): return x % bin(x).count("1") def f(x): cnt = 1 while x > 0: x = popcount(x) cnt += 1 return cnt count = X.count("1") mod_one = count - 1 mod_zero = count + 1 ones = [1 % mod_one...
from functools import lru_cache N = int(input()) X = input() @lru_cache(maxsize=None) def popcount(x): return x % bin(x).count("1") def f(x): cnt = 1 while x > 0: x = popcount(x) cnt += 1 return cnt count = X.count("1") mod_one = count - 1 if mod_one == 0: mod_one = 1 mod_zer...
insert
22
22
22
24
0
p02609
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using i64 = long long; #define rep(i, s, e) for (i64(i) = (s); (i) < (e); (i)++) #define all(x) x.begin(), x.end() #define STRINGIFY(n) #n #define TOSTRING(n) STRINGIFY(n) #define PREFIX "#" TOSTRING(__LINE__) "| " #define debug(x) ...
#include <bits/stdc++.h> using namespace std; using i64 = long long; #define rep(i, s, e) for (i64(i) = (s); (i) < (e); (i)++) #define all(x) x.begin(), x.end() #define STRINGIFY(n) #n #define TOSTRING(n) STRINGIFY(n) #define PREFIX "#" TOSTRING(__LINE__) "| " #define debug(x) ...
replace
96
97
96
97
0
p02609
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; long modpow(long a, long b, long mod) { long res = 1; while (b > 0) { if (b & 1) res = res * a % mod; a = a * a % mod; b /= 2; } return res; } int main() { int n; string s; cin >> n >> s; int one = 0; for (int i = 0; i < n; i++) if (s...
#include <bits/stdc++.h> using namespace std; long modpow(long a, long b, long mod) { long res = 1; while (b > 0) { if (b & 1) res = res * a % mod; a = a * a % mod; b /= 2; } return res; } int main() { int n; string s; cin >> n >> s; int one = 0; for (int i = 0; i < n; i++) if (s...
replace
30
31
30
31
0
p02609
C++
Runtime Error
#include <algorithm> #include <assert.h> #include <bitset> #include <complex> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <...
#include <algorithm> #include <assert.h> #include <bitset> #include <complex> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <...
insert
112
112
112
116
0
p02609
C++
Runtime Error
#include <algorithm> #include <bitset> #include <climits> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; using ll = long long int; const ll MOD = 1e9 + 5; ll mod_pow(ll k, ll p) { if (k == 0) { return 1 % p; } if (k == 1) { return 2 % p; } if (k % 2 == 0...
#include <algorithm> #include <bitset> #include <climits> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; using ll = long long int; const ll MOD = 1e9 + 5; ll mod_pow(ll k, ll p) { if (k == 0) { return 1 % p; } if (k == 1) { return 2 % p; } if (k % 2 == 0...
replace
51
52
51
52
-11
p02609
C++
Runtime Error
/* this->author = Fuad Ashraful Mehmet, CSE-UAP ToDo-- uva 1223 */ #include <bits/stdc++.h> #define forn(i, n) for (int i = 0; i < (int)n; ++i) #define all(o) (o).begin(), (o).end() #define dbg(o) cerr << "at " << __LINE__ << " response = " << o << endl; using namespace std; /* #include <ext/pb_ds/assoc_container...
/* this->author = Fuad Ashraful Mehmet, CSE-UAP ToDo-- uva 1223 */ #include <bits/stdc++.h> #define forn(i, n) for (int i = 0; i < (int)n; ++i) #define all(o) (o).begin(), (o).end() #define dbg(o) cerr << "at " << __LINE__ << " response = " << o << endl; using namespace std; /* #include <ext/pb_ds/assoc_container...
replace
95
96
95
96
0
p02609
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; int popcount(int n) { int ans = 0; while (n != 0) { ans += n % 2; n = n / 2; } return ans; } int times(int n) { int ans = 0; while (n != 0) { n = n % popcount(n); ans++; } return ans; } int calc(int n, string s) { i...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int popcount(int n) { int ans = 0; while (n != 0) { ans += n % 2; n = n / 2; } return ans; } int times(int n) { int ans = 0; while (n != 0) { n = n % popcount(n); ans++; } return ans; } int calc(int n, string s) { i...
insert
48
48
48
66
0
p02609
C++
Runtime Error
#include <iostream> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int N; int pcnt(int x) { return __builtin_popcount(x); } int f(int a) { if (a == 0) return 0; return f(a % pcnt(a)) + 1; } int main() { cin >> N; string s; cin >> s; vector<in...
#include <iostream> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int N; int pcnt(int x) { return __builtin_popcount(x); } int f(int a) { if (a == 0) return 0; return f(a % pcnt(a)) + 1; } int main() { cin >> N; string s; cin >> s; vector<in...
insert
33
33
33
35
0
p02609
C++
Runtime Error
#include <bits/stdc++.h> #define MAX 100007 using namespace std; int pw[MAX][3]; int sum[3]; int n; string x; void calc(int cnt, int idx) { if (cnt <= 0) return; pw[0][idx] = 1; for (int i = 1; i < MAX; i++) { pw[i][idx] = 2 * pw[i - 1][idx]; pw[i][idx] %= cnt; } for (int i = 0; i < x.length();...
#include <bits/stdc++.h> #define MAX 200007 using namespace std; int pw[MAX][3]; int sum[3]; int n; string x; void calc(int cnt, int idx) { if (cnt <= 0) return; pw[0][idx] = 1; for (int i = 1; i < MAX; i++) { pw[i][idx] = 2 * pw[i - 1][idx]; pw[i][idx] %= cnt; } for (int i = 0; i < x.length();...
replace
1
2
1
2
0
p02609
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define deb(x...
#include <bits/stdc++.h> #define ll long long #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define deb(x...
insert
44
44
44
46
0
p02609
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> using namespace std; typedef long long ll; typedef vector<ll> v; typedef vector<vector<ll>> vv; #define MOD 1000000007 #defi...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> using namespace std; typedef long long ll; typedef vector<ll> v; typedef vector<vector<ll>> vv; #define MOD 1000000007 #defi...
replace
59
63
59
61
0
p02609
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define PI 3.14159265358979323 #define ll long long int #define vi vector<int> #define vl vector<ll> #define all(v) (v).begin(), (v).end() #define pb push_back #define watch(x) cout << (#x) << " is " << (x) << "\n" ll power(ll a, ll b, ll MOD) { // a^b ll res = 1; a = ...
#include <bits/stdc++.h> using namespace std; #define PI 3.14159265358979323 #define ll long long int #define vi vector<int> #define vl vector<ll> #define all(v) (v).begin(), (v).end() #define pb push_back #define watch(x) cout << (#x) << " is " << (x) << "\n" ll power(ll a, ll b, ll MOD) { // a^b ll res = 1; a = ...
replace
71
73
71
76
-8
p02609
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rep2(i, x, n) for (int i = x; i <= n; i++) #define rep3(i, x, n) for (int i = x; i >= n; i--) #define elif else if #define sp(x) fixed << setprecision(x) #define pb push_back #define eb emplace_back #define all(x) x.begi...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rep2(i, x, n) for (int i = x; i <= n; i++) #define rep3(i, x, n) for (int i = x; i >= n; i--) #define elif else if #define sp(x) fixed << setprecision(x) #define pb push_back #define eb emplace_back #define all(x) x.begi...
insert
52
52
52
56
0
p02609
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> dp(n + 1); for (int i = 1; i <= n; i++) { int cnt = 0; for (int j = 0; j < 20; j++) if (i & (1 << j)) cnt++; dp[i] = dp[i % cnt] + 1; } int modulo = 0; vect...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> dp(n + 1); for (int i = 1; i <= n; i++) { int cnt = 0; for (int j = 0; j < 20; j++) if (i & (1 << j)) cnt++; dp[i] = dp[i % cnt] + 1; } int modulo = 0; vect...
replace
29
30
29
30
0
p02609
C++
Runtime Error
// D - Anything Goes to Zero #include <bits/stdc++.h> using namespace std; typedef long long ll; // const int INF = 2147483647; // const ll INF = 9223372036854775807; // const ll MOD = 1e9 + 7; ll rem[2][200000]; ll rem_sum[2]; // aのn乗をmodで割った余りを計算 ll mod_pow(ll a, ll n, ll mod) { ll result = 1; while (n > 0) {...
// D - Anything Goes to Zero #include <bits/stdc++.h> using namespace std; typedef long long ll; // const int INF = 2147483647; // const ll INF = 9223372036854775807; // const ll MOD = 1e9 + 7; ll rem[2][200000]; ll rem_sum[2]; // aのn乗をmodで割った余りを計算 ll mod_pow(ll a, ll n, ll mod) { ll result = 1; while (n > 0) {...
replace
56
57
56
58
0
p02609
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long ll mod = pow(10, 9) + 7; ll pw(ll n, ll mod) { ll ans = 1; ll x = 2, y = n; while (y != 0) { if (y % 2) ans = ((ans % mod) * (x % mod)) % mod; x = ((x % mod) * (x % mod)) % mod; y /= 2; } return ans; } ll cunt(ll n) { l...
#include <bits/stdc++.h> using namespace std; #define ll long long ll mod = pow(10, 9) + 7; ll pw(ll n, ll mod) { ll ans = 1; ll x = 2, y = n; while (y != 0) { if (y % 2) ans = ((ans % mod) * (x % mod)) % mod; x = ((x % mod) * (x % mod)) % mod; y /= 2; } return ans; } ll cunt(ll n) { l...
insert
60
60
60
74
0
p02609
C++
Runtime Error
#include <algorithm> #include <iostream> #include <string> using namespace std; using llong = long long; #define inv(X) ((X) == '1' ? '0' : '1') llong n; string x; llong bitcnt(llong a) { llong ret = 0; while (a > 0) { if (a & 1) ret++; a >>= 1; } return ret; } llong f(llong x) { llong cnt = ...
#include <algorithm> #include <iostream> #include <string> using namespace std; using llong = long long; #define inv(X) ((X) == '1' ? '0' : '1') llong n; string x; llong bitcnt(llong a) { llong ret = 0; while (a > 0) { if (a & 1) ret++; a >>= 1; } return ret; } llong f(llong x) { llong cnt = ...
replace
59
60
59
62
0
p02609
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define Rep(i, a, b) for (int i = a; i <= b; i++) #define _Rep(i, a, b) for (int i = a; i >= b; i--) #define RepG(i, u) for (int i = head[u]; ~i; i = e[i].next) typedef long long ll; const int N = 2e5 + 5; template <typename T> void read(T &x) { x = 0; int f = 1; ...
#include <bits/stdc++.h> using namespace std; #define Rep(i, a, b) for (int i = a; i <= b; i++) #define _Rep(i, a, b) for (int i = a; i >= b; i--) #define RepG(i, u) for (int i = head[u]; ~i; i = e[i].next) typedef long long ll; const int N = 2e5 + 5; template <typename T> void read(T &x) { x = 0; int f = 1; ...
insert
53
53
53
60
0
p02609
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define REP(i, n) for (int i = 1; i <= n; i++) typedef long long ll; // べき乗高速化 ll mpow(ll x, ll n, ll M) { ll ans = 1; while (n != 0) { if (n & 1) ans = ans * x % M; x = x * x % M; n = n >> 1; } retur...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define REP(i, n) for (int i = 1; i <= n; i++) typedef long long ll; // べき乗高速化 ll mpow(ll x, ll n, ll M) { ll ans = 1; while (n != 0) { if (n & 1) ans = ans * x % M; x = x * x % M; n = n >> 1; } retur...
replace
36
37
36
37
0
p02609
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define LL long long #define F(i, a, b) for (int i = a; i <= b; ++i) const int maxn = 2e5 + 5; int n, a[maxn], pw1[maxn], pw2[maxn], f[maxn], sum1 = 0, sum2 = 0, tot = 0; char s[maxn]; int pct(int x) { return x == 0 ? x : pct(x >> 1) + (x & 1); } void run(int p) { a[p] ^=...
#include <bits/stdc++.h> using namespace std; #define LL long long #define F(i, a, b) for (int i = a; i <= b; ++i) const int maxn = 2e5 + 5; int n, a[maxn], pw1[maxn], pw2[maxn], f[maxn], sum1 = 0, sum2 = 0, tot = 0; char s[maxn]; int pct(int x) { return x == 0 ? x : pct(x >> 1) + (x & 1); } void run(int p) { a[p] ^=...
replace
44
45
44
45
0
p02609
C++
Runtime Error
#include <bits/stdc++.h> typedef long long ll; using namespace std; #define repr(i, a, b) for (int i = a; i < b; i++) #define rep(i, n) for (int i = 0; i < n; i++) #define invrepr(i, a, b) for (int i = b - 1; i >= a; i--) #define invrep(i, n) invrepr(i, 0, n) #define repitr(itr, a) for (auto itr = a.begin(); itr != a.e...
#include <bits/stdc++.h> typedef long long ll; using namespace std; #define repr(i, a, b) for (int i = a; i < b; i++) #define rep(i, n) for (int i = 0; i < n; i++) #define invrepr(i, a, b) for (int i = b - 1; i >= a; i--) #define invrep(i, n) invrepr(i, 0, n) #define repitr(itr, a) for (auto itr = a.begin(); itr != a.e...
replace
42
44
42
44
0
p02609
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; template <typename T> T mod_pow(T x, T n, const T &p) { T ret = 1; while (n > 0) { if (n & 1) (ret *= x) %= p; (x *= x) %= p; n >>= 1; } return ret; } void solve(long long N, std::string X) { ll ori...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; template <typename T> T mod_pow(T x, T n, const T &p) { T ret = 1; while (n > 0) { if (n & 1) (ret *= x) %= p; (x *= x) %= p; n >>= 1; } return ret; } void solve(long long N, std::string X) { ll ori...
replace
39
40
39
42
0
p02609
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define lli long long #define all(i) i.begin(), i.end() #define rall(i) i.rbegin(), i.rend() #define rep0(i, j) for (int i = 0; i < j; i++) #define rep1(i, j) for (int i = 1; i <= j; i++) #define rep0d(i, j) for (int i = j - 1; i >= 0; i--) #define MOD 1000000007 #define M...
#include <bits/stdc++.h> using namespace std; #define lli long long #define all(i) i.begin(), i.end() #define rall(i) i.rbegin(), i.rend() #define rep0(i, j) for (int i = 0; i < j; i++) #define rep1(i, j) for (int i = 1; i <= j; i++) #define rep0d(i, j) for (int i = j - 1; i >= 0; i--) #define MOD 1000000007 #define M...
replace
217
218
217
218
0
p02609
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define repn(i, n) for (int i = 1; i <= n; i++) #define LL long long #define pii pair<int, int> #define fi first #define se second #define pb push_back #define mpr make_pair using namespace std; const LL MOD = 1e9 + 7; LL n, pwm1[200020], pw[200...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define repn(i, n) for (int i = 1; i <= n; i++) #define LL long long #define pii pair<int, int> #define fi first #define se second #define pb push_back #define mpr make_pair using namespace std; const LL MOD = 1e9 + 7; LL n, pwm1[200020], pw[200...
insert
52
52
52
56
0
p02609
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; // #define int long long #define rep(i, n) for (long long i = (long long)(0); i < (long long)(n); ++i) #define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i) #define rrep(i, n) for (long long i = ((long long)(n)-1); i >= 0; i--) #define rreps(i, n)...
#include <bits/stdc++.h> using namespace std; // #define int long long #define rep(i, n) for (long long i = (long long)(0); i < (long long)(n); ++i) #define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i) #define rrep(i, n) for (long long i = ((long long)(n)-1); i >= 0; i--) #define rreps(i, n)...
replace
107
111
107
112
0
p02609
C++
Runtime Error
#include <bits/stdc++.h> #define del(a, i) memset(a, i, sizeof(a)) #define ll long long #define inl inline #define il inl void #define it inl int #define ill inl ll #define re register #define ri re int #define rl re ll #define mid ((l + r) >> 1) #define lowbit(x) (x & (-x)) #define INF 0x3f3f3f3f using namespace std; ...
#include <bits/stdc++.h> #define del(a, i) memset(a, i, sizeof(a)) #define ll long long #define inl inline #define il inl void #define it inl int #define ill inl ll #define re register #define ri re int #define rl re ll #define mid ((l + r) >> 1) #define lowbit(x) (x & (-x)) #define INF 0x3f3f3f3f using namespace std; ...
insert
74
74
74
78
0
0.023342
p02609
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <vector> using namespace std; using lint = long long; #ifdef _DEBUG #include "../../library/library/debug_temp...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <vector> using namespace std; using lint = long long; #ifdef _DEBUG #include "../../library/library/debug_temp...
replace
69
70
69
71
0
p02609
C++
Runtime Error
const int LG = 21; const int N = 400005; const long long MOD = 1e9 + 7; const long long INF = 1e9; const long long INFLL = 1e18; #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<int> vi; typedef vector<vector<int>> vvi; typedef v...
const int LG = 21; const int N = 400005; const long long MOD = 1e9 + 7; const long long INF = 1e9; const long long INFLL = 1e18; #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<int> vi; typedef vector<vector<int>> vvi; typedef v...
insert
244
244
244
275
0
p02610
C++
Runtime Error
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iostream> #include <iterator> #include <limits> #include <map> #include <memory> #include <numeric> #includ...
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iostream> #include <iterator> #include <limits> #include <map> #include <memory> #include <numeric> #includ...
replace
316
317
316
317
-6
free(): invalid pointer
p02610
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define NDEBUG #include <cassert> typedef long long ll; typedef long double Double; typedef unsigned long long ull; typedef pair<int, int> ii; typedef pair<ll, ll> llll; typedef pair<double, double> dd; typedef vector<int> vi; typedef vector<vector<int>> vvi; typedef vec...
#include <bits/stdc++.h> using namespace std; #define NDEBUG #include <cassert> typedef long long ll; typedef long double Double; typedef unsigned long long ull; typedef pair<int, int> ii; typedef pair<ll, ll> llll; typedef pair<double, double> dd; typedef vector<int> vi; typedef vector<vector<int>> vvi; typedef vec...
insert
170
170
170
171
TLE
p02610
C++
Runtime Error
#include <algorithm> #include <iostream> #include <set> #include <vector> using namespace std; typedef long long li; #define rep(i, n) for (int i = 0; i < (n); i++) #define df 0 template <class T> void print(const T &t) { cout << t << "\n"; } template <class T, class... Ts> void print(const T &t, const Ts &...ts) { c...
#include <algorithm> #include <iostream> #include <set> #include <vector> using namespace std; typedef long long li; #define rep(i, n) for (int i = 0; i < (n); i++) #define df 0 template <class T> void print(const T &t) { cout << t << "\n"; } template <class T, class... Ts> void print(const T &t, const Ts &...ts) { c...
insert
18
18
18
20
0
p02610
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; // #define int long long #define DEBUG(x) cout << '>' << #x << ':' << x << endl; #define REP(i, n) for (int i = 0; i < (n); ++i) #define FOR(i, a, b) for (int i = (a); i <= (b); ++i) #define FORD(i, a, b) for (int i = (a); i >= (b); --i) inline bool EQ(double a, double b) {...
#include <bits/stdc++.h> using namespace std; // #define int long long #define DEBUG(x) cout << '>' << #x << ':' << x << endl; #define REP(i, n) for (int i = 0; i < (n); ++i) #define FOR(i, a, b) for (int i = (a); i <= (b); ++i) #define FORD(i, a, b) for (int i = (a); i >= (b); --i) inline bool EQ(double a, double b) {...
insert
53
53
53
57
TLE
p02610
C++
Runtime Error
#include <algorithm> #include <assert.h> #include <cmath> #include <complex> #include <cstring> #include <deque> #include <fstream> #include <iostream> #include <queue> #include <set> #include <string.h> #include <unordered_map> #include <vector> using namespace std; using ll = long long; using ld = long double; const ...
#include <algorithm> #include <assert.h> #include <cmath> #include <complex> #include <cstring> #include <deque> #include <fstream> #include <iostream> #include <queue> #include <set> #include <string.h> #include <unordered_map> #include <vector> using namespace std; using ll = long long; using ld = long double; const ...
replace
16
17
16
17
0
p02610
C++
Runtime Error
#include <algorithm> #include <assert.h> #include <bitset> #include <complex> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #defin...
#include <algorithm> #include <assert.h> #include <bitset> #include <complex> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #defin...
replace
57
58
57
58
-6
free(): double free detected in tcache 2
p02610
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; struct deve { long long k; long long l; long long r; } deva[200005]; bool us1[200005], us2[200005]; long long n, ans, ki, li, ri; multiset<pair<long long, int>> prve, zadnje; bool sort_deve(deve a, deve b) { if (a.k != b.k) return a.k < b.k; return abs(a.l - a...
#include <bits/stdc++.h> using namespace std; struct deve { long long k; long long l; long long r; } deva[200005]; bool us1[200005], us2[200005]; long long n, ans, ki, li, ri; multiset<pair<long long, int>> prve, zadnje; bool sort_deve(deve a, deve b) { if (a.k != b.k) return a.k < b.k; return a.l > b.l; ...
replace
13
14
13
14
0
p02610
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <stdio.h> #include <vector> // #define T int class T { public: int index; bool vacant; T() : index(-1), vacant(false) {} T(int index) : index(index), vacant(true) {} T(const T &value) : index(value.index), vacant(value.vacant) {} T &operator=(const T &val...
#include <algorithm> #include <iostream> #include <stdio.h> #include <vector> // #define T int class T { public: int index; bool vacant; T() : index(-1), vacant(false) {} T(int index) : index(index), vacant(true) {} T(const T &value) : index(value.index), vacant(value.vacant) {} T &operator=(const T &val...
replace
146
147
146
147
TLE
p02610
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int maxn = 100010; int T, n; vector<int> G[maxn], H[maxn]; int main() { scanf("%d", &T); while (T--) { scanf("%d", &n); for (int i = 1; i <= n; i++) { G[i].clear(), H[i].clear(); } long long ans = 0; for (int i = 1, K, L, R; i <= n; i++...
#include <bits/stdc++.h> using namespace std; const int maxn = 200010; int T, n; vector<int> G[maxn], H[maxn]; int main() { scanf("%d", &T); while (T--) { scanf("%d", &n); for (int i = 1; i <= n; i++) { G[i].clear(), H[i].clear(); } long long ans = 0; for (int i = 1, K, L, R; i <= n; i++...
replace
3
4
3
4
0
p02610
C++
Runtime Error
// #pragma GCC target ("avx") // #pragma GCC optimize("Ofast") // #pragma GCC optimize("unroll-loops") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> using namespace std; // #define int long long // #define endl '\n' #pragma region TEMPLATE /* TYPE */ typedef...
// #pragma GCC target ("avx") // #pragma GCC optimize("Ofast") // #pragma GCC optimize("unroll-loops") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> using namespace std; // #define int long long // #define endl '\n' #pragma region TEMPLATE /* TYPE */ typedef...
insert
279
279
279
281
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p02610
C++
Runtime Error
#include <algorithm> #include <assert.h> #include <cmath> #include <deque> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <set> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <unordered_map> #include <unordered_set> #include <vec...
#include <algorithm> #include <assert.h> #include <cmath> #include <deque> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <set> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <unordered_map> #include <unordered_set> #include <vec...
replace
75
77
75
77
0
p02611
C++
Time Limit Exceeded
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; #define FOR(i, m, n) for (int i = (m); i < (n); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(v) (v).begin(), (v).end() using ll = long long; const int INF = 0x3f3f3f3f; const ll LINF = 0x3f3f3f3f3f3f3f3fLL; const double EPS = 1e-8; const int MOD...
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; #define FOR(i, m, n) for (int i = (m); i < (n); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(v) (v).begin(), (v).end() using ll = long long; const int INF = 0x3f3f3f3f; const ll LINF = 0x3f3f3f3f3f3f3f3fLL; const double EPS = 1e-8; const int MOD...
replace
218
222
218
224
TLE
p02612
Python
Runtime Error
n = input() n = int(n[1:]) if 1000 - n == 1000: print(0) else: print(1000 - n)
n = int(input()) n = n % 1000 if 1000 - n == 1000: print(0) else: print(1000 - n)
replace
0
2
0
2
0
p02612
C++
Time Limit Exceeded
#include <iostream> int main() { int N = {}; // 商品代金 int change = {}; // お釣り int Min_value = 1; // 下限値 int Max_value = 10000; // 上限値 std::cin >> N; if (Min_value > N || N > Max_value) { std::cout << "予算を10000円を超えてます!" << std::endl; } while (N >= 1000) { if (N == 1000) { ...
#include <iostream> int main() { int N = {}; // 商品代金 int change = {}; // お釣り int Min_value = 1; // 下限値 int Max_value = 10000; // 上限値 std::cin >> N; if (Min_value > N || N > Max_value) { std::cout << "予算を10000円を超えてます!" << std::endl; } while (N >= 1000) { if (N == 1000) { ...
replace
20
21
20
21
TLE
p02612
Python
Runtime Error
# input N = int(input()) noguchi = [1000 * n for n in range(1, 11)] # check print(min([ngc - N for ngc in noguchi if (ngc - N) > 0]))
# input N = int(input()) noguchi = [1000 * n for n in range(1, 11)] # check print(min([ngc - N for ngc in noguchi if (ngc - N) >= 0]))
replace
5
6
5
6
0
p02612
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { long long n; scanf("%lld", n); int ans = n % 1000; cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int ans; ans = (1000 - n % 1000) % 1000; cout << ans << endl; return 0; }
replace
3
6
3
7
-11
p02612
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int t = n % 1000; return 1000 - t; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int t = n % 1000; if (t == 0) cout << "0"; else cout << 1000 - t; }
replace
6
7
6
10
100
p02612
C++
Runtime Error
// author rhythmicankur // god_is_almighty #pragma GCC optimize("O3") #pragma GCC target("sse4") #include <bits/stdc++.h> #define f first #define s second #define int long long #define ll int #define ld long double #define pb push_back #define eb emplace_back #define mk make_pair #define vi vector<int> #define pii pair...
// author rhythmicankur // god_is_almighty #pragma GCC optimize("O3") #pragma GCC target("sse4") #include <bits/stdc++.h> #define f first #define s second #define int long long #define ll int #define ld long double #define pb push_back #define eb emplace_back #define mk make_pair #define vi vector<int> #define pii pair...
replace
72
73
72
73
-6
terminate called after throwing an instance of 'std::__ios_failure' what(): basic_ios::clear: iostream error
p02612
C++
Time Limit Exceeded
#include <stdio.h> int main() { int p, c; scanf("%d", &p); for (c = 0; c < p; c = +1000) { c; } printf("%d", c - p); }
#include <stdio.h> int main() { int a; scanf("%d", &a); printf("%d\n", (1000 - (a - a / 1000 * 1000)) % 1000); return 0; }
replace
2
8
2
6
TLE
p02612
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int cost; cin >> cost; int money = 0; while (money < cost) { money + 1000; } cout << money - cost << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int cost; cin >> cost; int money = 0; while (money < cost) { money += 1000; } cout << money - cost << endl; }
replace
8
9
8
9
TLE
p02612
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int n; while (cin >> n, n) { if (n % 1000 != 0) { n %= 1000; cout << 1000 - n; } else cout << 0; } }
#include <iostream> using namespace std; int main() { int n; cin >> n; if (n % 1000 != 0) { n %= 1000; cout << 1000 - n; } else cout << 0; }
replace
5
12
5
11
TLE
p02612
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define PI 3.1415926535897932384626 #define ll long long #define ull unsigned long long #define all(x) x.begin(), x.end() #define fo(i, n) for (i = 0; i < n; i++) #define sortall(x) sort(all(x)) #define vi vector<int> #define vs vector<string> typedef pair<string, int> p...
#include <bits/stdc++.h> using namespace std; #define PI 3.1415926535897932384626 #define ll long long #define ull unsigned long long #define all(x) x.begin(), x.end() #define fo(i, n) for (i = 0; i < n; i++) #define sortall(x) sort(all(x)) #define vi vector<int> #define vs vector<string> typedef pair<string, int> p...
replace
42
43
42
46
0
p02612
C++
Runtime Error
#include <iostream> using namespace std; int main() { int cost; cin >> cost; if (cost < 1000) return 1000 - cost; else return cost % 1000; return 0; }
#include <iostream> using namespace std; int main() { int cost; cin >> cost; int change; if (cost % 1000) { change = 1000 - cost % 1000; } else { change = 0; } cout << change; return 0; }
replace
6
10
6
15
132
p02612
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; cout << S.substr(S.length() - 3) << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; cout << (1000 - N % 1000) % 1000 << endl; }
replace
4
7
4
7
0
p02612
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int N; cin >> N; int S = N / 1000; int T = S * 1000; cout << N % T << endl; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int N; cin >> N; int S = N % 1000; if (S == 0) { cout << 0 << endl; } else { cout << 1000 - S << endl; } }
replace
8
11
8
15
0
p02612
C++
Runtime Error
#include <iostream> using namespace std; int main() { int N; cin >> N; if (N % 1000) { cout << (1000 - N % 1000) << std::endl; } else { cout << N % 1000 << endl; } return 1; }
#include <iostream> using namespace std; int main() { int N; cin >> N; if (N % 1000) { cout << (1000 - N % 1000) << std::endl; } else { cout << N % 1000 << endl; } return 0; }
replace
16
17
16
17
1
p02612
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; for (int i; i = 1; i++) { if (i * 1000 >= n) { cout << i * 1000 - n << endl; break; } } }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if (n % 1000 != 0) cout << 1000 - n % 1000 << endl; else cout << 0 << endl; }
replace
7
13
7
11
TLE
p02612
C++
Runtime Error
// ABC173.cpp : このファイルには 'main' // 関数が含まれています。プログラム実行の開始と終了がそこで行われます。 // #include <iostream> using namespace std; int main() { int price, change, thousands; cin >> price; thousands = price / 1000; if (price % 1000 == 0) { cout << 0; return 0; } else { change = (thousands + 1) * 1000 - price; ...
// ABC173.cpp : このファイルには 'main' // 関数が含まれています。プログラム実行の開始と終了がそこで行われます。 // #include <iostream> using namespace std; int main() { int price, change, thousands; cin >> price; thousands = price / 1000; if (price % 1000 == 0) { cout << 0; return 0; } else { change = (thousands + 1) * 1000 - price; ...
replace
20
21
20
21
100
p02612
C++
Runtime Error
#include <iostream> using namespace std; int main() { int n; cin >> n; n = n % 1000; n = 1000 - n; if (n == 1000) return 0; return n; }
#include <iostream> using namespace std; int main() { int n; cin >> n; n = n % 1000; n = 1000 - n; if (n == 1000) cout << 0 << endl; else cout << n << endl; }
replace
8
10
8
11
100
p02612
Python
Runtime Error
def main(): N = input() return N % 1000 if __name__ == "__main__": main()
def main(): N = int(input()) if N % 1000 == 0: print(0) else: print(1000 - (N % 1000)) if __name__ == "__main__": main()
replace
1
3
1
6
TypeError: not all arguments converted during string formatting
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02612/Python/s991643016.py", line 7, in <module> main() File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02612/Python/s991643016.py", line 3, in main return N % 1000 TypeError: not all...
p02612
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long #define ll long long #define pb push_back #define loop(i, a, b) for (int i = (a); i < (b); i++) #define loopb(i, a, b) for (int i = (a); i > (b); --i) typedef pair<int, int> ii; typedef vector<int> vi; typedef vector<ii> vii; typedef vector<ll> vl; ...
#include <bits/stdc++.h> using namespace std; #define int long long #define ll long long #define pb push_back #define loop(i, a, b) for (int i = (a); i < (b); i++) #define loopb(i, a, b) for (int i = (a); i > (b); --i) typedef pair<int, int> ii; typedef vector<int> vi; typedef vector<ii> vii; typedef vector<ll> vl; ...
replace
21
24
21
24
0
p02612
C++
Runtime Error
#include <iostream> using namespace std; int main() { int n; cin >> n; cout << 1000 - n % 1000; return 1000 - n % 1000; }
#include <iostream> using namespace std; int main() { int n; cin >> n; if (n % 1000 == 0) cout << 0; else cout << 1000 - n % 1000; return 0; }
replace
5
7
5
10
100
p02612
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL) #define ll lon...
#include <bits/stdc++.h> using namespace std; #define fio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL) #define ll lon...
replace
107
108
107
109
0
p02612
C++
Time Limit Exceeded
#define LOCAL #include <bits/stdc++.h> #include <iostream> #include <iterator> #include <map> #include <math.h> #include <stdbool.h> #define io() \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
#define LOCAL #include <bits/stdc++.h> #include <iostream> #include <iterator> #include <map> #include <math.h> #include <stdbool.h> #define io() \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
insert
99
99
99
100
TLE
p02612
C++
Runtime Error
/// You just can't beat the person who never gives up // #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> using namespace std; const int N = 2e5 + 5; int n; bool Never_give_up() { cin...
/// You just can't beat the person who never gives up // #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> using namespace std; const int N = 2e5 + 5; int n; bool Never_give_up() { cin...
insert
13
13
13
14
0
p02613
C++
Runtime Error
#include <stdio.h> #include <string.h> int main() { int N; char tmp; scanf("%d%c", &N, &tmp); int ac = 0, wa = 0, tle = 0, re = 0; char *s; for (int i = 0; i < N; i++) { fgets(s, 5, stdin); if (!strcmp(s, "AC\n")) ac++; if (!strcmp(s, "WA\n")) wa++; if (!strcmp(s, "TLE\n")) ...
#include <stdio.h> #include <string.h> int main() { int N; char tmp; scanf("%d%c", &N, &tmp); int ac = 0, wa = 0, tle = 0, re = 0; char s[5]; for (int i = 0; i < N; i++) { fgets(s, 5, stdin); if (!strcmp(s, "AC\n")) ac++; if (!strcmp(s, "WA\n")) wa++; if (!strcmp(s, "TLE\n")) ...
replace
9
10
9
10
-11
p02613
Python
Runtime Error
n = input() s = [input() for _ in range(n)] print("AC x ", s.count("AC")) print("WA x ", s.count("WA")) print("TLE x ", s.count("TLE")) print("RE x ", s.count("RE"))
n = int(input()) s = [input() for _ in range(n)] print("AC x ", s.count("AC")) print("WA x ", s.count("WA")) print("TLE x ", s.count("TLE")) print("RE x ", s.count("RE"))
replace
0
1
0
1
TypeError: 'str' object cannot be interpreted as an integer
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02613/Python/s682758054.py", line 3, in <module> s = [input() for _ in range(n)] TypeError: 'str' object cannot be interpreted as an integer
p02613
Python
Runtime Error
N = int(input()) ac = 0 wa = 0 tle = 0 re = 0 while True: ia = input() if ia == "AC": ac += 1 elif ia == "WA": wa += 1 elif ia == "TLE": tle += 1 elif ia == "RE": re += 1 else: break print( f"""\ AC x {ac} WA x {wa} TLE x {tle} RE x {re}""" )
N = int(input()) ac = 0 wa = 0 tle = 0 re = 0 for x in range(N): ia = input() if ia == "AC": ac += 1 elif ia == "WA": wa += 1 elif ia == "TLE": tle += 1 elif ia == "RE": re += 1 else: break print( f"""\ AC x {ac} WA x {wa} TLE x {tle} RE x {re}""" )
replace
5
6
5
6
EOFError: EOF when reading a line
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02613/Python/s899780656.py", line 7, in <module> ia = input() EOFError: EOF when reading a line
p02613
Python
Runtime Error
N = int(input()) a = [input() for i in range(N)] c0 = a.count("AC") c1 = a.count("WA") c2 = a.count("TLE") c3 = a.count("RE") print("AC × " + c0) print("WA × " + c1) print("TLE × " + c2) print("RE × " + c3)
N = int(input()) a = [input() for i in range(N)] c0 = a.count("AC") c1 = a.count("WA") c2 = a.count("TLE") c3 = a.count("RE") print("AC x", c0) print("WA x", c1) print("TLE x", c2) print("RE x", c3)
replace
6
10
6
10
TypeError: can only concatenate str (not "int") to str
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02613/Python/s511049207.py", line 7, in <module> print("AC × " + c0) TypeError: can only concatenate str (not "int") to str
p02613
Python
Runtime Error
n = int(input()) verdict = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0} for _ in range(n): S = input() verdict[S.upper()] += 1 for i, j in verdict: print(f"{i} x {j}")
n = int(input()) verdict = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0} for _ in range(n): S = input() verdict[S.upper()] += 1 for i, j in verdict.items(): print(f"{i} x {j}")
replace
6
7
6
7
ValueError: too many values to unpack (expected 2)
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02613/Python/s165324473.py", line 7, in <module> for i, j in verdict: ValueError: too many values to unpack (expected 2)