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
p03064
C++
Runtime Error
#include <algorithm> #include <array> #include <assert.h> #include <bitset> #include <chrono> #include <cmath> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <memory> #include <queue> #include <random> #include <set> #include <stack> #include <s...
#include <algorithm> #include <array> #include <assert.h> #include <bitset> #include <chrono> #include <cmath> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <memory> #include <queue> #include <random> #include <set> #include <stack> #include <s...
replace
79
81
79
81
0
p03064
C++
Runtime Error
#include <bits/stdc++.h> #define ADD(a, b) a = (a + ll(b)) % mod #define MUL(a, b) a = (a * ll(b)) % mod #define MAX(a, b) a = max(a, b) #define MIN(a, b) a = min(a, b) #define rep(i, a, b) for (int i = int(a); i < int(b); i++) #define rer(i, a, b) for (int i = int(a) - 1; i >= int(b); i--) #define all(a) (a).begin(), ...
#include <bits/stdc++.h> #define ADD(a, b) a = (a + ll(b)) % mod #define MUL(a, b) a = (a * ll(b)) % mod #define MAX(a, b) a = max(a, b) #define MIN(a, b) a = min(a, b) #define rep(i, a, b) for (int i = int(a); i < int(b); i++) #define rer(i, a, b) for (int i = int(a) - 1; i >= int(b); i--) #define all(a) (a).begin(), ...
replace
54
55
54
55
-11
p03064
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <deque> #include <iostream> #include <iterator> #include <limits> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <str...
#include <algorithm> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <deque> #include <iostream> #include <iterator> #include <limits> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <str...
replace
191
192
191
192
0
p03064
C++
Runtime Error
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cctype> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <list> #include <map> #include <numeric> #include <q...
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cctype> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <list> #include <map> #include <numeric> #include <q...
replace
31
33
31
33
-11
p03064
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = int_fast64_t; constexpr ll llmax = INT_FAST64_MAX; // std::numeric_limits<int_fast64_t>::max() constexpr ll llmin = INT_FAST64_MIN; // std::numeric_limits<int_fast64_t>::min() using ull = uint_fast64_t; constexpr ull ullmax = UINT_FAST64_MAX; // std::numeri...
#include <bits/stdc++.h> using namespace std; using ll = int_fast64_t; constexpr ll llmax = INT_FAST64_MAX; // std::numeric_limits<int_fast64_t>::max() constexpr ll llmin = INT_FAST64_MIN; // std::numeric_limits<int_fast64_t>::min() using ull = uint_fast64_t; constexpr ull ullmax = UINT_FAST64_MAX; // std::numeri...
replace
164
226
164
205
TLE
p03064
C++
Runtime Error
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define int long long #define x first #define y second #define all(aaa) (aaa).begin(), (aaa).end() #define REP(i, sss, eee) for (int i = sss; i <= eee; ++i) #define pb push_back #define pii pair<int, int> #define vi v...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define int long long #define x first #define y second #define all(aaa) (aaa).begin(), (aaa).end() #define REP(i, sss, eee) for (int i = sss; i <= eee; ++i) #define pb push_back #define pii pair<int, int> #define vi v...
delete
101
105
101
101
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p03064
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <sstream> #include <string> #include <vector> using namespace std; long long MOD = 998244353L; long long pow(int a, int n) {...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <sstream> #include <string> #include <vector> using namespace std; long long MOD = 998244353L; long long pow(int a, int n) {...
replace
73
76
73
94
TLE
p03064
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long const int mod = 998244353; void add(int &x, int y) { x = (x + y) % mod; } int ksm(int b, int n) { int res = 1; while (n) { if (n & 1) res = 1ll * res * b % mod; b = 1ll * b * b % mod; n >>= 1; } return res; } int f[100005], a[...
#include <bits/stdc++.h> using namespace std; #define int long long const int mod = 998244353; void add(int &x, int y) { x = (x + y) % mod; } int ksm(int b, int n) { int res = 1; while (n) { if (n & 1) res = 1ll * res * b % mod; b = 1ll * b * b % mod; n >>= 1; } return res; } int f[100005], a[...
replace
15
16
15
16
0
p03065
C++
Runtime Error
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stdio.h> #include <string.h> #include <string> #include <vector> using namespace std; #define lowbit(x) (x) & (-x) #define rep(i, a, b) for (int i = a; i <= b; i++) #define per(i, a, b) for (int i = a; i ...
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stdio.h> #include <string.h> #include <string> #include <vector> using namespace std; #define lowbit(x) (x) & (-x) #define rep(i, a, b) for (int i = a; i <= b; i++) #define per(i, a, b) for (int i = a; i ...
replace
61
62
61
62
0
p03065
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; // type alias typedef long long LL; typedef pair<int, int> II; typedef tuple<int, int, int> III; typedef vector<int> VI; typedef vector<string> VS; typedef unordered_map<int, int> MAPII; typedef unordered_set<int> SETI; template <class T> using VV = vector<vector<T>>; // mi...
#include <bits/stdc++.h> using namespace std; // type alias typedef long long LL; typedef pair<int, int> II; typedef tuple<int, int, int> III; typedef vector<int> VI; typedef vector<string> VS; typedef unordered_map<int, int> MAPII; typedef unordered_set<int> SETI; template <class T> using VV = vector<vector<T>>; // mi...
replace
138
139
138
139
0
p03065
C++
Time Limit Exceeded
#include <algorithm> #include <cassert> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); ++i) typedef long long ll; bool isNotPrime[100000]; int primes[100000...
#include <algorithm> #include <cassert> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); ++i) typedef long long ll; bool isNotPrime[100000]; int primes[100000...
replace
29
30
29
30
TLE
p03065
C++
Runtime Error
#pragma GCC optimize("O3") #pragma GCC target("sse4") // #pragma GCC optimize("Ofast") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") // #pragma GCC target ("avx2") // #pragma GCC optimization ("unroll-loops") #include <algorithm> #include <array> #include <bitset> #include <cassert> ...
#pragma GCC optimize("O3") #pragma GCC target("sse4") // #pragma GCC optimize("Ofast") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") // #pragma GCC target ("avx2") // #pragma GCC optimization ("unroll-loops") #include <algorithm> #include <array> #include <bitset> #include <cassert> ...
replace
355
356
355
356
0
p03065
C++
Runtime Error
#include <algorithm> #include <chrono> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <set> #include <stdio.h> #include <stdlib.h> #include <string> #include <vector> using namespace std; bool isPrime(long long p) { if (p < 0) { p *= -1; } if (p == 0 || p == 1) { retur...
#include <algorithm> #include <chrono> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <set> #include <stdio.h> #include <stdlib.h> #include <string> #include <vector> using namespace std; bool isPrime(long long p) { if (p < 0) { p *= -1; } if (p == 0 || p == 1) { retur...
replace
79
80
79
80
0
p03065
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <string> #include <unordered_map> #include <unordered_set> ...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <string> #include <unordered_map> #include <unordered_set> ...
replace
22
23
22
23
0
p03065
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; int n, a[N], b[N], g; vector<int> ans; bool isprime(int x) { for (int i = 2; i * i <= x; ++i) if (x % i == 0) return false; return true; } bool check(int x) { if (!isprime(x)) return false; memcpy(b, a, sizeof(int) * (n + 3)); ...
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; int n, a[N], b[N], g; vector<int> ans; bool isprime(int x) { for (int i = 2; i * i <= x; ++i) if (x % i == 0) return false; return true; } bool check(int x) { if (!isprime(x)) return false; memcpy(b, a, sizeof(int) * (n + 3)); ...
replace
26
28
26
28
TLE
p03065
C++
Time Limit Exceeded
// #include <bits/stdc++.h> #include <algorithm> // min,max #include <cmath> // sqrt #include <cstdlib> // exit #include <iostream> #include <list> #include <map> #include <unordered_map> #include <vector> using namespace std; #define forr(i, m, n) for (int i = (m); i <= (n); i++) #define forv(i, m, n) for (int i...
// #include <bits/stdc++.h> #include <algorithm> // min,max #include <cmath> // sqrt #include <cstdlib> // exit #include <iostream> #include <list> #include <map> #include <unordered_map> #include <vector> using namespace std; #define forr(i, m, n) for (int i = (m); i <= (n); i++) #define forv(i, m, n) for (int i...
replace
207
208
207
208
TLE
p03065
Python
Runtime Error
import sys from fractions import gcd def eratosthenes_generator(): yield 2 n = 3 h = {} while True: m = n if n in h: b = h[n] del h[n] else: b = n yield n m += b << 1 while m in h: m += b << 1 h...
import sys from fractions import gcd def eratosthenes_generator(): yield 2 n = 3 h = {} while True: m = n if n in h: b = h[n] del h[n] else: b = n yield n m += b << 1 while m in h: m += b << 1 h...
replace
48
49
48
49
ImportError: cannot import name 'gcd' from 'fractions' (/usr/lib/python3.10/fractions.py)
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03065/Python/s338863111.py", line 2, in <module> from fractions import gcd ImportError: cannot import name 'gcd' from 'fractions' (/usr/lib/python3.10/fractions.py)
p03065
Python
Time Limit Exceeded
import sys from fractions import gcd def eratosthenes_generator(): yield 2 n = 3 h = {} while True: m = n if n in h: b = h[n] del h[n] else: b = n yield n m += b << 1 while m in h: m += b << 1 h...
import sys from fractions import gcd def eratosthenes_generator(): yield 2 n = 3 h = {} while True: m = n if n in h: b = h[n] del h[n] else: b = n yield n m += b << 1 while m in h: m += b << 1 h...
replace
30
31
30
31
TLE
p03065
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> Pii; typedef vector<ll> Vi; typedef vector<Vi> VVi; const double EPS = (1e-7); const ll INF = (1e13); const double PI = (acos(-1)); const ll MOD = ll(1e9) + 7; #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define REPR(i, n...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> Pii; typedef vector<ll> Vi; typedef vector<Vi> VVi; const double EPS = (1e-7); const ll INF = (1e13); const double PI = (acos(-1)); const ll MOD = ll(1e9) + 7; #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define REPR(i, n...
replace
97
104
97
105
TLE
p03065
C++
Runtime Error
#include <bits/stdc++.h> #define For(i, x, y) for (register int i = (x); i <= (y); i++) #define FOR(i, x, y) for (register int i = (x); i < (y); i++) #define Dow(i, x, y) for (register int i = (x); i >= (y); i--) #define Debug(v) \ for (auto i : v) ...
#include <bits/stdc++.h> #define For(i, x, y) for (register int i = (x); i <= (y); i++) #define FOR(i, x, y) for (register int i = (x); i < (y); i++) #define Dow(i, x, y) for (register int i = (x); i >= (y); i--) #define Debug(v) \ for (auto i : v) ...
replace
58
59
58
59
0
p03066
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #define ll long long using namespace std; template <class T> inline void rd(T &x) { x = 0; char c = getchar(); int f = 1; while (!isdigit(c)) { if (c == '-') f = -1; c = getchar(); } while (isdigit(c)) x = x * 10...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #define ll long long using namespace std; template <class T> inline void rd(T &x) { x = 0; char c = getchar(); int f = 1; while (!isdigit(c)) { if (c == '-') f = -1; c = getchar(); } while (isdigit(c)) x = x * 10...
insert
45
45
45
47
0
p03066
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; int N, X; ll con[6010][6010]; ll mod = 998244353; ll ans; int main() { cin >> N >> X; for (int i = 0; i < 6010; i++) for (int j = 0; j < 6010; j++) { if (i == j) con[i][j] = 1; else if (j == 0) con[i][j] = 1; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int N, X; ll con[6010][6010]; ll mod = 998244353; ll ans; int main() { cin >> N >> X; for (int i = 0; i < 6010; i++) for (int j = 0; j <= i; j++) { if (i == j) con[i][j] = 1; else if (j == 0) con[i][j] = 1; ...
replace
14
15
14
15
-11
p03066
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; inline int mygetchar() { #ifdef WIN32 return _getchar_nolock(); #else return getchar_unlocked(); #endif } inline int read() { int x = 0, f = 1; char c = mygetchar(); while (!isdigit(c)) { if (c == '-') f = -1; c = mygetchar(); ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; inline int mygetchar() { #ifdef WIN32 return _getchar_nolock(); #else return getchar_unlocked(); #endif } inline int read() { int x = 0, f = 1; char c = mygetchar(); while (!isdigit(c)) { if (c == '-') f = -1; c = mygetchar(); ...
replace
44
45
44
45
0
p03066
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int M = 998244353; const int maxn = 3005; ll f[maxn], inv[maxn], nf[maxn], s[maxn][maxn], dp[maxn][maxn], c[maxn], u[maxn * 2], v[maxn * 2]; ll ans; ll C(ll x, ll y) { return f[x] * nf[y] % M * nf[x - y] % M; } void add(ll &x, ll y) { x += ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int M = 998244353; const int maxn = 6005; ll f[maxn], inv[maxn], nf[maxn], s[maxn][maxn], dp[maxn][maxn], c[maxn], u[maxn * 2], v[maxn * 2]; ll ans; ll C(ll x, ll y) { return f[x] * nf[y] % M * nf[x - y] % M; } void add(ll &x, ll y) { x += ...
replace
4
5
4
5
-11
p03066
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> #define rep(i, n) for (i = 0; i < n; i++) #define int long long using namespace std; int mod = 998244353; int N, X; int comb[3...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> #define rep(i, n) for (i = 0; i < n; i++) #define int long long using namespace std; int mod = 998244353; int N, X; int comb[3...
replace
44
52
44
48
TLE
p03066
C++
Runtime Error
// warm heart, wagging tail,and a smile just for you! // ███████████ // ███╬╬╬╬╬╬╬╬╬╬███ // ███╬╬╬╬╬████╬╬╬╬╬╬███ // ...
// warm heart, wagging tail,and a smile just for you! // ███████████ // ███╬╬╬╬╬╬╬╬╬╬███ // ███╬╬╬╬╬████╬╬╬╬╬╬███ // ...
replace
151
152
151
153
-11
p03066
C++
Runtime Error
/* --- author: dxm --- */ #include <bits/stdc++.h> #pragma GCC optimize(2) using namespace std; #define INF 1e9 #define Inf 1e18 #define rep(i, n) for (int(i) = 0; (i) < n; i++) #define REP(i, n) for (int(i) = 1; (i) <= n; i++) #define mp make_pair #define pb push_back #define fst first #define snd second typedef long...
/* --- author: dxm --- */ #include <bits/stdc++.h> #pragma GCC optimize(2) using namespace std; #define INF 1e9 #define Inf 1e18 #define rep(i, n) for (int(i) = 0; (i) < n; i++) #define REP(i, n) for (int(i) = 1; (i) <= n; i++) #define mp make_pair #define pb push_back #define fst first #define snd second typedef long...
replace
40
41
40
42
0
p03066
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int64_t MOD = 998244353; void add(int64_t &a, int64_t b) { a = (a + b) % MOD; } void mul(int64_t &a, int64_t b) { a = (a * b) % MOD; } vector<int64_t> fact, seq_inv, fact_inv; void create_fact_mod(int num) { fact[0] = 1; fact[1] = 1; for (int i = 2; i <= num;...
#include <bits/stdc++.h> using namespace std; const int64_t MOD = 998244353; void add(int64_t &a, int64_t b) { a = (a + b) % MOD; } void mul(int64_t &a, int64_t b) { a = (a * b) % MOD; } vector<int64_t> fact, seq_inv, fact_inv; void create_fact_mod(int num) { fact[0] = 1; fact[1] = 1; for (int i = 2; i <= num;...
replace
53
54
53
54
-11
p03067
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define N 1000 #define pb push_back #define mp make_pair #define ll long long #define mod 1000000007 #define all(cont) cont.begin(), cont.end() #define sortcmp(n, cmpfunc) sort(all(n), cmpfunc) #define fastio ...
#include <bits/stdc++.h> using namespace std; #define N 1000 #define pb push_back #define mp make_pair #define ll long long #define mod 1000000007 #define all(cont) cont.begin(), cont.end() #define sortcmp(n, cmpfunc) sort(all(n), cmpfunc) #define fastio ...
replace
23
27
23
27
0
p03067
Python
Runtime Error
A = input() B = input() C = input() if A > C > B: print("Yes") elif B > C > A: print("Yes") else: print("No")
A, B, C = map(int, input().split()) if A > C > B: print("Yes") elif B > C > A: print("Yes") else: print("No")
replace
0
3
0
1
EOFError: EOF when reading a line
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03067/Python/s744819372.py", line 2, in <module> B = input() EOFError: EOF when reading a line
p03067
Python
Runtime Error
n = int(input()) s = list(input()) k = int(input()) d = s[k - 1] for i in range(n): if s[i] != d: s[i] = "*" print("".join(s))
a, b, c = map(int, input().split()) if a < c < b or b < c < a: print("Yes") else: print("No")
replace
0
8
0
5
ValueError: invalid literal for int() with base 10: '3 8 5'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03067/Python/s139472791.py", line 1, in <module> n = int(input()) ValueError: invalid literal for int() with base 10: '3 8 5'
p03067
Python
Runtime Error
# -*- coding: utf-8 -*- a, b, c = map(int, input().split()) ab = int(b / a) if a < c < b or b < c < a: print("Yes") else: print("No")
# -*- coding: utf-8 -*- a, b, c = map(int, input().split()) if a < c < b or b < c < a: print("Yes") else: print("No")
delete
2
3
2
2
0
p03067
Python
Runtime Error
input_str = input() homes = input_str.split(" ") for home in homes: home = int(home) print(homes) if (homes[2] - homes[1]) * (homes[2] - homes[0]) < 0: print("Yes") else: print("No")
input_str = input() homes = input_str.split(" ") for i, home in enumerate(homes): homes[i] = int(home) if (homes[2] - homes[1]) * (homes[2] - homes[0]) < 0: print("Yes") else: print("No")
replace
2
5
2
4
TypeError: unsupported operand type(s) for -: 'str' and 'str'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03067/Python/s964196810.py", line 6, in <module> if ((homes[2] - homes[1]) * (homes[2] - homes[0]) < 0): TypeError: unsupported operand type(s) for -: 'str' and 'str'
p03068
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; int main() { int n, k; cin >> n; vector<char> s(n); for (int i = 0; i < n; i++) { cin >> s.at(i); } cin >> k; char con = s.at(k); for (int i = 0; i < n; i++) { if (s.at(i) != con) { s.at(i) = '*'; } } for (int i = 0; i < n...
#include <iostream> #include <vector> using namespace std; int main() { int n, k; cin >> n; vector<char> s(n); for (int i = 0; i < n; i++) { cin >> s.at(i); } cin >> k; char con = s.at(k - 1); // cout << con << endl; for (int i = 0; i < n; i++) { if (s.at(i) != con) { s.at(i) = '*'; ...
replace
12
13
12
14
0
p03068
C++
Runtime Error
#include <algorithm> #include <functional> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <string> #include <vector> typedef long long ll; ll mod = 1e9 + 7; using namespace std; int main() { int n, k; string s; cin >> n >> s >> k; char c = s.at(k); for (in...
#include <algorithm> #include <functional> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <string> #include <vector> typedef long long ll; ll mod = 1e9 + 7; using namespace std; int main() { int n, k; string s; cin >> n >> s >> k; char c = s.at(k - 1); for...
replace
20
21
20
21
0
p03068
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, k; string s; cin >> n >> s >> k; for (int i = 0; i < n; i++) { if (s.at(i) != s.at(k)) { s.at(i) = '*'; } } cout << s << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n, k; string s; cin >> n >> s >> k; for (int i = 0; i < n; i++) { if (s.at(i) != s.at(k - 1)) { s.at(i) = '*'; } } cout << s << endl; }
replace
7
8
7
8
0
p03068
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, K; string S; char C; cin >> N; cin >> S; cin >> K; C = S.at(K); for (int i = 0; i < N; i++) { if (S.at(i) != C) { cout << "*"; } else { cout << S.at(i); } } }
#include <bits/stdc++.h> using namespace std; int main() { int N, K; string S; char C; cin >> N; cin >> S; cin >> K; C = S.at(K - 1); for (int i = 0; i < N; i++) { if (S.at(i) != C) { cout << "*"; } else { cout << S.at(i); } } }
replace
12
13
12
13
0
p03068
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, K; string S; cin >> N >> S >> K; char a = S.at(K); for (int i = 0; i < N; i++) { if (S.at(i) != a) { S.at(i) = '*'; } } cout << S << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N, K; string S; cin >> N >> S >> K; char a = S.at(K - 1); for (int i = 0; i < N; i++) { if (S.at(i) != a) { S.at(i) = '*'; } } cout << S << endl; }
replace
7
8
7
8
0
p03068
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, K; string S; char X = '*', t; cin >> N >> S >> K; char Y = S.at(K); for (int i = 0; i < N; i++) { t = S.at(i); if (t != Y) { S.at(i) = X; } } cout << S << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N, K; string S; char X = '*', t; cin >> N >> S >> K; K--; char Y = S.at(K); for (int i = 0; i < N; i++) { t = S.at(i); if (t != Y) { S.at(i) = X; } } cout << S << endl; }
insert
8
8
8
9
0
p03068
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int k, i, j, n; string s; cin >> n >> s >> k; for (i = 0; i < n; i++) { if (s.at(i) != s.at(k)) { s.at(i) = '*'; } } cout << s << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int k, i, j, n; string s; cin >> n >> s >> k; for (i = 0; i < n; i++) { if (s.at(i) != s.at(k - 1)) { s.at(i) = '*'; } } cout << s << endl; }
replace
7
8
7
8
0
p03068
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define N 1000 #define pb push_back #define mp make_pair #define ll long long #define mod 1000000007 #define all(cont) cont.begin(), cont.end() #define sortcmp(n, cmpfunc) sort(all(n), cmpfunc) #define fastio ...
#include <bits/stdc++.h> using namespace std; #define N 1000 #define pb push_back #define mp make_pair #define ll long long #define mod 1000000007 #define all(cont) cont.begin(), cont.end() #define sortcmp(n, cmpfunc) sort(all(n), cmpfunc) #define fastio ...
replace
24
28
24
28
0
p03068
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; string S; cin >> S; int K; cin >> K; for (int i = 0; i < N; i++) { if (S.at(i) != S.at(K)) { S.at(i) = '*'; } } cout << S << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; string S; cin >> S; int K; cin >> K; for (int i = 0; i < N; i++) { if (S.at(i) != S.at(K - 1)) { S.at(i) = '*'; } } cout << S << endl; }
replace
12
13
12
13
0
p03068
C++
Runtime Error
#include <algorithm> #include <bits/stdc++.h> using namespace std; #define int long long #define str string #define rep(x, y) for (int i = x; i < y; i++) #define REP(x, y) for (int j = x; j < y; j++) #define all(x) x.begin(), x.end() signed main() { int A, B, C, N, K; str S, W, T; cin >> N >> S; cin >> K; rep...
#include <algorithm> #include <bits/stdc++.h> using namespace std; #define int long long #define str string #define rep(x, y) for (int i = x; i < y; i++) #define REP(x, y) for (int j = x; j < y; j++) #define all(x) x.begin(), x.end() signed main() { int A, B, C, N, K; str S, W, T; cin >> N >> S; cin >> K; rep...
replace
14
15
14
15
0
p03068
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string S; int N, K; cin >> N >> S >> K; for (int i = 0; i < N; i++) { if (S.at(i) != S.at(K)) { S.at(i) = '*'; } } cout << S << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string S; int N, K; cin >> N >> S >> K; for (int i = 0; i < N; i++) { if (S.at(i) != S.at(K - 1)) { S.at(i) = '*'; } } cout << S << endl; }
replace
8
9
8
9
0
p03068
C++
Runtime Error
#include <iostream> #include <string> using namespace std; int main() { int k, n; string s; cin >> n >> s >> k; char hoge = s.at(k); for (auto &&i = s.begin(); i < s.end(); i++) { if (*i != hoge) { *i = '*'; } } cout << s << endl; }
#include <iostream> #include <string> using namespace std; int main() { int k, n; string s; cin >> n >> s >> k; char hoge = s.at(k - 1); for (auto &&i = s.begin(); i < s.end(); i++) { if (*i != hoge) { *i = '*'; } } cout << s << endl; }
replace
8
9
8
9
0
p03068
C++
Runtime Error
#include <iostream> using namespace std; int main() { int N, K; string S; char SelectedChar; cin >> N >> S >> K; SelectedChar = S.at(K); for (int i = 0; i < N; i++) { if (S.at(i) != SelectedChar) { S.at(i) = '*'; } } cout << S << endl; }
#include <iostream> using namespace std; int main() { int N, K; string S; char SelectedChar; cin >> N >> S >> K; SelectedChar = S.at(K - 1); for (int i = 0; i < N; i++) { if (S.at(i) != SelectedChar) { S.at(i) = '*'; } } cout << S << endl; }
replace
8
9
8
9
0
p03068
C++
Runtime Error
#include <iostream> using namespace std; int main() { int N, K; char S[N]; cin >> N >> S >> K; char a = S[K - 1]; for (int i = 0; i < N; i++) { if (S[i] != a) { S[i] = '*'; } } std::cout << N << std::endl; return 0; }
#include <iostream> using namespace std; int main() { int N, K; char S[N]; cin >> N >> S >> K; char a = S[K - 1]; for (int i = 0; i < N; i++) { if (S[i] != a) { S[i] = '*'; } } std::cout << S << std::endl; return 0; }
replace
14
15
14
15
0
p03068
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; string s; int n, k; char c; int main() { cin >> n >> s >> k; c = s.at(k); for (int i = 0; i < n; ++i) { if (s.at(i) != c) { s.at(i) = '*'; } } cout << s << endl; }
#include <bits/stdc++.h> using namespace std; string s; int n, k; char c; int main() { cin >> n >> s >> k; c = s.at(k - 1); for (int i = 0; i < n; ++i) { if (s.at(i) != c) { s.at(i) = '*'; } } cout << s << endl; }
replace
10
11
10
11
0
p03068
C++
Runtime Error
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int n, k; string s; cin >> n; cin >> s; cin >> k; char moji = s.at(k); for (int i = 0; i < n; i++) { if (s.at(i) != moji) { s.at(i) = '*'; } } cout << s << endl; }
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int n, k; string s; cin >> n; cin >> s; cin >> k; char moji = s.at(k - 1); for (int i = 0; i < n; i++) { if (s.at(i) != moji) { s.at(i) = '*'; } } cout << s << endl; }
replace
13
14
13
14
0
p03068
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, K; cin >> N; string s; cin >> s >> K; char x; x = s.at(K); for (int i = 0; i < N; i++) { if (x != s.at(i)) { cout << "*"; } else { cout << x; } } }
#include <bits/stdc++.h> using namespace std; int main() { int N, K; cin >> N; string s; cin >> s >> K; char x; x = s.at(K - 1); for (int i = 0; i < N; i++) { if (x != s.at(i)) { cout << "*"; } else { cout << x; } } }
replace
10
11
10
11
0
p03068
C++
Runtime Error
// ABC_128_B// pair型の中にpair型 /*int main() { int n; cin >> n; vector<pair<pair<string,int>,int>> a(n); for(int i=0;i<n;i++){ string s; cin >> s; int num; cin >> num; num = num * -1; a.at(i).first.first = s; a.at(i).first.second = num; a.at(i).second = i; } sort(a.begin(),...
// ABC_128_B// pair型の中にpair型 /*int main() { int n; cin >> n; vector<pair<pair<string,int>,int>> a(n); for(int i=0;i<n;i++){ string s; cin >> s; int num; cin >> num; num = num * -1; a.at(i).first.first = s; a.at(i).first.second = num; a.at(i).second = i; } sort(a.begin(),...
replace
303
304
303
304
0
p03068
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, k; string s; cin >> n >> s >> k; for (int i = 0; i < n; i++) { if (s.at(i) != s.at(k)) { s.at(i) = '*'; } } cout << s << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n, k; string s; cin >> n >> s >> k; for (int i = 0; i < n; i++) { if (s.at(i) != s.at(k - 1)) { s.at(i) = '*'; } } cout << s << endl; }
replace
10
11
10
11
0
p03068
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { int n, k; string s; cin >> n >> s >> k; for (int i = 0; i < n; i++) { if (s.at(i) != s.at(k)) { s.at(i) = '*'; } } cout << s << endl; }
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { int n, k; string s; cin >> n >> s >> k; for (int i = 0; i < n; i++) { if (s.at(i) != s.at(k - 1)) { s.at(i) = '*'; } } cout << s << endl; }
replace
8
9
8
9
0
p03068
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; string S; cin >> S; int K; cin >> K; for (int i = 0; i < N; i++) { if (S.at(i) != S.at(K)) { S.at(i) = '*'; } } cout << S << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; string S; cin >> S; int K; cin >> K; for (int i = 0; i < N; i++) { if (S.at(i) != S.at(K - 1)) { S.at(i) = '*'; } } cout << S << endl; }
replace
11
12
11
12
0
p03068
C++
Runtime Error
#include <iostream> #include <string> using namespace std; int main() { int a, c; string b; cin >> a >> b >> c; for (int i = 0; i < a; i++) { if (b.at(i) != b.at(c)) b.at(i) = '*'; } cout << b << endl; }
#include <iostream> #include <string> using namespace std; int main() { int a, c; string b; cin >> a >> b >> c; for (int i = 0; i < a; i++) { if (b.at(i) != b.at(c - 1)) b.at(i) = '*'; } cout << b << endl; }
replace
8
9
8
9
0
p03068
C++
Runtime Error
#include <bits/stdc++.h> #include <math.h> using namespace std; int main() { int N, K; string S; cin >> N >> S >> K; for (int i = 0; i < N; i++) { if (S.at(i) != S.at(K)) { S.at(i) = '*'; } } cout << S << endl; }
#include <bits/stdc++.h> #include <math.h> using namespace std; int main() { int N, K; string S; cin >> N >> S >> K; for (int i = 0; i < N; i++) { if (S.at(i) != S.at(K - 1)) { S.at(i) = '*'; } } cout << S << endl; }
replace
9
10
9
10
0
p03068
Python
Runtime Error
n = int(input()) s = str(input()) k = int(input()) char = s[k] result = "" for x in s: if x == char: result += char else: result += "*" print(result)
n = int(input()) s = str(input()) k = int(input()) char = s[k - 1] result = "" for x in s: if x == char: result += char else: result += "*" print(result)
replace
4
5
4
5
0
p03068
Python
Runtime Error
from functools import reduce N = int(input()) S = input() K = int(input()) print(reduce(lambda x, y: x + (y if y == S[K] else "*"), S, ""))
from functools import reduce N = int(input()) S = input() K = int(input()) - 1 print(reduce(lambda x, y: x + (y if y == S[K] else "*"), S, ""))
replace
4
5
4
5
0
p03068
Python
Runtime Error
from re import sub n = int(input()) s = input() k = int(input()) print(sub(f"[^{s[k-1]}]", "*", s))
from re import sub n = int(input()) s = input() k = int(input()) print(sub("[^{}]".format(s[k - 1]), "*", s))
replace
6
7
6
7
0
p03068
Python
Runtime Error
N = int(input()) S = list(input()) K = int(input()) target = S[K] ans = "" for s in S: ans += s if s == target else "*" print(ans)
N = int(input()) S = list(input()) K = int(input()) target = S[K - 1] ans = "" for s in S: ans += s if s == target else "*" print(ans)
replace
4
5
4
5
0
p03068
Python
Runtime Error
N = int(input()) S = input() K = int(input()) a = S[K + 1] for i in range(len(S)): if S[i] != a: print("*", end="") else: print(S[i], end="") print()
N = int(input()) S = input() K = int(input()) a = S[K - 1] for i in range(len(S)): if S[i] != a: print("*", end="") else: print(S[i], end="") print()
replace
4
5
4
5
0
p03068
Python
Runtime Error
N = int(input()) S = input() K = int(input()) flag = S[K] ans = [] for x in S: if x == flag: ans.append(x) else: ans.append("*") print("".join(ans))
N = int(input()) S = input() K = int(input()) flag = S[K - 1] ans = [] for x in S: if x == flag: ans.append(x) else: ans.append("*") print("".join(ans))
replace
3
4
3
4
0
p03068
Python
Runtime Error
n = int(input()) s = input() k = int(input()) result = [] for x in s: if x != s[k]: result.append("*") else: result.append(x) print("".join(result))
n = int(input()) s = input() k = int(input()) result = [] for x in s: if x != s[k - 1]: result.append("*") else: result.append(x) print("".join(result))
replace
6
7
6
7
0
p03068
Python
Runtime Error
input() S = input() K = int(input()) c = S[K] print("".join([v if v == c else "*" for v in S]))
input() S = input() K = int(input()) c = S[K - 1] print("".join([v if v == c else "*" for v in S]))
replace
4
5
4
5
0
p03068
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, k; string s; cin >> n >> s >> k; char c = s.at(k); for (int i = 0; i < n; i++) { if (s.at(i) != c) { s.at(i) = '*'; } } cout << s << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n, k; string s; cin >> n >> s >> k; char c = s.at(k - 1); for (int i = 0; i < n; i++) { if (s.at(i) != c) { s.at(i) = '*'; } } cout << s << endl; }
replace
7
8
7
8
0
p03068
C++
Runtime Error
#pragma GCC optimize("O3") #include <bits/stdc++.h> #define ll long long #define rep(i, n) for (ll i = 0; i < (n); i++) #define pll pair<ll, ll> #define pq priority_queue #define pb push_back #define eb emplace_back #define fi first #define se second #define ios ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); #d...
#pragma GCC optimize("O3") #include <bits/stdc++.h> #define ll long long #define rep(i, n) for (ll i = 0; i < (n); i++) #define pll pair<ll, ll> #define pq priority_queue #define pb push_back #define eb emplace_back #define fi first #define se second #define ios ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); #d...
replace
39
40
39
40
-11
p03068
Python
Runtime Error
n = int(input()) s = input() k = int(input()) s = list(map(lambda x: "*" if x != s[k] else x, s)) print(*s, sep="")
n = int(input()) s = input() k = int(input()) - 1 s = list(map(lambda x: "*" if x != s[k] else x, s)) print(*s, sep="")
replace
2
3
2
3
0
p03069
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <queue> #define in(a) a = read() #define REP(i, k, n) for (int i = k; i <= n; i++) using namespace std; inline int read() { int x = 0, f = 1; char ch = getchar(); for (; !isdigit(ch); ch = getchar()) if (...
#include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <queue> #define in(a) a = read() #define REP(i, k, n) for (int i = k; i <= n; i++) using namespace std; inline int read() { int x = 0, f = 1; char ch = getchar(); for (; !isdigit(ch); ch = getchar()) if (...
replace
21
23
21
23
0
p03069
C++
Runtime Error
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; const int INF = 1001001001; int sum[100001]; int main() { int n; string s; cin >> n >> s; for (int i = 0; i < n; ++i) { sum[i + 1] = sum[i]; if (s[i] == '#') { ++sum[i + 1]; } } int ans =...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; const int INF = 1001001001; int sum[200005]; int main() { int n; string s; cin >> n >> s; for (int i = 0; i < n; ++i) { sum[i + 1] = sum[i]; if (s[i] == '#') { ++sum[i + 1]; } } int ans =...
replace
8
9
8
9
0
p03069
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; using intpair = pair<int, int>; using intpv = vector<intpair>; using llpair = pair<ll, ll>; using llpv = vector<llpair>; using intq = queue<int>; using llq = queue<ll>; using intvec = vector<int>; using llvec = vector<ll>; using llmat = vector<vector<l...
#include <bits/stdc++.h> using namespace std; using ll = long long; using intpair = pair<int, int>; using intpv = vector<intpair>; using llpair = pair<ll, ll>; using llpv = vector<llpair>; using intq = queue<int>; using llq = queue<ll>; using intvec = vector<int>; using llvec = vector<ll>; using llmat = vector<vector<l...
replace
288
296
288
296
TLE
p03069
C++
Time Limit Exceeded
#include <iostream> #include <algorithm> #include <string> using namespace std; int main() { int n; string s; cin >> n >> s; // 境界を探索 int min = n; for (int i = 0; i <= n; i++) { int c_b = 0, c_w = 0; for (int j = 0; j < n; i++) { string t = s.substr(j, 1); if (j < i && s == "#") ...
#include <iostream> #include <algorithm> #include <string> using namespace std; int main() { int n; string s; cin >> n >> s; // 境界を探索 int c_b = 0, c_w = 0; for (int i = 0; i < n; i++) { string t = s.substr(i, 1); if (t == ".") c_w++; } int min = c_w; for (int i = 0; i < n; i++) { ...
replace
12
22
12
27
TLE
p03069
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long int; const int MAX = (int)(1e5 + 5); const ll INF = (ll)(1e10 + 5); const int MAX_N = (int)(1e5 + 5); int n; string s; int white[MAX_N]; int black[MAX_N]; int ans; int main(void) { // Here your code ! scanf("%d", &n); cin >> s; for (int ...
#include <bits/stdc++.h> using namespace std; using ll = long long int; const int MAX = (int)(1e5 + 5); const ll INF = (ll)(1e10 + 5); const int MAX_N = (int)(2e5 + 5); int n; string s; int white[MAX_N]; int black[MAX_N]; int ans; int main(void) { // Here your code ! scanf("%d", &n); cin >> s; for (int ...
replace
8
9
8
9
0
p03069
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; string S; cin >> N >> S; vector<int> vecB(N + 1), vecW(N + 1), ans(N + 1); for (int i = 0; i <= N; i++) { if (S[i] == '#') { vecB[i + 1] = vecB[i] + 1; } else { vecB[i + 1] = vecB[i]; } if (S[N - 1 - i] == '.') { ...
#include <bits/stdc++.h> using namespace std; int main() { int N; string S; cin >> N >> S; vector<int> vecB(N + 1), vecW(N + 1), ans(N + 1); for (int i = 0; i < N; i++) { if (S[i] == '#') { vecB[i + 1] = vecB[i] + 1; } else { vecB[i + 1] = vecB[i]; } if (S[N - 1 - i] == '.') { ...
replace
8
9
8
9
-6
double free or corruption (out)
p03069
C++
Runtime Error
#include <algorithm> #include <complex> #include <cstring> #include <iostream> #include <map> #include <queue> #include <stack> #include <string> #include <unordered_map> #include <vector> #define rep(i, a) for (int i = 0; i < (a); i++) using namespace std; int main() { int n; string s; cin >> n >> s; int b[3...
#include <algorithm> #include <complex> #include <cstring> #include <iostream> #include <map> #include <queue> #include <stack> #include <string> #include <unordered_map> #include <vector> #define rep(i, a) for (int i = 0; i < (a); i++) using namespace std; int main() { int n; string s; cin >> n >> s; int b[3...
replace
18
19
18
19
0
p03069
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; string s; cin >> n >> s; int b[100010] = {}; int w[100010] = {}; for (int i = 0; i < n; i++) { b[i + 1] += b[i]; w[i + 1] += w[i]; if (s[i] == '#') { b[i + 1]++; } else { w[i + 1]++; } } int ans = INT_MA...
#include <bits/stdc++.h> using namespace std; int main() { int n; string s; cin >> n >> s; int b[200010] = {}; int w[200010] = {}; for (int i = 0; i < n; i++) { b[i + 1] += b[i]; w[i + 1] += w[i]; if (s[i] == '#') { b[i + 1]++; } else { w[i + 1]++; } } int ans = INT_MA...
replace
7
9
7
9
0
p03069
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define N_TIMES(i, n) for (uint64_t i = 0; i < n; ++i) #define N_TIMES_REV(i, n) for (int64_t i = n - 1; i >= 0; --i) int main(int argc, char **argv) { uint64_t N; cin >> N; string S; cin >> S; vector<uint64_t> black(N + 1, 0), white(N + 1, 0); N_TIMES(n, N...
#include <bits/stdc++.h> using namespace std; #define N_TIMES(i, n) for (uint64_t i = 0; i < n; ++i) #define N_TIMES_REV(i, n) for (int64_t i = n - 1; i >= 0; --i) int main(int argc, char **argv) { uint64_t N; cin >> N; string S; cin >> S; vector<uint64_t> black(N + 1, 0), white(N + 1, 0); N_TIMES(n, N...
replace
15
16
15
16
0
p03069
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; string S; cin >> N >> S; S = S + '#'; vector<int> a(S.size(), 0); int i, j, J; int b; char c = S.at(0); for (i = j = 0; i < S.size(); i++) { if (S.at(i) != c) { c = S.at(i); j++; } if (c == '.') a.at(j)++;...
#include <bits/stdc++.h> using namespace std; int main() { int N; string S; cin >> N >> S; S = S + '#'; vector<int> a(S.size(), 0); int i, j, J; int b; char c = S.at(0); for (i = j = 0; i < S.size(); i++) { if (S.at(i) != c) { c = S.at(i); j++; } if (c == '.') a.at(j)++;...
replace
38
39
38
39
0
p03069
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int N; scanf("%d", &N); string S; cin >> S; int counta = 0; int countb = 0; int countc = 0; int max = N; for (int i = 0; i < N; ++i) { if (S[i] == '#') ++counta; } for (int i = 0; i < N; ++i) { if (S[i] == '.') ++cou...
#include <bits/stdc++.h> using namespace std; int main() { int N; scanf("%d", &N); string S; cin >> S; int counta = 0; int countb = 0; int countc = 0; int max = N; for (int i = 0; i < N; ++i) { if (S[i] == '#') ++counta; } for (int i = 0; i < N; ++i) { if (S[i] == '.') ++cou...
replace
28
44
28
35
TLE
p03069
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; string s; cin >> n >> s; vector<int> vtL(n + 1, 0); vector<int> vtR(n + 1, 0); for (int i = 0; i < n; ++i) { vtL[i + 1] = vtL[i]; if (s[i] == '#') vtL[i + 1]++; vtR[n - 2 - i] = vtR[n - 1 - i]; if (s[n - 1 - i] == '.'...
#include <bits/stdc++.h> using namespace std; int main() { int n; string s; cin >> n >> s; vector<int> vtL(n + 1, 0); vector<int> vtR(n + 1, 0); for (int i = 0; i < n; ++i) { vtL[i + 1] = vtL[i]; if (s[i] == '#') vtL[i + 1]++; if (n - 2 - i < 0) continue; vtR[n - 2 - i] = vtR...
insert
15
15
15
18
-6
double free or corruption (out)
p03069
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; int black[100002] = {}; int n_black = 0; string S; cin >> N >> S; for (int i = 1; i <= N; i++) { black[i] = black[i - 1]; if (S[i - 1] == '#') black[i]++; } n_black = black[N]; int ans = 2e5 + 1; for (int i = 0; i <= ...
#include <bits/stdc++.h> using namespace std; int main() { int N; int black[200002] = {}; int n_black = 0; string S; cin >> N >> S; for (int i = 1; i <= N; i++) { black[i] = black[i - 1]; if (S[i - 1] == '#') black[i]++; } n_black = black[N]; int ans = 2e5 + 1; for (int i = 0; i <= ...
replace
5
6
5
6
0
p03069
C++
Runtime Error
// #include "bits/stdc++.h" #define _USE_MATH_DEFINES #include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <iterator> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <...
// #include "bits/stdc++.h" #define _USE_MATH_DEFINES #include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <iterator> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <...
replace
62
63
62
63
0
p03069
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define N 212345 #define pb push_back #define mp make_pair #define ll long long #define mod 1000000007 #define all(cont) cont.begin(), cont.end() #define sortcmp(n, cmpfunc) sort(all(n), cmpfunc) #define fastio ...
#include <bits/stdc++.h> using namespace std; #define N 212345 #define pb push_back #define mp make_pair #define ll long long #define mod 1000000007 #define all(cont) cont.begin(), cont.end() #define sortcmp(n, cmpfunc) sort(all(n), cmpfunc) #define fastio ...
replace
25
29
25
29
0
p03069
C++
Runtime Error
#define LOCAL #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = (n - 1); i >= 0; --i) #define rep2(i, s, n) for (int i = s; i < (n); ++i) #define ALL(v) (v).begin(), (v).end() #define memr(dp, val) memset(dp, val, sizeof(dp)) using namespace std; typedef long long ...
#define LOCAL #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = (n - 1); i >= 0; --i) #define rep2(i, s, n) for (int i = s; i < (n); ++i) #define ALL(v) (v).begin(), (v).end() #define memr(dp, val) memset(dp, val, sizeof(dp)) using namespace std; typedef long long ...
replace
109
110
109
110
0
p03069
C++
Runtime Error
#include "bits/stdc++.h" #include <cmath> using namespace std; #define f first #define s second #define pb push_back #define pp pop_back #define mp make_pair #define sz(x) (int)x.size() #define sqr(x) ((x)*1ll * (x)) #define all(x) x.begin(), x.end() #define clr(a, v) memset(a, v, sizeof(a)) #define rep(i, l, r) fo...
#include "bits/stdc++.h" #include <cmath> using namespace std; #define f first #define s second #define pb push_back #define pp pop_back #define mp make_pair #define sz(x) (int)x.size() #define sqr(x) ((x)*1ll * (x)) #define all(x) x.begin(), x.end() #define clr(a, v) memset(a, v, sizeof(a)) #define rep(i, l, r) fo...
replace
61
62
61
62
0
p03069
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define reps(i, n, m) for (int i = (int)(n); i <= (int)(m); i++) #define all(obj) (obj).begin(), (obj).end() #define rall(obj) (obj).rbegin(), (obj).rend() #define collect(arr, size) rep(i, size) cin >> arr[i]; int main...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define reps(i, n, m) for (int i = (int)(n); i <= (int)(m); i++) #define all(obj) (obj).begin(), (obj).end() #define rall(obj) (obj).rbegin(), (obj).rend() #define collect(arr, size) rep(i, size) cin >> arr[i]; int main...
replace
13
20
13
23
TLE
p03069
Python
Runtime Error
N = int(input()) S = input() W = [0] * N W[-1] += S[-1] == "." for i in range(N - 2, -1, -1): W[i] = W[i + 1] + (S[i] == ".") B = [0] * N B[0] += S[0] == "#" for i in range(1, N): B[i] = B[i - 1] + (S[i] == "#") T = [w + b for w, b in zip(W, B)] print(min(*T, W[0], B[-1]))
N = int(input()) S = input() W = [0] * N W[-1] += S[-1] == "." for i in range(N - 2, -1, -1): W[i] = W[i + 1] + (S[i] == ".") B = [0] * N B[0] += S[0] == "#" for i in range(1, N): B[i] = B[i - 1] + (S[i] == "#") T = [w + b - 1 for w, b in zip(W, B)] T = min(T) print(min(T, W[0], B[-1]))
replace
13
15
13
16
0
p03069
Python
Runtime Error
N = int(input()) S = list(input()) c = 0 a = 0 cw = [0] * N cb = [0] * N tw = 0 tb = 0 for i in range(N): if S[i] == ".": tw += 1 cw[i] = tw cb[i] = tb else: tb += 1 cb[i] = tb cw[i] = tw A = cw[N] for i in range(N): A = min(A, cb[i] + cw[N - 1] - cw[i]) print...
N = int(input()) S = list(input()) c = 0 a = 0 cw = [0] * N cb = [0] * N tw = 0 tb = 0 for i in range(N): if S[i] == ".": tw += 1 cw[i] = tw cb[i] = tb else: tb += 1 cb[i] = tb cw[i] = tw A = cw[N - 1] for i in range(N): A = min(A, cb[i] + cw[N - 1] - cw[i]) p...
replace
17
18
17
18
IndexError: list index out of range
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03069/Python/s792100988.py", line 18, in <module> A = cw[N] IndexError: list index out of range
p03069
Python
Runtime Error
N = int(input()) S = input() ans = 0 if N == 1: print(0) exit() elif N == 2 and (S[0] == "." and S[1] == "#"): print(0) exit() else: S = S[0] + S + S[N - 1] S = list(S) for n in range(N): if S[n] == "." and S[n + 2] == "." and S[n + 1] == "#": ans += 1 S[n + 1...
N = int(input()) S = input() ans = N sumB = [0] * (N + 1) tmp = 0 for i in range(N): if S[i] == "#": tmp += 1 sumB[i + 1] = tmp for i in range(N + 1): ans = min(sumB[i] + (N - i) - (sumB[N] - sumB[i]), ans) # print(sumB[i] , (N - i), (sumB[N] - sumB[i]), ans) print(ans)
replace
2
19
2
12
TypeError: can only concatenate list (not "int") to list
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03069/Python/s480310094.py", line 19, in <module> S[S + 1] = '#' TypeError: can only concatenate list (not "int") to list
p03069
C++
Runtime Error
#include <bits/stdc++.h> #define MAX 2001 using namespace std; int main() { int n; char s[MAX]; cin >> n >> s; int a[MAX + 1], b[MAX + 1]; memset(a, 0, (n + 1) * sizeof(int)); memset(b, 0, (n + 1) * sizeof(int)); for (int i = 0; i < n; i++) { if (s[i] == '#') b[i + 1] = b[i] + 1; else ...
#include <bits/stdc++.h> #define MAX 200001 using namespace std; int main() { int n; char s[MAX]; cin >> n >> s; int a[MAX + 1], b[MAX + 1]; memset(a, 0, (n + 1) * sizeof(int)); memset(b, 0, (n + 1) * sizeof(int)); for (int i = 0; i < n; i++) { if (s[i] == '#') b[i + 1] = b[i] + 1; else ...
replace
1
2
1
2
0
p03069
Python
Time Limit Exceeded
N = int(input()) S = input() ans = N for i in range(N + 1): ans = min(ans, S[:i].count("#") + S[i:].count(".")) print(ans)
N = int(input()) S = input() ws = S.count(".") bs = 0 ans = ws + bs for i in range(N): if S[i] == "#": bs += 1 else: ws -= 1 ans = min(ans, ws + bs) print(ans)
replace
2
5
2
11
TLE
p03069
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int white[100005], black[100005]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; string s; cin >> n >> s; white[n - 1] = (int)(s[n - 1] == '.'); black[0] = (int)(s[0] == '#'); for (int i = n - 2; i >= 0; i--) white[i] += white...
#include <bits/stdc++.h> using namespace std; int white[200005], black[200005]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; string s; cin >> n >> s; white[n - 1] = (int)(s[n - 1] == '.'); black[0] = (int)(s[0] == '#'); for (int i = n - 2; i >= 0; i--) white[i] += white...
replace
4
5
4
5
0
p03069
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; string S; cin >> S; vector<int> res(N + 1); for (int i = 0; i <= N; i++) { res.at(i) = count(S.begin(), S.begin() + i, '#') + count(S.begin() + i, S.end(), '.'); } cout << *min_element(res.begin(), res.e...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; string S; cin >> S; vector<int> res(N + 1); int left = 0; int right = count(S.begin(), S.end(), '.'); res.at(0) = left + right; for (int i = 0; i < N; i++) { if (S.at(i) == '#') left++; else right--; ...
replace
12
15
12
23
TLE
p03069
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int N, ans; char S[100100]; int titik[100100], pagar[100100]; int main() { cin >> N; for (int i = 1; i <= N; i++) { cin >> S[i]; if (S[i] == '.') { titik[i] = titik[i - 1] + 1; pagar[i] = pagar[i - 1]; } else { titik[i] = titik[i - 1]; ...
#include <bits/stdc++.h> using namespace std; int N, ans; char S[200100]; int titik[200100], pagar[200100]; int main() { cin >> N; for (int i = 1; i <= N; i++) { cin >> S[i]; if (S[i] == '.') { titik[i] = titik[i - 1] + 1; pagar[i] = pagar[i - 1]; } else { titik[i] = titik[i - 1]; ...
replace
4
6
4
6
0
p03069
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; vector<int> x; int c[100001]; int main(int, char **) { ll a, w = 0, b = 0, ans = 0; string s; cin >> a >> s; c[0] = 0; for (int i = 0; i < s.length(); i++) { if (s[i] == '#') { b++; } else { w++; } c[i + 1] = ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; vector<int> x; int c[200010]; int main(int, char **) { ll a, w = 0, b = 0, ans = 0; string s; cin >> a >> s; c[0] = 0; for (int i = 0; i < s.length(); i++) { if (s[i] == '#') { b++; } else { w++; } c[i + 1] = ...
replace
7
8
7
8
0
p03070
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <iomanip> #include <iostream> #include <limits.h> #include <math.h> #include <queue> #include <set> #include <stdio.h> #include <stdlib.h> #include <string> #include <vector> #define ll long long #define rep2(i, a, b) for (ll i = a; i <= b; i++) #define rep(i, n) for (ll ...
#include <algorithm> #include <cstdio> #include <iomanip> #include <iostream> #include <limits.h> #include <math.h> #include <queue> #include <set> #include <stdio.h> #include <stdlib.h> #include <string> #include <vector> #define ll long long #define rep2(i, a, b) for (ll i = a; i <= b; i++) #define rep(i, n) for (ll ...
replace
59
60
59
60
0
p03070
C++
Time Limit Exceeded
// written by NewbieChd #include <cctype> #include <cstdio> #define BUF 1000000 using namespace std; const int N = 301, M = 45001, yyb = 998244353; char buf[BUF], *p1, *p2; inline char getChar() { return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, BUF, stdin), p1 == p2) ? EOF : *p1++; } inl...
// written by NewbieChd #include <cctype> #include <cstdio> #define BUF 1000000 using namespace std; const int N = 301, M = 45001, yyb = 998244353; char buf[BUF], *p1, *p2; inline char getChar() { return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, BUF, stdin), p1 == p2) ? EOF : *p1++; } inl...
delete
31
35
31
31
TLE
p03070
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <ctime> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #incl...
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <ctime> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #incl...
replace
28
29
28
29
0
p03070
C++
Runtime Error
#include <algorithm> #include <bitset> #include <ciso646> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <unordered_map> #in...
#include <algorithm> #include <bitset> #include <ciso646> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <unordered_map> #in...
replace
71
74
71
73
-11
p03070
C++
Runtime Error
#include <algorithm> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> // #include <function> using name...
#include <algorithm> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> // #include <function> using name...
replace
45
47
45
47
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p03070
C++
Runtime Error
#include <cstring> #include <iostream> #include <string> #include <vector> using namespace std; int MOD = 998244353; int main(void) { int N; cin >> N; int a[N]; int sum = 0; long long all = 1; for (int i = 0; i < N; i++) { cin >> a[i]; sum += a[i]; all = (3 * all) % MOD; } long long dp1...
#include <cstring> #include <iostream> #include <string> #include <vector> using namespace std; int MOD = 998244353; int main(void) { int N; cin >> N; int a[N]; int sum = 0; long long all = 1; for (int i = 0; i < N; i++) { cin >> a[i]; sum += a[i]; all = (3 * all) % MOD; } vector<vector...
replace
22
25
22
24
0