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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02950 | C++ | Runtime Error | #include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdexcept>
#include ... | #include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdexcept>
#include ... | replace | 41 | 43 | 41 | 43 | -11 | |
p02950 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, N) for (int i = 0; i < (int)N; i++)
#define all(a) (a).begin(), (a).end()
int p;
int MOD;
struct mint {
long long val;
mint(long long v = 0) noexcept : val(v % MOD) {
if (val < 0)
v += MOD;
}
int getmod() { return MOD... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, N) for (int i = 0; i < (int)N; i++)
#define all(a) (a).begin(), (a).end()
int p;
int MOD;
struct mint {
long long val;
mint(long long v = 0) noexcept : val(v % MOD) {
if (val < 0)
v += MOD;
}
int getmod() { return MOD... | replace | 94 | 96 | 94 | 99 | TLE | |
p02950 | C++ | Time Limit Exceeded | #include <algorithm>
#include <complex>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#define REP(i, m, n) for (int i = int(m); i < int... | #include <algorithm>
#include <complex>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#define REP(i, m, n) for (int i = int(m); i < int... | replace | 88 | 89 | 88 | 94 | TLE | |
p02950 | C++ | Time Limit Exceeded | #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 | 82 | 83 | 82 | 87 | TLE | |
p02950 | C++ | Time Limit Exceeded | #define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define E "\n"
using namespace std;
long long MOD = (long long)1e9 + 7;
long long quickpow(long long b, int e) {
return e ? ((e & 1 ? b : 1) * quickpow((b * b) % MOD, e >> 1)) % MOD : 1;
}
int p, a[3000... | #define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define E "\n"
using namespace std;
long long MOD = (long long)1e9 + 7;
long long quickpow(long long b, int e) {
return e ? ((e & 1 ? b : 1) * quickpow((b * b) % MOD, e >> 1)) % MOD : 1;
}
int p, a[3000... | replace | 34 | 36 | 34 | 38 | TLE | |
p02950 | C++ | Time Limit Exceeded | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define fr(i, n) for (int i = 0; i < (n); ++i)
#define Fr(i, n) for (int i = 1; i <= (n); ++i)
#define ifr(i, n) for (int i = (n)-1; i >= 0; --i)
#... | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define fr(i, n) for (int i = 0; i < (n); ++i)
#define Fr(i, n) for (int i = 1; i <= (n); ++i)
#define ifr(i, n) for (int i = (n)-1; i >= 0; --i)
#... | replace | 182 | 183 | 182 | 186 | TLE | |
p02950 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)n; i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<pi, pi> pp;
typedef pair<ll, ll> pl;
const double EPS = 1e-9;
const ll MOD = 1000000007;
const int inf = 1 << 30;
const ll linf =... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)n; i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<pi, pi> pp;
typedef pair<ll, ll> pl;
const double EPS = 1e-9;
const ll MOD = 1000000007;
const int inf = 1 << 30;
const ll linf =... | replace | 61 | 63 | 61 | 63 | TLE | |
p02950 | C++ | Time Limit Exceeded | #include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
long long MOD;
struct mint {
long long v;
mint() : v(0) {}
mint(long long x) {
x = x % MOD;
if (x < 0) {
x += MOD;
}
v = x;
}
mint &operator+=(mint a) {
v += a.v;
if (v >= MOD) {
v -= MOD;
... | #include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
long long MOD;
struct mint {
long long v;
mint() : v(0) {}
mint(long long x) {
x = x % MOD;
if (x < 0) {
x += MOD;
}
v = x;
}
mint &operator+=(mint a) {
v += a.v;
if (v >= MOD) {
v -= MOD;
... | replace | 111 | 118 | 111 | 115 | TLE | |
p02950 | C++ | Time Limit Exceeded | #include "bits/stdc++.h"
using namespace std;
using ll = int64_t;
ll MODpow(ll n, ll m, ll mod) {
ll result = 1;
while (m) {
if (m % 2 == 1) {
result *= n;
result %= mod;
}
m /= 2;
n *= n;
n %= mod;
}
return result;
}
class Combination {
public:
Combination(ll max_num, ll m... | #include "bits/stdc++.h"
using namespace std;
using ll = int64_t;
ll MODpow(ll n, ll m, ll mod) {
ll result = 1;
while (m) {
if (m % 2 == 1) {
result *= n;
result %= mod;
}
m /= 2;
n *= n;
n %= mod;
}
return result;
}
class Combination {
public:
Combination(ll max_num, ll m... | replace | 60 | 62 | 60 | 64 | TLE | |
p02950 | C++ | Time Limit Exceeded | #include <iostream>
#include <vector>
int main() {
int p;
std::cin >> p;
std::vector<int> a(p);
for (int i = 0; i < p; i++)
std::cin >> a[i];
auto pow = [&p](long long a, int n) {
long long res = 1;
for (; n; n >>= 1) {
if (n & 1)
res = res * a % p;
a = a * a % p;
}
... | #include <iostream>
#include <vector>
int main() {
int p;
std::cin >> p;
std::vector<int> a(p);
for (int i = 0; i < p; i++)
std::cin >> a[i];
auto pow = [&p](long long a, int n) {
long long res = 1;
for (; n; n >>= 1) {
if (n & 1)
res = res * a % p;
a = a * a % p;
}
... | replace | 42 | 44 | 42 | 45 | TLE | |
p02950 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define RFOR(i, n, m) for (int i = (int)(n); i >= (int)(m); i--)
#define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++)
#define RITR(x, c) for (__typeof(c.... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define RFOR(i, n, m) for (int i = (int)(n); i >= (int)(m); i--)
#define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++)
#define RITR(x, c) for (__typeof(c.... | replace | 143 | 145 | 143 | 146 | TLE | |
p02950 | C++ | Time Limit Exceeded |
// editorial見た。
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
using namespace std;
typedef long long ll;
long long inv(int a, int p) {
return a == 1 ? 1 : (1 - p * inv(p % a, a)) / a ... |
// editorial見た。
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
using namespace std;
typedef long long ll;
long long inv(int a, int p) {
return a == 1 ? 1 : (1 - p * inv(p % a, a)) / a ... | replace | 87 | 88 | 87 | 92 | TLE | |
p02950 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
struct ModInt {
using M = ModInt;
long long MOD;
long long v;
ModInt(long long _v = 0, long long _MOD = 1e9 + 7)
: MOD(_MOD), v(_v % MOD + MOD) {
norm();
}
M &norm() {
v = (v < MOD) ? v : v - MOD;
return *this;
}
M operator+(const M &x) co... | #include <bits/stdc++.h>
using namespace std;
struct ModInt {
using M = ModInt;
long long MOD;
long long v;
ModInt(long long _v = 0, long long _MOD = 1e9 + 7)
: MOD(_MOD), v(_v % MOD + MOD) {
norm();
}
M &norm() {
v = (v < MOD) ? v : v - MOD;
return *this;
}
M operator+(const M &x) co... | replace | 72 | 74 | 72 | 76 | TLE | |
p02950 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <deque>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <vector>
using namespace std;
#define int long long
#define rep(s, i, n) for (int i = s; i < n; i++)
#define c(n) cout << n << endl;
#define ic(n) ... | #include <algorithm>
#include <cmath>
#include <deque>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <vector>
using namespace std;
#define int long long
#define rep(s, i, n) for (int i = s; i < n; i++)
#define c(n) cout << n << endl;
#define ic(n) ... | replace | 357 | 359 | 357 | 358 | -11 | |
p02950 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn = 2e3 + 50;
ll mod = 998244353;
ll qm(ll a, ll b) {
ll res = 1;
while (b) {
if (b & 1)
res = res * a % mod;
a = a * a % mod, b >>= 1;
}
return res;
}
ll a[maxn], b[maxn], c[maxn], temp[maxn];
ll x[maxn], y[maxn];
ll ... | #include <bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn = 3e3 + 50;
ll mod = 998244353;
ll qm(ll a, ll b) {
ll res = 1;
while (b) {
if (b & 1)
res = res * a % mod;
a = a * a % mod, b >>= 1;
}
return res;
}
ll a[maxn], b[maxn], c[maxn], temp[maxn];
ll x[maxn], y[maxn];
ll ... | replace | 3 | 4 | 3 | 4 | 0 | |
p02950 | Python | Time Limit Exceeded | p = int(input())
def div(a, b):
n = len(a)
m = len(b)
res = [0] * (n - m + 1)
tmp = pow(b[-1], p - 2, p)
for i in range(n - m, -1, -1):
t = a[i + m - 1] * tmp % p
res[i] = t
for j in range(m):
a[i + j] = (a[i + j] - t * b[j]) % p
return res
a = list(map(in... | p = int(input())
def div(a, b):
n = len(a)
m = len(b)
res = [0] * (n - m + 1)
tmp = pow(b[-1], p - 2, p)
for i in range(n - m, -1, -1):
t = a[i + m - 1] * tmp % p
res[i] = t
for j in range(m):
a[i + j] = (a[i + j] - t * b[j]) % p
return res
a = list(map(in... | replace | 35 | 36 | 35 | 36 | TLE | |
p02950 | Python | Time Limit Exceeded | p = int(input())
a = list(map(int, input().split()))
MOD = p
MAX = p + 10
fact = [1] * (MAX + 1) # i!
finv = [1] * (MAX + 1) # (i!)^{-1}
iinv = [1] * (MAX + 1) # i^{-1}
for i in range(2, MAX + 1):
fact[i] = fact[i - 1] * i % MOD
iinv[i] = MOD - iinv[MOD % i] * (MOD // i) % MOD
finv[i] = finv[i - 1] * ii... | p = int(input())
a = list(map(int, input().split()))
MOD = p
MAX = p + 10
fact = [1] * (MAX + 1) # i!
finv = [1] * (MAX + 1) # (i!)^{-1}
iinv = [1] * (MAX + 1) # i^{-1}
for i in range(2, MAX + 1):
fact[i] = fact[i - 1] * i % MOD
iinv[i] = MOD - iinv[MOD % i] * (MOD // i) % MOD
finv[i] = finv[i - 1] * ii... | replace | 25 | 26 | 25 | 26 | TLE | |
p02950 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
// #define int ll
using PII = pair<ll, ll>;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
// #define int ll
using PII = pair<ll, ll>;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template ... | replace | 179 | 180 | 179 | 184 | TLE | |
p02950 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define int long long
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
typedef pair<int, int> pii;
const int INF = 1l << 60;
#define u_b upper_bound
#define l_b lower_bound
int P;
int ans[3030]; // Σans[i]*x^i
__inline int power(int a, int b, int p) {
int res = 1;
whi... | #include <bits/stdc++.h>
#define int long long
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
typedef pair<int, int> pii;
const int INF = 1l << 60;
#define u_b upper_bound
#define l_b lower_bound
int P;
int ans[3030]; // Σans[i]*x^i
__inline int power(int a, int b, int p) {
int res = 1;
whi... | replace | 41 | 42 | 41 | 42 | TLE | |
p02951 | C++ | Runtime Error | #include "iostream"
#include "stdio.h"
using namespace std;
int main() {
int a, b, c;
int ret = 0;
cin >> a;
cin >> b;
cin >> c;
if (c >= (a - b)) {
ret = c - a + b;
} else {
ret = 0;
}
cout << ret;
return ret;
}
| #include "iostream"
#include "stdio.h"
using namespace std;
int main() {
int a, b, c;
int ret = 0;
cin >> a;
cin >> b;
cin >> c;
if (c >= (a - b)) {
ret = c - a + b;
} else {
ret = 0;
}
cout << ret;
return 0;
}
| replace | 16 | 17 | 16 | 17 | 1 | |
p02951 | C++ | Runtime Error | // Lets go to the next level
// AIM CM at CF *__* asap
// Hit A,B,C and D faster and reach Candidate Master
// Remember you were also a novice when you started,
// hence never be rude to anyone who wants to learn something
// Never open a ranklist untill and unless you are done with solving problems,
// wastes 3/4 minu... | // Lets go to the next level
// AIM CM at CF *__* asap
// Hit A,B,C and D faster and reach Candidate Master
// Remember you were also a novice when you started,
// hence never be rude to anyone who wants to learn something
// Never open a ranklist untill and unless you are done with solving problems,
// wastes 3/4 minu... | replace | 80 | 84 | 80 | 84 | 0 | |
p02951 | Python | Runtime Error | a, b, c = input().splita, b, c = [int(x) for x in input().strip().split()]
water = c - (a - b)
if water < 0:
print(0)
else:
print(water)
| a, b, c = [int(x) for x in input().strip().split()]
water = c - (a - b)
if water < 0:
print(0)
else:
print(water)
| replace | 0 | 1 | 0 | 1 | EOFError: EOF when reading a line | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02951/Python/s087836716.py", line 1, in <module>
a, b, c = input().splita, b, c = [int(x) for x in input().strip().split()]
EOFError: EOF when reading a line
|
p02951 | Python | Runtime Error | a, b, c = map(int, input().split())
print(max(c - (a - b)), 0)
| a, b, c = map(int, input().split())
print(max(c - (a - b), 0))
| replace | 1 | 2 | 1 | 2 | TypeError: 'int' object is not iterable | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02951/Python/s849480716.py", line 2, in <module>
print(max(c - (a - b)), 0)
TypeError: 'int' object is not iterable
|
p02951 | Python | Runtime Error | A, B, C = map(int, input().split())
rest: int = C - (A - B)
result: int = rest if rest >= 0 else 0
print(result)
| A, B, C = map(int, input().split())
rest = C - (A - B)
result = rest if rest >= 0 else 0
print(result)
| replace | 1 | 3 | 1 | 3 | 0 | |
p02951 | Python | Runtime Error | a, b, c = map(int, (input().split()))
print(max(c - (a - b), 0))
a, b, c = map(int, (input().split()))
print(max(c - (a - b), 0))
a, b, c = map(int, (input().split()))
print(max(c - (a - b), 0))
a, b, c = map(int, (input().split()))
print(max(c - (a - b), 0))
a, b, c = map(int, (input().split()))
print(max(c - (a - b),... | a, b, c = map(int, (input().split()))
print(max(c - (a - b), 0))
| delete | 2 | 20 | 2 | 2 | EOFError: EOF when reading a line | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02951/Python/s280962278.py", line 3, in <module>
a, b, c = map(int, (input().split()))
EOFError: EOF when reading a line
|
p02951 | Python | Runtime Error | num = input().split()
a = num[0]
b = num[1]
c = num[2]
ans = b + c - a
if ans > 0:
print(ans)
else:
print(0)
| num = input().split()
a = int(num[0])
b = int(num[1])
c = int(num[2])
ans = b + c - a
if ans > 0:
print(ans)
else:
print(0)
| replace | 1 | 4 | 1 | 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/p02951/Python/s319382696.py", line 5, in <module>
ans = b + c - a
TypeError: unsupported operand type(s) for -: 'str' and 'str'
|
p02951 | Python | Runtime Error | i = list(map(int, input().split()))
print(i[2] - (i[0] - i[1]))
i = list(map(int, input().split()))
n = i[2] - (i[0] - i[1])
if n > 0:
print(n)
else:
print(0)
| i = list(map(int, input().split()))
n = i[2] - (i[0] - i[1])
if n > 0:
print(n)
else:
print(0)
| delete | 0 | 2 | 0 | 0 | EOFError: EOF when reading a line | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02951/Python/s799517998.py", line 3, in <module>
i = list(map(int, input().split()))
EOFError: EOF when reading a line
|
p02951 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define ll long long
#define ld long double
#define pii pair<int, int>
#define vi vector<int>
#define mii map<int, int>
#define umii unordered_map<int, int>
#define pb push_back
#define mk make_pair
#define all(a) a.begin(), a.end()
#defin... | #include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define ll long long
#define ld long double
#define pii pair<int, int>
#define vi vector<int>
#define mii map<int, int>
#define umii unordered_map<int, int>
#define pb push_back
#define mk make_pair
#define all(a) a.begin(), a.end()
#defin... | replace | 24 | 28 | 24 | 28 | 0 | |
p02951 | C++ | Runtime Error | #include <iostream>
#include <sstream>
struct Scanner {
std::string pp(const char ch) {
if (ch == EOF) {
return "EOF";
} else {
return std::string(1, ch);
}
}
void readSpace() {
auto ch = getchar();
if (ch != ' ') {
throw std::runtime_error(std::string("want: Space, got: ") +... | #include <iostream>
#include <sstream>
struct Scanner {
std::string pp(const char ch) {
if (ch == EOF) {
return "EOF";
} else {
return std::string(1, ch);
}
}
void readSpace() {
auto ch = getchar();
if (ch != ' ') {
throw std::runtime_error(std::string("want: Space, got: ") +... | replace | 67 | 68 | 67 | 68 | -6 | terminate called after throwing an instance of 'std::runtime_error'
what(): want: EOF, got:
|
p02951 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define forn(i, _n) for (int i = 0; i <= (_n); ++i)
#define forab(i, _a, _b) for (int i = (_a); i <= (_b); ++i)
#define forrn(i, _n) for (int i = n - 1; i >= 0; --i)
#define forrab(i, _a, _b) for (int i = _a; i >= b; --i)
#define tcase ... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define forn(i, _n) for (int i = 0; i <= (_n); ++i)
#define forab(i, _a, _b) for (int i = (_a); i <= (_b); ++i)
#define forrn(i, _n) for (int i = n - 1; i >= 0; --i)
#define forrab(i, _a, _b) for (int i = _a; i >= b; --i)
#define tcase ... | replace | 32 | 36 | 32 | 36 | 0 | |
p02951 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int N = S.size();
vector<int> A(N, 1);
vector<int> B(N, 0);
vector<int> C(N, 0);
for (int i = 0; i < pow(10, 4); i++) {
for (int j = 0; j < N; j++) {
if (S.at(j) == 'R')
B.at(j + 1) += A.at(j);
else
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int c, a, b;
cin >> a >> b >> c;
cout << max(c - a + b, 0) << endl;
}
| replace | 4 | 26 | 4 | 7 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): vector::_M_range_check: __n (which is 18446744073709551615) >= this->size() (which is 1)
|
p02951 | C++ | Runtime Error | /*_BELIEVE_*/
// CF,CC,AtC,SPOJ: hp1999
// HE: hemant269
// HR: hemant2132
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define fast() \
ios::sync_with_stdio(0); \
cin.ti... | /*_BELIEVE_*/
// CF,CC,AtC,SPOJ: hp1999
// HE: hemant269
// HR: hemant2132
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define fast() \
ios::sync_with_stdio(0); \
cin.ti... | delete | 35 | 41 | 35 | 35 | 0 | |
p02951 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
#define vi vector<int>
#define vc vector<char>
#define vt vector<string>
#define si set<int>
#define sc set<char>
#define st set<string>
#define pii pair<int, int>
#define fi first
#define se second
#define pb pushback;
using namespace std;
int main() {
int a, b, c;
c... | #include <bits/stdc++.h>
#define ll long long
#define vi vector<int>
#define vc vector<char>
#define vt vector<string>
#define si set<int>
#define sc set<char>
#define st set<string>
#define pii pair<int, int>
#define fi first
#define se second
#define pb pushback;
using namespace std;
int main() {
int a, b, c;
c... | replace | 18 | 19 | 18 | 19 | 0 | |
p02951 | C++ | Runtime Error | #include <algorithm>
#include <chrono>
#include <climits>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
#define pii pair<int, int... | #include <algorithm>
#include <chrono>
#include <climits>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
#define pii pair<int, int... | replace | 41 | 45 | 41 | 45 | 0 | |
p02951 | C++ | Runtime Error | #include <bits/stdc++.h>
#define range 524289
#define mod 1000000007
#define eps 1e-9
#define PI 3.14159265358979323846
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define ALL(V) V.begin(), V.end()
#define _ << " " <<
using namespace std;
typedef long long ll;
t... | #include <bits/stdc++.h>
#define range 524289
#define mod 1000000007
#define eps 1e-9
#define PI 3.14159265358979323846
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define ALL(V) V.begin(), V.end()
#define _ << " " <<
using namespace std;
typedef long long ll;
t... | replace | 25 | 29 | 25 | 29 | 0 | |
p02951 | C++ | Runtime Error | // TOPSIC001_0
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef int _loop_int;
#define REP(i, n) for (_loop_int i = 0; i < (_loop_int)(n); ++i)
#define FOR(i, a, b) for (_loop_int i = (_l... | // TOPSIC001_0
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef int _loop_int;
#define REP(i, n) for (_loop_int i = 0; i < (_loop_int)(n); ++i)
#define FOR(i, a, b) for (_loop_int i = (_l... | replace | 43 | 44 | 43 | 48 | 1 | |
p02951 | C++ | Runtime Error | #ifndef BZ
#pragma GCC optimize "-O3"
#endif
#include <bits/stdc++.h>
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ldb;
#define pb push_back
#define popb pop_back
#define si size()
#define be begin()
#define en end()
#define all(v) v.be, v.en
#define le length()
#define mp make_... | #ifndef BZ
#pragma GCC optimize "-O3"
#endif
#include <bits/stdc++.h>
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ldb;
#define pb push_back
#define popb pop_back
#define si size()
#define be begin()
#define en end()
#define all(v) v.be, v.en
#define le length()
#define mp make_... | replace | 77 | 78 | 77 | 78 | 0 | |
p02951 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
while (a != b || c != 0) {
b++;
c--;
}
cout << c << endl;
return 0;
} | #include <iostream>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
if (a - b > 0) {
c = c - (a - b);
}
if (c < 0) {
c = 0;
}
cout << c << endl;
return 0;
} | replace | 7 | 10 | 7 | 12 | TLE | |
p02951 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
return max(c - (a - b), 0);
} | #include <iostream>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
cout << max(c - a + b, 0);
return 0;
} | replace | 6 | 7 | 6 | 8 | 1 | |
p02951 | C++ | Runtime Error | // This is getting accepted!
#include <bits/stdc++.h>
#define ll long long
#define oo 1000000009
#define FOR(i, a, b) for (int i = (a); i <= (b); ++i)
#define INARR(a, n) \
for (int i = 1; i <= (n); ++i) \
cin... | // This is getting accepted!
#include <bits/stdc++.h>
#define ll long long
#define oo 1000000009
#define FOR(i, a, b) for (int i = (a); i <= (b); ++i)
#define INARR(a, n) \
for (int i = 1; i <= (n); ++i) \
cin... | replace | 64 | 65 | 64 | 65 | 0 | |
p02951 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
//****************************************************
#define lp(var, start, end) for (ll var = start; var < end; ++var)
#define rlp(var, start, end) for (ll var = start; var >= end; var--)
#define pb push_back
#define mp... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
//****************************************************
#define lp(var, start, end) for (ll var = start; var < end; ++var)
#define rlp(var, start, end) for (ll var = start; var >= end; var--)
#define pb push_back
#define mp... | delete | 50 | 55 | 50 | 50 | 0 | |
p02951 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B, C, rest;
cin >> A >> B >> C;
rest = A - B;
C = C - rest;
if (C <= 0) {
return 0;
}
return C;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B, C, rest;
cin >> A >> B >> C;
rest = A - B;
C = C - rest;
if (C <= 0) {
cout << 0;
} else
cout << C;
}
| replace | 10 | 13 | 10 | 13 | 1 | |
p02952 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// Optimisations
#pragma GCC target("avx2")
#pragma GCC optimization("unroll-loops")
#pragma GCC optimize("O2")
// shortcuts for functions
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define endl "\n"
#define all(v) v.begin(), v.end()
#defin... | #include <bits/stdc++.h>
using namespace std;
// Optimisations
#pragma GCC target("avx2")
#pragma GCC optimization("unroll-loops")
#pragma GCC optimize("O2")
// shortcuts for functions
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define endl "\n"
#define all(v) v.begin(), v.end()
#defin... | insert | 172 | 172 | 172 | 176 | 0 | |
p02952 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, c = 0;
scanf("%d", &a);
for (int i = 1; i <= a; i++) {
int b = 0;
int t = i;
while (t) {
b++;
t / 10;
}
if (b % 2 == 1) {
c++;
}
}
printf("%d", c);
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, c = 0;
scanf("%d", &a);
for (int i = 1; i <= a; i++) {
int b = 0;
int t = i;
while (t) {
b++;
t = t / 10;
}
if (b % 2 == 1) {
c++;
}
}
printf("%d", c);
} | replace | 10 | 11 | 10 | 11 | TLE | |
p02952 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
string s = to_string(n);
int ct = s.size();
int res = 0;
if (ct & 1) {
string tmp = "";
for (int i = 0; i < ct - 1; ++i)
tmp += '9';
ct -= 2;
res += n - stoi(tmp);
} else {
ct--;
}
for (int i = 1; i ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
string s = to_string(n);
int ct = s.size();
int res = 0;
if (ct == 1) {
cout << n << endl;
return 0;
}
if (ct & 1) {
string tmp = "";
for (int i = 0; i < ct - 1; ++i)
tmp += '9';
ct -= 2;
res += n ... | insert | 9 | 9 | 9 | 13 | 0 | |
p02952 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int ans = 0;
int digit = 0;
for (int i = 1; i <= N; i++) {
digit = 0;
int a = i;
while (a != 0) {
digit++;
a / (10);
if (a == 0) {
break;
}
}
if (digit % 2 == 1) {
ans++;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int ans = 0;
int digit = 0;
for (int i = 1; i <= N; i++) {
digit = 0;
int a = i;
while (a != 0) {
digit++;
a /= (10);
}
if (digit % 2 == 1) {
ans++;
}
}
cout << ans << endl;
}
| replace | 13 | 17 | 13 | 14 | TLE | |
p02952 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
// inf
constexpr ll infl = 10000000000000000LL;
constexpr int inf = 1000000000;
int main() {
... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
// inf
constexpr ll infl = 10000000000000000LL;
constexpr int inf = 1000000000;
int main() {
... | insert | 20 | 20 | 20 | 21 | TLE | |
p02952 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int ten(int n) {
int ret = 1;
for (int i = 0; i < n; ++i) {
ret *= 10;
}
return ret;
}
int main() {
string n;
cin >> n;
int ans = 0;
int m = n.size();
if (n.size() % 2 == 1) {
ans += stoi(n);
string t(m - 1, '9');
ans -= stoi(t);
--m... | #include <bits/stdc++.h>
using namespace std;
int ten(int n) {
int ret = 1;
for (int i = 0; i < n; ++i) {
ret *= 10;
}
return ret;
}
int main() {
string n;
cin >> n;
if (n.size() == 1) {
cout << n[0] - '0' << endl;
return 0;
}
int ans = 0;
int m = n.size();
if (n.size() % 2 == 1) {
... | insert | 15 | 15 | 15 | 19 | 0 | |
p02952 | C++ | Time Limit Exceeded | //
// main.cpp
// test
//
// Created by 田宇航 on 2019/8/4.
// Copyright © 2019 田宇航. All rights reserved.
//
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <stack>
#include <string>
using namespace std;
#define INF 0x3f3f3f3f
#define MAXN 100000 + 50
#define MAX... | //
// main.cpp
// test
//
// Created by 田宇航 on 2019/8/4.
// Copyright © 2019 田宇航. All rights reserved.
//
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <stack>
#include <string>
using namespace std;
#define INF 0x3f3f3f3f
#define MAXN 100000 + 50
#define MAX... | replace | 44 | 45 | 44 | 45 | TLE | |
p02952 | Python | Runtime Error | def fn(i):
return (1 <= i and i <= 9) or (100 <= i and i <= 999) or (10000 <= i and i <= 99999)
def main():
n = int(input())
x = list(range(n + 1)[1:])
x = filter(fn, x)
print(len(x))
if __name__ == "__main__":
main()
| def fn(i):
return (1 <= i and i <= 9) or (100 <= i and i <= 999) or (10000 <= i and i <= 99999)
def main():
n = int(input())
x = range(n + 1)[1:]
x = tuple(filter(fn, x))
print(len(x))
if __name__ == "__main__":
main()
| replace | 6 | 9 | 6 | 8 | TypeError: object of type 'filter' has no len() | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02952/Python/s605621965.py", line 16, in <module>
main()
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02952/Python/s605621965.py", line 12, in main
print(len(x))
TypeError: object ... |
p02952 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
template <typename T> void scanInt(T &x) {
bool neg = false;
register int c = getchar_unlocked();
x = 0;
for (; (c < 48 || c > 57) && (c != '-'); c = getchar_unlocked())
;
if (c == '-') {
neg = true;
c = getchar_unlocked();
}
for... | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
template <typename T> void scanInt(T &x) {
bool neg = false;
register int c = getchar_unlocked();
x = 0;
for (; (c < 48 || c > 57) && (c != '-'); c = getchar_unlocked())
;
if (c == '-') {
neg = true;
c = getchar_unlocked();
}
for... | delete | 50 | 55 | 50 | 50 | 0 | |
p02952 | Python | Runtime Error | n = int(input())
cnt = 0
for i in range(1, n + 1):
if str(i) % 2 == 1:
cnt += 1
print(cnt)
| n = int(input())
cnt = 0
for i in range(1, n + 1):
if len(str(i)) % 2 == 1:
cnt += 1
print(cnt)
| replace | 3 | 4 | 3 | 4 | TypeError: not all arguments converted during string formatting | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02952/Python/s429203628.py", line 4, in <module>
if str(i) % 2 == 1:
TypeError: not all arguments converted during string formatting
|
p02952 | Python | Runtime Error | def main(n):
count = 0
for i in range(n + 1):
if str(i).__len__ % 2 == 1:
count += 1
print(count)
if __name__ == "__main__":
n = int(input())
main(n)
| def main(n):
count = 0
for i in range(1, n + 1):
if len(str(i)) % 2 == 1:
count += 1
print(count)
if __name__ == "__main__":
n = int(input())
main(n)
| replace | 3 | 5 | 3 | 5 | TypeError: unsupported operand type(s) for %: 'method-wrapper' and 'int' | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02952/Python/s049865581.py", line 14, in <module>
main(n)
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02952/Python/s049865581.py", line 5, in main
if str(i).__len__ % 2 == 1:
Type... |
p02952 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define all(a) (a).begin(), (a).end()
#define all2(a, b) (a).begin(), (a).begin() + (b)
#define debug(vari) cerr << #vari << " = " << (vari) << endl... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define all(a) (a).begin(), (a).end()
#define all2(a, b) (a).begin(), (a).begin() + (b)
#define debug(vari) cerr << #vari << " = " << (vari) << endl... | replace | 18 | 21 | 18 | 22 | TLE | |
p02952 | C++ | Runtime Error | #include "bits/stdc++.h"
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define MOD 1e9 + 7;
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long LL;
typedef vector<int> VI;
typedef vector... | #include "bits/stdc++.h"
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define MOD 1e9 + 7;
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long LL;
typedef vector<int> VI;
typedef vector... | insert | 15 | 15 | 15 | 19 | 0 | |
p02952 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, S, sum, ans = 0;
cin >> N;
while (N > 0) {
sum = 0;
S = N;
while (S > 0) {
S / 10;
sum++;
}
if (sum % 2 == 1) {
ans++;
}
N--;
}
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, S, sum, ans = 0;
cin >> N;
while (N > 0) {
sum = 0;
S = N;
while (S > 0) {
S /= 10;
sum++;
}
if (sum % 2 == 1) {
ans++;
}
N--;
}
cout << ans << endl;
} | replace | 10 | 11 | 10 | 11 | TLE | |
p02952 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int number = 0;
for (int i = 1; i < N + 1; i++) {
int count = 0;
while (i != 0) {
i /= 10;
count++;
}
if (count % 2 == 1) {
number++;
}
}
cout << number << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int number = 0;
for (int i = 1; i < N + 1; i++) {
int count = 0;
int a = i;
while (a != 0) {
a /= 10;
count++;
}
if (count % 2 == 1) {
number++;
}
}
cout << number << endl;
} | replace | 8 | 10 | 8 | 11 | TLE | |
p02952 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
//****************************************************
#define lp(var, start, end) for (ll var = start; var < end; ++var)
#define rlp(var, start, end) for (ll var = start; var >= end; var--)
#define pb push_back
#define mp... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
//****************************************************
#define lp(var, start, end) for (ll var = start; var < end; ++var)
#define rlp(var, start, end) for (ll var = start; var >= end; var--)
#define pb push_back
#define mp... | delete | 59 | 64 | 59 | 59 | TLE | |
p02952 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int int1;
cin >> int1;
int p = 0;
for (int int2 = 1; int2 <= int1; int2++) {
int s = 0;
int n = int2;
while (n != 0) {
n - n / 10;
s++;
}
if (s % 2 == 1) {
p++;
}
}
cout << p << endl;
} | #include <iostream>
using namespace std;
int main() {
int int1;
cin >> int1;
int p = 0;
for (int int2 = 1; int2 <= int1; int2++) {
int s = std::to_string(int2).length();
if (s % 2 == 1) {
p++;
}
}
cout << p << endl;
} | replace | 10 | 16 | 10 | 11 | TLE | |
p02952 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int e = 0;
for (int i = 1; i <= n; i++) {
int d = i;
int c = 0;
while (d > 0) {
n /= 10;
c++;
}
if (c % 2 == 1) {
e++;
}
}
cout << e;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int e = 0;
for (int i = 1; i <= n; i++) {
int d = i;
int c = 0;
while (d > 0) {
d /= 10;
c++;
}
if (c % 2 == 1) {
e++;
}
}
cout << e;
}
| replace | 10 | 11 | 10 | 11 | TLE | |
p02952 | Python | Runtime Error | N = int(input())
ans = 0
for i in range(1, N + 1):
if len(i) % 2 == 1:
ans += 1
print(ans)
| N = int(input())
ans = 0
for i in range(1, N + 1):
if len(str(i)) % 2 == 1:
ans += 1
print(ans)
| replace | 3 | 4 | 3 | 4 | TypeError: object of type 'int' has no len() | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02952/Python/s356122342.py", line 4, in <module>
if len(i) % 2 == 1:
TypeError: object of type 'int' has no len()
|
p02952 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int n, k = 1, ans = 0, i = 10;
cin >> n;
for (; i <= n; i *= 100) {
ans += i * 0.9;
}
if (n / (i / 100) > 9)
ans += n - i / 10 + 1;
cout << ans;
}
| #include <iostream>
using namespace std;
int main() {
int n, k = 1, ans = 0, i = 10;
cin >> n;
if (n < 10) {
cout << n;
return 0;
}
for (; i <= n; i *= 100) {
ans += i * 0.9;
}
if (n / (i / 100) > 9)
ans += n - i / 10 + 1;
cout << ans;
}
| insert | 5 | 5 | 5 | 9 | 0 | |
p02952 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using P = pair<int, int>;
#include <algorithm>
#include <map>
#include <math.h>
#include <queue>
int main() {
int n;
cin >> n;
ll ans(0);
rep(i, n + 1) {
int c(0);
int j = i... | #include <iostream>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using P = pair<int, int>;
#include <algorithm>
#include <map>
#include <math.h>
#include <queue>
int main() {
int n;
cin >> n;
ll ans(0);
rep(i, n + 1) {
int c(0);
int j = i... | replace | 28 | 29 | 28 | 29 | 9 | |
p02952 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
string s;
int n, ans = 0, nums[4];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
nums[1] = 9;
nums[3] = 909;
nums[5] = 90909;
nums[7] = 90910;
cin >> s;
n = stoi(s);
int l = s.size();
if (l % 2 == 0) {
l--;
ans = nums[l];
} el... | #include "bits/stdc++.h"
using namespace std;
string s;
int n, ans = 0, nums[8];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
nums[1] = 9;
nums[3] = 909;
nums[5] = 90909;
nums[7] = 90910;
cin >> s;
n = stoi(s);
int l = s.size();
if (l % 2 == 0) {
l--;
ans = nums[l];
} el... | replace | 4 | 5 | 4 | 5 | 0 | |
p02952 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
bool f(int x) {
int keta = 0;
while (x) {
keta++;
x / 10;
}
return keta % 2 == 1;
}
int main() {
int n;
cin >> n;
int ans = 0;
for (int i = 1; i <= n; i++) {
if (f(i))
ans++;
}
cout << ans << endl;
}
| #include <bits/stdc++.h>
using namespace std;
bool f(int x) {
int keta = 0;
while (x) {
keta++;
x /= 10;
}
return keta % 2 == 1;
}
int main() {
int n;
cin >> n;
int ans = 0;
for (int i = 1; i <= n; i++) {
if (f(i))
ans++;
}
cout << ans << endl;
}
| replace | 6 | 7 | 6 | 7 | TLE | |
p02952 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int sum = 0;
for (int i = 1; i <= n; i++) {
int cnt = 1;
while (i > 0) {
i /= 10;
cnt++;
}
if (cnt % 2 == 1) {
sum++;
}
}
cout << sum << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int sum = 0;
for (int i = 1; i <= n; i++) {
string s = to_string(i);
int size = s.size();
if (size % 2 == 1) {
sum++;
}
}
cout << sum << endl;
} | replace | 8 | 14 | 8 | 12 | TLE | |
p02952 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int count = 0;
for (int i = n; i > 0; i++) {
string s = to_string(i);
if (s.size() == 1 || s.size() == 3 || s.size() == 5)
count++;
}
cout << count << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int count = 0;
for (int i = n; i > 0; i--) {
string s = to_string(i);
if (s.size() == 1 || s.size() == 3 || s.size() == 5)
count++;
}
cout << count << endl;
}
| replace | 8 | 9 | 8 | 9 | TLE | |
p02953 | 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 all(n) begin(n), end(n)
struct cww {
cww() {
ios::sync_with_stdio(false);
cin.tie(0);
}
} star;
const long long INF = numeric_limits<long long>::max();
ty... | #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 all(n) begin(n), end(n)
struct cww {
cww() {
ios::sync_with_stdio(false);
cin.tie(0);
}
} star;
const long long INF = numeric_limits<long long>::max();
ty... | replace | 25 | 26 | 25 | 26 | -11 | |
p02953 | C++ | Runtime Error | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long int ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
const... | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long int ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
const... | replace | 18 | 22 | 18 | 22 | 0 | |
p02953 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
long h[10100];
for (int i = 0; i < n; i++)
cin >> h[i];
for (int i = n - 2; i >= 0; i--) {
if (h[i] > h[i + 1])
h[i]--;
}
bool f = true;
for (int i = 0; i < n - 1; i++) {
if (h[i] > h[i + 1])
f = false... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
long h[101000];
for (int i = 0; i < n; i++)
cin >> h[i];
for (int i = n - 2; i >= 0; i--) {
if (h[i] > h[i + 1])
h[i]--;
}
bool f = true;
for (int i = 0; i < n - 1; i++) {
if (h[i] > h[i + 1])
f = fals... | replace | 6 | 7 | 6 | 7 | 0 | |
p02953 | C++ | Runtime Error | #define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
/* define */
#define Yes(X) puts((X) ? "Yes" : "No")
#define YES(X) puts((X) ? "YES" : "NO")
#define FOR(i, a,... | #define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
/* define */
#define Yes(X) puts((X) ? "Yes" : "No")
#define YES(X) puts((X) ? "YES" : "NO")
#define FOR(i, a,... | replace | 49 | 50 | 49 | 50 | 0 | |
p02953 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <istream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <vector>
#define rep0(i, n) for (int i = 0; i <= (n); ++i)
#define rep1(i, n) for (int i = 1; i ... | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <istream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <vector>
#define rep0(i, n) for (int i = 0; i <= (n); ++i)
#define rep1(i, n) for (int i = 1; i ... | replace | 37 | 38 | 37 | 38 | 0 | |
p02953 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
int n, i, j;
cin >> n;
int h[n];
for (i = 0; i < n; i++) {
cin >> h[i];
}
string ans = "Yes";
for (i = 0; i < n - 1; i++) {
if (ans == "No")
break;
for (j = i + 1; j < n; j++) {
if (h[i]... | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
int n, i, j;
cin >> n;
int h[n];
for (i = 0; i < n; i++) {
cin >> h[i];
}
string ans = "Yes";
int maxh[n];
int max = 0;
for (i = 0; i < n; i++) {
if (max <= h[i]) {
max = h[i];
maxh[i] =... | replace | 15 | 24 | 15 | 28 | TLE | |
p02953 | Python | Runtime Error | """
https://atcoder.jp/contests/abc136/tasks/abc136_c
"""
import numpy as np
def calc(N: int, values: np.ndarray) -> bool:
# 要素が1つなら確定でOK
if len(values) == 1:
return True
# 2つ以上下がっている部分があるとNG
gradient = np.diff(values)
if np.min(gradient) <= -2:
return False
# 要素が2つでならこの時点でO... | """
https://atcoder.jp/contests/abc136/tasks/abc136_c
"""
import numpy as np
def calc(N: int, values: np.ndarray) -> bool:
# 要素が1つなら確定でOK
if len(values) == 1:
return True
# 2つ以上下がっている部分があるとNG
gradient = np.diff(values)
if np.min(gradient) <= -2:
return False
# 要素が2つでならこの時点でO... | insert | 23 | 23 | 23 | 25 | TLE | |
p02953 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const long long mod = 1e9 + 7; // 10^9+7
int main() {
int n;
ll h[200000];
int sw[200000];
cin >> n;
for (int i = 0; i < n; i++) {
cin >> h[i];
sw[i] = 0;
}
if (n == 1) {
cout << "Yes" << endl;
return 0;
}
int flg =... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const long long mod = 1e9 + 7; // 10^9+7
int main() {
int n;
ll h[200000];
int sw[200000];
cin >> n;
for (int i = 0; i < n; i++) {
cin >> h[i];
sw[i] = 0;
}
if (n == 1) {
cout << "Yes" << endl;
return 0;
}
int flg =... | insert | 39 | 39 | 39 | 41 | TLE | |
p02953 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// 総数を1000000007で割った余り
const long long mod = 1e9 + 7;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<... | #include <bits/stdc++.h>
using namespace std;
// 総数を1000000007で割った余り
const long long mod = 1e9 + 7;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<... | replace | 47 | 48 | 47 | 48 | 0 | |
p02953 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// 総数を1000000007で割った余り
const long long mod = 1e9 + 7;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<... | #include <bits/stdc++.h>
using namespace std;
// 総数を1000000007で割った余り
const long long mod = 1e9 + 7;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<... | replace | 47 | 48 | 47 | 49 | 0 | |
p02953 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> arr(n);
vector<bool> v(n, false);
for (int i = 0; i < n; i++)
cin >> arr[i];
bool flag = true;
for (int i = 1; i < n && i >= 0;) {
if (arr[i - 1] - arr[i] > 1) {
flag = false;
break;
} e... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> arr(n);
vector<bool> v(n, false);
for (int i = 0; i < n; i++)
cin >> arr[i];
bool flag = true;
for (int i = n - 2; i >= 0; i--) {
if (arr[i + 1] < arr[i]) {
if (arr[i + 1] + 1 == arr[i])
ar... | replace | 17 | 36 | 17 | 24 | TLE | |
p02953 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using lint = long long int;
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
#define REP(i, n) for (lint i = 0; i < (n); i++)
#define REP1(i, n) for (lint i = 1; i < (n); i++)
lint N;
int canAlinement(vector<lint> *v) {
map<int, int> hash;
for (int i = N... | #include <bits/stdc++.h>
using namespace std;
using lint = long long int;
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
#define REP(i, n) for (lint i = 0; i < (n); i++)
#define REP1(i, n) for (lint i = 1; i < (n); i++)
lint N;
int canAlinement(vector<lint> *v) {
map<int, int> hash;
for (int j = N... | replace | 11 | 20 | 11 | 16 | TLE | |
p02953 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int n;
int h[10000];
int ans = 0;
int f = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> h[i];
}
h[0]--;
for (int i = 0; i < n - 1; i++) {
if (h[i] > h[i + 1]) {
f = 1;
break;
}
if (h[i] < h[i + 1]) {
h[i... | #include <iostream>
using namespace std;
int main() {
int n;
int h[100000];
int ans = 0;
int f = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> h[i];
}
h[0]--;
for (int i = 0; i < n - 1; i++) {
if (h[i] > h[i + 1]) {
f = 1;
break;
}
if (h[i] < h[i + 1]) {
h[... | replace | 6 | 7 | 6 | 7 | 0 | |
p02953 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int n, a[10010], minn = 0X7fffffff;
int main() {
cin >> n;
for (int i = 1; i <= n; i++)
cin >> a[i];
for (int i = n; i >= 1; i--) {
if (a[i] - minn >= 2) {
cout << "No" << endl;
return 0;
}
minn = min(minn, a[i]);
}
cout << "Yes" << end... | #include <bits/stdc++.h>
using namespace std;
int n, a[100010], minn = 0X7FFFFFFF;
int main() {
cin >> n;
for (int i = 1; i <= n; i++)
cin >> a[i];
for (int i = n; i >= 1; i--) {
if (a[i] - minn >= 2) {
cout << "No" << endl;
return 0;
}
minn = min(minn, a[i]);
}
cout << "Yes" << en... | replace | 2 | 3 | 2 | 3 | 0 | |
p02953 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> vec(N);
for (int i = 0; i < N; i++) {
cin >> vec.at(i);
}
if (N == 1) {
cout << "Yes" << endl;
return 0;
}
if (N == 2) {
if (vec.at(1) - vec.at(0) >= 2) {
cout << "No" << e... | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> vec(N);
for (int i = 0; i < N; i++) {
cin >> vec.at(i);
}
if (N == 1) {
cout << "Yes" << endl;
return 0;
}
if (N == 2) {
if (vec.at(1) - vec.at(0) >= 2) {
cout << "No" << e... | replace | 25 | 28 | 25 | 38 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): vector::_M_range_check: __n (which is 18446744073709551615) >= this->size() (which is 5)
|
p02953 | C++ | Runtime Error | #include <algorithm>
#include <bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
#define rep(a, b, c) for (ll a = b; a <= c; a++)
#define per(a, b, c) for (ll a = b; a >= c; a--)
#define pb push_back
#define mk make_pair
#define pii pair<int, int>
#define mem(a, b) memset(a, b, s... | #include <algorithm>
#include <bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
#define rep(a, b, c) for (ll a = b; a <= c; a++)
#define per(a, b, c) for (ll a = b; a >= c; a--)
#define pb push_back
#define mk make_pair
#define pii pair<int, int>
#define mem(a, b) memset(a, b, s... | replace | 16 | 17 | 16 | 17 | 0 | |
p02953 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
scanf("%d", &N);
vector<int> H(N, 0);
for (int i = 0; i < N; i++) {
scanf("%d", &H.at(i));
}
for (int i = N - 1; i >= 0; i--) {
if (H.at(i) < H.at(i - 1)) {
H.at(i - 1)--;
}
if (H.at(i) < H.at(i - 1)) {
printf(... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
scanf("%d", &N);
vector<int> H(N, 0);
for (int i = 0; i < N; i++) {
scanf("%d", &H.at(i));
}
for (int i = N - 1; i > 0; i--) {
if (H.at(i) < H.at(i - 1)) {
H.at(i - 1)--;
}
if (H.at(i) < H.at(i - 1)) {
printf("... | replace | 12 | 13 | 12 | 13 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): vector::_M_range_check: __n (which is 18446744073709551615) >= this->size() (which is 5)
|
p02953 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int n, h[10010];
int main() {
cin >> n >> h[0];
if (n == 1) {
cout << "Yes" << endl;
return 0;
}
h[0]--;
for (int i = 1; i < n; i++) {
cin >> h[i];
if (h[i] > h[i - 1])
h[i]--;
if (h[i] < h[i - 1]) {
cout << "No" << endl;
re... | #include <bits/stdc++.h>
using namespace std;
int n, h[100010];
int main() {
cin >> n >> h[0];
if (n == 1) {
cout << "Yes" << endl;
return 0;
}
h[0]--;
for (int i = 1; i < n; i++) {
cin >> h[i];
if (h[i] > h[i - 1])
h[i]--;
if (h[i] < h[i - 1]) {
cout << "No" << endl;
r... | replace | 3 | 4 | 3 | 4 | 0 | |
p02953 | Python | Runtime Error | n = int(input())
h = [int(x) for x in input().split()]
h.reverse()
flag = True
for i in range(1, n):
print(h, i)
if h[i - 1] >= h[i]:
continue
elif h[i] == h[i - 1] + 1:
h[i] -= 1
else:
flag = False
break
print("Yes") if flag else print("No")
| n = int(input())
h = [int(x) for x in input().split()]
h.reverse()
flag = True
for i in range(1, n):
if h[i - 1] >= h[i]:
continue
elif h[i] == h[i - 1] + 1:
h[i] -= 1
else:
flag = False
break
print("Yes") if flag else print("No")
| delete | 7 | 9 | 7 | 7 | 0 | |
p02953 | Python | Time Limit Exceeded | import sys
input = sys.stdin.readline
N = int(input())
H = [int(item) for item in input().split()]
cand = []
cand += [H[0], H[0] - 1]
for i in range(1, N):
new_cand = []
for c in cand:
if c <= H[i] - 1:
new_cand += [H[i], H[i] - 1]
elif c == H[i]:
new_cand += [H[i]]
... | import sys
input = sys.stdin.readline
N = int(input())
H = [int(item) for item in input().split()]
cand = []
cand += [H[0], H[0] - 1]
for i in range(1, N):
new_cand = []
for c in cand:
if c <= H[i] - 1:
new_cand += [H[i], H[i] - 1]
elif c == H[i]:
new_cand += [H[i]]
... | replace | 16 | 17 | 16 | 17 | TLE | |
p02953 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int64_t> H(n);
for (int i = 0; i < n; i++) {
cin >> H.at(i);
}
if (n == 1) {
cout << "Yes" << endl;
return 0;
}
for (int i = n; i > 0; i--) {
if (H.at(i - 1) + 1 == H.at(i)) {
H.at(i - 1)--;
} el... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int64_t> H(n);
for (int i = 0; i < n; i++) {
cin >> H.at(i);
}
if (n == 1) {
cout << "Yes" << endl;
return 0;
}
for (int i = n - 1; i > 0; i--) {
if (H.at(i - 1) - 1 == H.at(i)) {
H.at(i - 1)--;
... | replace | 13 | 15 | 13 | 15 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): vector::_M_range_check: __n (which is 5) >= this->size() (which is 5)
|
p02953 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
vector<int> a(109);
cin >> N;
string ans = "Yes";
for (int i = 0; i < N; i++)
cin >> a.at(i);
for (int i = 1; i < N; i++) {
if (a[i - 1] <= a[i] - 1)
a[i] -= 1;
if (a[i] < a[i - 1]) {
ans = "No";
break;
}
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
vector<int> a(100000);
cin >> N;
string ans = "Yes";
for (int i = 0; i < N; i++)
cin >> a.at(i);
for (int i = 1; i < N; i++) {
if (a[i - 1] <= a[i] - 1)
a[i] -= 1;
if (a[i] < a[i - 1]) {
ans = "No";
break;
}... | replace | 5 | 6 | 5 | 6 | 0 | |
p02953 | C++ | Time Limit Exceeded | #include "bits/stdc++.h"
using namespace std;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<VVI> VVVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
typedef long long LL;
typedef priority_queue<int> PQ_DESC;
typedef priority_queue<int, vector<int>, greater<int>> PQ_A... | #include "bits/stdc++.h"
using namespace std;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<VVI> VVVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
typedef long long LL;
typedef priority_queue<int> PQ_DESC;
typedef priority_queue<int, vector<int>, greater<int>> PQ_A... | replace | 119 | 121 | 119 | 121 | TLE | |
p02953 | C++ | Runtime Error | #include <iostream>
using namespace std;
int n;
int *x = new int[n];
void solve() {
bool f = true;
int diff;
if (n == 1) {
cout << "Yes" << endl;
} else {
for (int i = n - 1; 0 < i; i--) {
diff = x[i] - x[i - 1];
if (diff <= -2) {
f = false;
break;
} else if (diff =... | #include <iostream>
using namespace std;
int n;
int x[100000];
void solve() {
bool f = true;
int diff;
if (n == 1) {
cout << "Yes" << endl;
} else {
for (int i = n - 1; 0 < i; i--) {
diff = x[i] - x[i - 1];
if (diff <= -2) {
f = false;
break;
} else if (diff == -1) ... | replace | 5 | 6 | 5 | 6 | 0 | |
p02953 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
using namespace std;
int Hs[10005];
int main() {
int N, H;
cin >> N;
rep(i, N) { scanf("%d", &Hs[i]); }
for (int i = 1; i < N; i++) {
Hs[i] -= (Hs[i - 1] < Hs[i] ? 1 : 0);
if (Hs[i - 1] > Hs[i]) {
cout << "No" << endl;... | #include <bits/stdc++.h>
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
using namespace std;
int Hs[100005];
int main() {
int N, H;
cin >> N;
rep(i, N) { scanf("%d", &Hs[i]); }
for (int i = 1; i < N; i++) {
Hs[i] -= (Hs[i - 1] < Hs[i] ? 1 : 0);
if (Hs[i - 1] > Hs[i]) {
cout << "No" << endl... | replace | 4 | 5 | 4 | 5 | 0 | |
p02953 | C++ | Runtime Error | #include <bits/stdc++.h>
#define N 1005
#define int long long
using namespace std;
int n, m, a[N], cnt[N], tot;
char c[N];
bool b[N];
signed main() {
scanf("%lld", &n);
for (int i = 1; i <= n; i++)
scanf("%lld", &a[i]);
bool bo = 1;
for (int i = 1; i <= n; i++) {
if (i == 1 && a[i])
a[i]--;
el... | #include <bits/stdc++.h>
#define N 100005
#define int long long
using namespace std;
int n, m, a[N], cnt[N], tot;
char c[N];
bool b[N];
signed main() {
scanf("%lld", &n);
for (int i = 1; i <= n; i++)
scanf("%lld", &a[i]);
bool bo = 1;
for (int i = 1; i <= n; i++) {
if (i == 1 && a[i])
a[i]--;
... | replace | 1 | 2 | 1 | 2 | 0 | |
p02953 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int n, a[100001], f = 0;
void work(int num, int step) {
if (step == n + 1) {
f = 1;
return;
}
if (a[step] >= num)
work(a[step], step + 1);
if (a[step] + 1 >= num)
work(a[step] + 1, step + 1);
}
int main() {
cin >> n;
for (int i = 1; i <= n; i+... | #include <bits/stdc++.h>
using namespace std;
int n, a[100001], f = 0;
void work(int num, int step) {
if (step == n + 1) {
f = 1;
return;
}
if (a[step] >= num)
work(a[step], step + 1);
else if (a[step] + 1 >= num)
work(a[step] + 1, step + 1);
}
int main() {
cin >> n;
for (int i = 1; i <= ... | replace | 12 | 13 | 12 | 13 | TLE | |
p02953 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
int main() {
int n, h[200001], x = 1;
cin >> n;
rep(i, n) cin >> h[i];
rep(i, n - 1) if (h[i] > h[i + 1] + 1) x = 0;
vector<int> H;
H.push_back(h[0]);
rep(i, n - 1) if (h[i] != h[i + 1]) H.pus... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
int main() {
int n, h[200001], x = 1;
cin >> n;
rep(i, n) cin >> h[i];
rep(i, n - 1) if (h[i] > h[i + 1] + 1) x = 0;
vector<int> H;
H.push_back(h[0]);
rep(i, n - 1) if (h[i] != h[i + 1]) H.pus... | replace | 12 | 14 | 12 | 14 | 0 | |
p02953 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> data(n);
for (int i = 0; i < n; i++) {
cin >> data.at(i);
}
bool ret = false;
int max = 0;
for (int i = 0; i < n; i++) {
if (max - 1 > data.at(i + 1)) {
ret = true;
}
if (max < data.at(i)) {... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> data(n);
for (int i = 0; i < n; i++) {
cin >> data.at(i);
}
bool ret = false;
int max = 0;
for (int i = 0; i < n; i++) {
if (max - 1 > data.at(i)) {
ret = true;
}
if (max < data.at(i)) {
... | replace | 15 | 16 | 15 | 16 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): vector::_M_range_check: __n (which is 5) >= this->size() (which is 5)
|
p02953 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int N;
cin >> N;
long H[10009];
int s = 0;
cin >> H[0];
for (int i = 1; i < N; i++) {
cin >> H[i];
if (H[i - 1] < H[i]) {
H[i]--;
continue;
}
if (H[i - 1] > H[i]) {
s =... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int N;
cin >> N;
long H[110000];
int s = 0;
cin >> H[0];
for (int i = 1; i < N; i++) {
cin >> H[i];
if (H[i - 1] < H[i]) {
H[i]--;
continue;
}
if (H[i - 1] > H[i]) {
s ... | replace | 9 | 10 | 9 | 10 | 0 | |
p02953 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <string>
using namespace std;
int main() {
int n, h[100000], m = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> h[i];
for (int j = 0; j < i; j++) {
if (h[j] - h[i] > 1)
m++;
}
}
... | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <string>
using namespace std;
int main() {
int n, h[100000], m = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> h[i];
}
for (int i = 0; i < n - 1; i++) {
if (h[n - 2 - i] - h[n - 1 - i] > 1) {
... | replace | 13 | 17 | 13 | 20 | TLE | |
p02953 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int a, s, v = 1;
cin >> a;
vector<int> z(a);
for (s = 0; s < a; s++) {
cin >> z.at(s);
}
reverse(z.begin(), z.end());
for (s = 0; s < a; s++) {
if (z.at(s) + 1 == z.at(s + 1)) {
z.at(s + 1) -= 1... | #include <bits/stdc++.h>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int a, s, v = 1;
cin >> a;
vector<int> z(a);
for (s = 0; s < a; s++) {
cin >> z.at(s);
}
reverse(z.begin(), z.end());
for (s = 0; s < a - 1; s++) {
if (z.at(s) + 1 == z.at(s + 1)) {
z.at(s + 1) ... | replace | 13 | 14 | 13 | 14 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): vector::_M_range_check: __n (which is 5) >= this->size() (which is 5)
|
p02953 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;
typedef pair<long long, long long> P;
int main() {
int n, a[10009];
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
bool ans = true;
a[0]--;
for (int i = 1; i <... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;
typedef pair<long long, long long> P;
int main() {
long long n, a[100009];
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
bool ans = true;
a[0]--;
for (int i =... | replace | 12 | 13 | 12 | 13 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.