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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02832 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
const int mod = 1000000007;
const int MOD = 998244353;
const ll INF = 10000000000... | #include <algorithm>
#include <cmath>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
const int mod = 1000000007;
const int MOD = 998244353;
const ll INF = 10000000000... | replace | 17 | 18 | 17 | 18 | 0 | |
p02832 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
long N, a[20000];
long i, k = 1;
long count = 1;
cin >> N;
for (i = 1; i <= N; i++) {
cin >> a[i];
}
for (i = 1; i <= N; i++)
if (a[i] == count)
count++;
if (count == 1) {
cout << "-1" << endl;
return 0;
}
cout << N -... | #include <iostream>
using namespace std;
int main() {
long N, a[200000];
long i, k = 1;
long count = 1;
cin >> N;
for (i = 1; i <= N; i++) {
cin >> a[i];
}
for (i = 1; i <= N; i++)
if (a[i] == count)
count++;
if (count == 1) {
cout << "-1" << endl;
return 0;
}
cout << N ... | replace | 5 | 6 | 5 | 6 | 0 | |
p02832 | C++ | Runtime Error | // in the name of god
// if you read this code please search about imam hussain
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define endl "\n"
#define X first
#define Y second
#define pii pair<int, int>
#define migmig ... | // in the name of god
// if you read this code please search about imam hussain
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define endl "\n"
#define X first
#define Y second
#define pii pair<int, int>
#define migmig ... | replace | 21 | 22 | 21 | 22 | 0 | |
p02832 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
int gcd(int x, int y) {
int t = 0;
t = (x + y) / 2;
if (x && y != t) {
if (x > y)
return gcd(x = x - x / y * y, y);
else if (x < y)
return gcd(x, y = y - y / x * x);
} e... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
int gcd(int x, int y) {
int t = 0;
t = (x + y) / 2;
if (x && y != t) {
if (x > y)
return gcd(x = x - x / y * y, y);
else if (x < y)
return gcd(x, y = y - y / x * x);
} e... | replace | 22 | 23 | 22 | 23 | -11 | |
p02832 | C++ | Runtime Error | #include <algorithm>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <utility>
#include <vector>
using namespace std;
using pi... | #include <algorithm>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <utility>
#include <vector>
using namespace std;
using pi... | replace | 99 | 100 | 99 | 100 | 0 | |
p02832 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#if MYDEBUG
#include "lib/cp_debug.hpp"
#else
#define DBG(...) ;
#endif
#if __cplusplus <= 201402L
template <typename T> T gcd(T a, T b) {
return ((a % b == 0) ? b : gcd(b, a % b));
}
template <typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
#endif
using LL = long long;
constexpr L... | #include <bits/stdc++.h>
#if MYDEBUG
#include "lib/cp_debug.hpp"
#else
#define DBG(...) ;
#endif
#if __cplusplus <= 201402L
template <typename T> T gcd(T a, T b) {
return ((a % b == 0) ? b : gcd(b, a % b));
}
template <typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
#endif
using LL = long long;
constexpr L... | replace | 25 | 26 | 25 | 26 | TLE | |
p02832 | C++ | Time Limit Exceeded | #include <iostream>
#include <vector>
int main() {
int n;
std::cin >> n;
std::vector<int> a(n);
for (int i = 0; i < n; i++) {
std::cin >> a.at(i);
}
int ans = 0;
int tmp = 1;
int size = a.size();
for (int i = 0; i < a.size(); i++) {
if (a.at(i) != tmp) {
a.erase(a.begin() + i);
... | #include <iostream>
#include <vector>
int main() {
int n;
std::cin >> n;
std::vector<int> a(n);
for (int i = 0; i < n; i++) {
std::cin >> a.at(i);
}
int ans = 0;
int tmp = 1;
int size = a.size();
for (int i = 0; i < a.size(); i++) {
if (a.at(i) != tmp) {
ans++;
} else {
tmp+... | delete | 17 | 19 | 17 | 17 | TLE | |
p02832 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int N = 1e5 + 10;
int a[N];
int main() {
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int n;
cin >> n;
int cnt = 1, ans = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
if (a[i] == cnt)
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int N = 5e5 + 10;
int a[N];
int main() {
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int n;
cin >> n;
int cnt = 1, ans = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
if (a[i] == cnt)
... | replace | 5 | 6 | 5 | 6 | 0 | |
p02832 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int n, f = 1, sum, a[1001];
int main() {
cin >> n;
for (int i = 1; i <= n; i++)
cin >> a[i];
for (int i = 1; i <= n; i++)
if (a[i] == f)
f++;
else
sum++;
if (f == 1)
cout << -1;
else
cout << sum;
} | #include <bits/stdc++.h>
using namespace std;
int n, f = 1, sum, a[200001];
int main() {
cin >> n;
for (int i = 1; i <= n; i++)
cin >> a[i];
for (int i = 1; i <= n; i++)
if (a[i] == f)
f++;
else
sum++;
if (f == 1)
cout << -1;
else
cout << sum;
} | replace | 2 | 3 | 2 | 3 | 0 | |
p02832 | C++ | Runtime Error | #define DBG 0 // submit 0
#define ll long long
#if DBG
#include <algorithm>
#include <array>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <numeric>
#include <queue>
#include <string>
#include <unordered_map>
#include <vector>
#else
#include <bits/stdc++.h>
#endif
using namespace st... | #define DBG 0 // submit 0
#define ll long long
#if DBG
#include <algorithm>
#include <array>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <numeric>
#include <queue>
#include <string>
#include <unordered_map>
#include <vector>
#else
#include <bits/stdc++.h>
#endif
using namespace st... | replace | 21 | 22 | 21 | 22 | 0 | |
p02832 | C++ | Runtime Error | /*
Author: Nguyen Tan Bao
Status:
Idea:
*/
#include "bits/stdc++.h"
#define FI first
#define SE second
#define EPS 1e-9
#define ALL(a) a.begin(), a.end()
#define SZ(a) int((a).size())
#define MS(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORE(i, a, b) for (i... | /*
Author: Nguyen Tan Bao
Status:
Idea:
*/
#include "bits/stdc++.h"
#define FI first
#define SE second
#define EPS 1e-9
#define ALL(a) a.begin(), a.end()
#define SZ(a) int((a).size())
#define MS(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORE(i, a, b) for (i... | replace | 30 | 31 | 30 | 31 | 0 | |
p02832 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int cnt = 0;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a.at(i);
}
int i = 0;
while (i < n && a.at(i) != 0) {
if (a.at(i) == i + 1) {
i++;
continue;
}
if (a.at(i) != i + 1) {
a.era... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int cnt = 0;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a.at(i);
}
int ans = 1;
for (int i = 0; i < n; i++) {
if (a.at(i) == ans) {
ans++;
} else {
cnt++;
}
}
if (cnt == n) {
cout... | replace | 11 | 21 | 11 | 16 | TLE | |
p02832 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> A(N);
for (int i = 0; i < N; i++) {
cin >> A.at(i);
}
int C = 0;
int Size = N;
int Num = 1;
while (C < Size) {
if (Num == A.at(C)) {
Num++;
C++;
} else {
A.erase(A.begin() + C);
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> A(N);
for (int i = 0; i < N; i++) {
cin >> A.at(i);
}
int C = 0;
int Size = N;
int Num = 1;
while (C < Size) {
if (Num == A.at(C)) {
Num++;
C++;
} else {
C++;
}
}
if (Num > 1)... | replace | 18 | 20 | 18 | 19 | TLE | |
p02832 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
int n, a[20010] = {}, serch = 1, ans = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int i = 0; i < n; i++) {
if (a[i] == serch) {
serch++;
} else {
ans++;
}
}
if (se... | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
int n, a[200100] = {}, serch = 1, ans = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int i = 0; i < n; i++) {
if (a[i] == serch) {
serch++;
} else {
ans++;
}
}
if (s... | replace | 6 | 7 | 6 | 7 | 0 | |
p02832 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> a(N);
for (int i = 1; i <= N; i++) {
cin >> a[i];
}
if (N == 1) {
if (a[1] == 1) {
cout << 0 << endl;
} else {
cout << -1 << endl;
}
return 0;
}
int num = 1, ans = 0;
for (int i ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int a[N];
for (int i = 1; i <= N; i++) {
cin >> a[i];
}
if (N == 1) {
if (a[1] == 1) {
cout << 0 << endl;
} else {
cout << -1 << endl;
}
return 0;
}
int num = 1, ans = 0;
for (int i = 1; i <... | replace | 7 | 8 | 7 | 8 | 0 | |
p02832 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long int
mt19937 rng(std::chrono::duration_cast<std::chrono::nanoseconds>(
chrono::high_resolution_clock::now().time_since_epoch())
.count());
#define mp make_pair
#define pb push_back
#define F first
#define S second
const i... | #include <bits/stdc++.h>
using namespace std;
#define int long long int
mt19937 rng(std::chrono::duration_cast<std::chrono::nanoseconds>(
chrono::high_resolution_clock::now().time_since_epoch())
.count());
#define mp make_pair
#define pb push_back
#define F first
#define S second
const i... | delete | 27 | 32 | 27 | 27 | -11 | |
p02832 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using P = pair<int, int>;
using ll = long long;
int main() {
int n;
cin >> n;
vector<int> a;
rep(i, n) cin >> a[i];
int nxt = 1, ans = 0;
rep(i, n) {
if (a[i] == nxt) {
nxt++;
} else
ans++;
}... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using P = pair<int, int>;
using ll = long long;
int main() {
int n;
cin >> n;
vector<int> a(n);
rep(i, n) cin >> a[i];
int nxt = 1, ans = 0;
rep(i, n) {
if (a[i] == nxt) {
nxt++;
} else
ans++;
... | replace | 9 | 10 | 9 | 10 | -11 | |
p02832 | C++ | Runtime Error |
#include <bits/stdc++.h>
#define ln '\n'
#define all(dat) dat.begin(), dat.end()
#define loop(i, to) for (int i = 0; i < to; ++i)
#define cont(i, to) for (int i = 1; i <= to; ++i)
#define circ(i, fm, to) for (int i = fm; i <= to; ++i)
#define foreach(i, dat) \
... |
#include <bits/stdc++.h>
#define ln '\n'
#define all(dat) dat.begin(), dat.end()
#define loop(i, to) for (int i = 0; i < to; ++i)
#define cont(i, to) for (int i = 1; i <= to; ++i)
#define circ(i, fm, to) for (int i = fm; i <= to; ++i)
#define foreach(i, dat) \
... | replace | 15 | 16 | 15 | 16 | 0 | |
p02832 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int x = 1, res, m, n, a[100000], i, b[1000] = {0}, cnt = 0;
cin >> n;
for (i = 1; i <= n; i++) {
cin >> a[i];
if (a[i] == x) {
cnt++;
x++;
}
// b[a[i]]++;
}
if (cnt != 0)
cout << n - cnt << endl;
else
co... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int x = 1, res, m, n, a[200008], i, b[1000] = {0}, cnt = 0;
cin >> n;
for (i = 1; i <= n; i++) {
cin >> a[i];
if (a[i] == x) {
cnt++;
x++;
}
// b[a[i]]++;
}
if (cnt != 0)
cout << n - cnt << endl;
else
co... | replace | 3 | 4 | 3 | 4 | 0 | |
p02832 | C++ | Runtime Error | #include <cstdio>
int main(int argc, const char *argv[]) {
int n;
scanf("%d", &n);
int a[20000];
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
int ans = 0, cur = 1;
for (int i = 0; i < n; i++) {
if (a[i] != cur) {
ans++;
} else {
cur++;
}
}
printf("%d\n", ans == n... | #include <cstdio>
int main(int argc, const char *argv[]) {
int n;
scanf("%d", &n);
int a[300000];
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
int ans = 0, cur = 1;
for (int i = 0; i < n; i++) {
if (a[i] != cur) {
ans++;
} else {
cur++;
}
}
printf("%d\n", ans == ... | replace | 6 | 7 | 6 | 7 | 0 | |
p02832 | C++ | Time Limit Exceeded |
/*
𝓐𝓾𝓽𝓱𝓸𝓻:-
𝓢𝓪𝓾𝓻𝓪𝓫𝓱𝓼𝓱𝓪𝓭𝓸𝔀
------------------------------------------------------------------------------------------------------------------
██╗░░██╗░█████╗░██████╗░██████╗░ ░██╗░░░░░░░██╗░█████╗░██████╗░██╗░░██╗ ██████╗░███████╗░█████╗░████████╗░██████╗
██║░░██║██╔══██╗██╔══██╗██╔══██╗ ░██║░░██... |
/*
𝓐𝓾𝓽𝓱𝓸𝓻:-
𝓢𝓪𝓾𝓻𝓪𝓫𝓱𝓼𝓱𝓪𝓭𝓸𝔀
------------------------------------------------------------------------------------------------------------------
██╗░░██╗░█████╗░██████╗░██████╗░ ░██╗░░░░░░░██╗░█████╗░██████╗░██╗░░██╗ ██████╗░███████╗░█████╗░████████╗░██████╗
██║░░██║██╔══██╗██╔══██╗██╔══██╗ ░██║░░██... | replace | 98 | 102 | 98 | 99 | TLE | |
p02832 | C++ | Runtime Error | // daddy's back in town, back to rolling the damn hash yoooo babeeeeees//
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define dbg(x) cout << #x << '=' << x << '\n';
#define ll long long
#define x first
#define y second
#define pi pair<int, int>
#define vi vector<int>
#define L nod << 1
#define R ... | // daddy's back in town, back to rolling the damn hash yoooo babeeeeees//
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define dbg(x) cout << #x << '=' << x << '\n';
#define ll long long
#define x first
#define y second
#define pi pair<int, int>
#define vi vector<int>
#define L nod << 1
#define R ... | replace | 14 | 15 | 14 | 15 | 0 | |
p02832 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define PB push_back
#define PII pair<int, int>
#define MP make_pair
#define all(x) x.begin(), x.end()
#define REP(x, y, z) for (int x = y; x <= z; x++)
#define REPP(x, y, z) for (int x = y; x >= z; x--)
#define F first
#define S second
#define MSET(x,... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define PB push_back
#define PII pair<int, int>
#define MP make_pair
#define all(x) x.begin(), x.end()
#define REP(x, y, z) for (int x = y; x <= z; x++)
#define REPP(x, y, z) for (int x = y; x >= z; x--)
#define F first
#define S second
#define MSET(x,... | replace | 14 | 15 | 14 | 15 | 0 | |
p02832 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
typedef long long ll;
ll num[20005];
int main() {
int n;
scanf("%d", &n);
ll ans = 0;
ll cnt = 1;
for (int i = 0; i < n; i++) {
scanf("%lld", &num[i]);
if (num[i] == cnt) {
cnt++;
} else {
ans++;
}
}
... | #include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
typedef long long ll;
ll num[200005];
int main() {
int n;
scanf("%d", &n);
ll ans = 0;
ll cnt = 1;
for (int i = 0; i < n; i++) {
scanf("%lld", &num[i]);
if (num[i] == cnt) {
cnt++;
} else {
ans++;
}
}
... | replace | 5 | 6 | 5 | 6 | 0 | |
p02832 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
using namespace std;
long long n;
long long a[200010];
int now, ans, tmp1, tmp2;
vector<int> vans;
int saiki(int k) {
now = 1;
ans = k;
// i... | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
using namespace std;
long long n;
long long a[200010];
int now, ans, tmp1, tmp2;
vector<int> vans;
int saiki(int k) {
now = 1;
ans = k;
// i... | replace | 19 | 20 | 19 | 20 | TLE | |
p02832 | Python | Time Limit Exceeded | N = int(input())
a = list(map(int, input().split()))
K = 0
ans = 0
for i in range(N):
k = a.pop(0)
if k == K + 1:
K = k
else:
ans += 1
if K == 0:
ans = -1
print(ans)
| N = int(input())
a = list(map(int, input().split()))
K = 0
ans = 0
for i in range(N):
k = a[i]
if k == K + 1:
K = k
else:
ans += 1
if K == 0:
ans = -1
print(ans)
| replace | 6 | 7 | 6 | 7 | TLE | |
p02832 | Python | Time Limit Exceeded | def t(a):
b = 0
n = 0
while n < len(a):
if a[n] == n + 1:
n += 1
else:
a.pop(n)
b += 1
return b if len(a) != 0 else -1
if __name__ == "__main__":
n = input()
a = list(map(int, input().split()))
print(t(a))
| def t(a):
b = [False] * len(a)
c = 1
for i, j in enumerate(a):
if j == c:
b[i] = True
c += 1
return b.count(False) if any(b) else -1
if __name__ == "__main__":
n = input()
a = list(map(int, input().split()))
print(t(a))
| replace | 1 | 10 | 1 | 9 | TLE | |
p02832 | Python | Time Limit Exceeded | N = int(input())
a = list(map(int, input().split()))
nm = 1
ans = 0
while a:
x = a.pop(0)
if x == nm:
nm += 1
else:
ans += 1
if ans == N:
print(-1)
else:
print(ans)
| N = int(input())
a = list(map(int, input().split()))
nm = 1
ans = 0
for i in range(N):
x = a[i]
if x == nm:
nm += 1
else:
ans += 1
if ans == N:
print(-1)
else:
print(ans)
| replace | 4 | 6 | 4 | 6 | TLE | |
p02832 | Python | Time Limit Exceeded | N = int(input())
a = list(map(int, input().split()))
left_max_num = 0
for i in range(1, N + 1):
if i in a:
left_max_num = i
a = a[a.index(i) + 1 :]
else:
break
if left_max_num != 0:
print(N - left_max_num)
else:
print(-1)
| N = int(input())
a = list(map(int, input().split()))
num = 0
for item in a:
if item == (num + 1):
num += 1
if num != 0:
print(N - num)
else:
print(-1)
| replace | 2 | 11 | 2 | 10 | TLE | |
p02832 | Python | Time Limit Exceeded | N = int(input())
a = list(map(int, input().split()))
ans = 0
i = 1
j = 0
while j < N:
if i not in a[j:]:
ans += N - j
break
nj = a[j:].index(i)
ans += nj - j
i += 1
j = nj + 1
if i == 1:
print(-1)
else:
print(ans)
| N = int(input())
a = list(map(int, input().split()))
ans = 0
x = 1
for i in a:
if i == x:
x += 1
else:
ans += 1
if x == 1:
print(-1)
else:
print(ans)
| replace | 3 | 14 | 3 | 10 | TLE | |
p02832 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
using ll = long long;
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define all_map(itr, mp) for (auto itr = mp.... | #include <algorithm>
#include <cmath>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
using ll = long long;
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define all_map(itr, mp) for (auto itr = mp.... | replace | 23 | 36 | 23 | 30 | 0 | |
p02832 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define sint(a) scanf("%d", &a)
#define sint2(a, b) scanf("%d %d", &a, &b)
#define sll(a) scanf("%lld", &a)
#define sll2(a, b) scanf("%lld %lld", &a, &b)
const int maxn = 1e5 + 5;
int a[maxn], b[maxn];
int main() {
int n;
cin >> n;
for (int i ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define sint(a) scanf("%d", &a)
#define sint2(a, b) scanf("%d %d", &a, &b)
#define sll(a) scanf("%lld", &a)
#define sll2(a, b) scanf("%lld %lld", &a, &b)
const int maxn = 1e6 + 5;
int a[maxn], b[maxn];
int main() {
int n;
cin >> n;
for (int i ... | replace | 9 | 10 | 9 | 10 | 0 | |
p02832 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MOD 1000000007
template <typename T1, typename T2> inline void chmin(T1 &a, T2 b) {
if (a > b)
a = b;
}
template <typename T1, typename T2> inline void chmax(T1 &a, T2 b) {
if (a < b)
a = b;
}
ll helper(int cur, int tgt, int n, ve... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MOD 1000000007
template <typename T1, typename T2> inline void chmin(T1 &a, T2 b) {
if (a > b)
a = b;
}
template <typename T1, typename T2> inline void chmax(T1 &a, T2 b) {
if (a < b)
a = b;
}
ll helper(int cur, int tgt, int n, ve... | replace | 15 | 16 | 15 | 18 | 0 | |
p02832 | C++ | Runtime Error | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
#define REP(i, n) for (int i = 0; i < (n); i++)
using ll = long long;
using ii = pair<ll, ll>;
ll a, b, c, i, j, l, m, n, ans, tmp, hoge, fuga, piyo;
unsigned long long k;
ll A[100000];
int main() {
cin >> n;
REP(i, ... | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
#define REP(i, n) for (int i = 0; i < (n); i++)
using ll = long long;
using ii = pair<ll, ll>;
ll a, b, c, i, j, l, m, n, ans, tmp, hoge, fuga, piyo;
unsigned long long k;
ll A[200000];
int main() {
cin >> n;
REP(i, ... | replace | 11 | 12 | 11 | 12 | 0 | |
p02832 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int f[1001];
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> f[i];
}
int ans = 0, sum = 1;
for (int i = 1; i <= n; i++) {
if (f[i] == sum) {
sum++;
ans++;
}
}
if (sum == 1) {
cout << -1;
} else
cout << n ... | #include <bits/stdc++.h>
using namespace std;
int f[1000001];
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> f[i];
}
int ans = 0, sum = 1;
for (int i = 1; i <= n; i++) {
if (f[i] == sum) {
sum++;
ans++;
}
}
if (sum == 1) {
cout << -1;
} else
cout <<... | replace | 2 | 3 | 2 | 3 | 0 | |
p02833 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <tuple>
#include <vector>
#define PI 3.14159265359
#define INF 1e9
#define LINF 1e18
#define IMOD 1000000007
#define irep(i, n) for (int i = 0; ... | #include <algorithm>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <tuple>
#include <vector>
#define PI 3.14159265359
#define INF 1e9
#define LINF 1e18
#define IMOD 1000000007
#define irep(i, n) for (int i = 0; ... | replace | 40 | 41 | 40 | 41 | TLE | |
p02833 | C++ | Time Limit Exceeded | #include <algorithm>
#include <array>
#include <cassert>
#include <deque>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define ll long long int
#define rep(i, n) for (ll i = 0; i < n;... | #include <algorithm>
#include <array>
#include <cassert>
#include <deque>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define ll long long int
#define rep(i, n) for (ll i = 0; i < n;... | replace | 50 | 51 | 50 | 51 | TLE | |
p02833 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <utility>
#include <vector>
using namespace ... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <utility>
#include <vector>
using namespace ... | insert | 56 | 56 | 56 | 60 | TLE | |
p02833 | C++ | Runtime Error | #include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = (0); i < (n); ++i)
#define rng(x) (x).begin(), (x).end()
#define rrng(x) (x).rbegin(), (x).rend()
#define show(x) cout << #x << " = " << (x) << endl;
#define show2(x, y) ... | #include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = (0); i < (n); ++i)
#define rng(x) (x).begin(), (x).end()
#define rrng(x) (x).rbegin(), (x).rend()
#define show(x) cout << #x << " = " << (x) << endl;
#define show2(x, y) ... | replace | 55 | 56 | 55 | 56 | 0 | |
p02833 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
int main() {
ll N;
cin >> N;
if (N % 2 == 1) {
puts(0);
return 0;
} else {
ll x = 5;
ll ans = 0;
while (N >= x) {
ans += N / x / 2;
x *= 5;
}
cout << ans <... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
int main() {
ll N;
cin >> N;
if (N % 2 == 1) {
cout << 0 << endl;
return 0;
} else {
ll x = 5;
ll ans = 0;
while (N >= x) {
ans += N / x / 2;
x *= 5;
}
cou... | replace | 9 | 10 | 9 | 10 | 0 | |
p02833 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
long long int solve(long long int n) {
long long int ans = 0;
if (n % 2 != 0) {
return 0;
}
for (int i = 10; i <= n; i *= 5) {
ans += n / i;
}
return ans;
}
int main() {
long long int n, ans;
cin >> n;
ans = solve(n);
cout << ans << endl;
retur... | #include <iostream>
using namespace std;
long long int solve(long long int n) {
long long int ans = 0;
if (n % 2 != 0) {
return 0;
}
for (long long int i = 10; i <= n; i *= 5) {
ans += n / i;
}
return ans;
}
int main() {
long long int n, ans;
cin >> n;
ans = solve(n);
cout << ans << end... | replace | 10 | 11 | 10 | 11 | TLE | |
p02833 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
long long n, i, nr, x, aux;
int main() {
cin >> n;
if (n % (long long)2 == 1) {
cout << 0;
return 1;
}
x = 2;
while (x * 5 <= n) {
x = x * 5;
nr = nr + n / x;
}
cout << nr;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
long long n, i, nr, x, aux;
int main() {
cin >> n;
if (n % 2 == 0)
for (i = 5; i <= n; i = i * 5)
nr = nr + n / (i * 2);
cout << nr;
return 0;
}
| replace | 5 | 14 | 5 | 8 | 0 | |
p02833 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef string str;
#define f(i, begin, end) \
for (auto i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); \
i += 1 - 2 * ((begin) > (end)))
#defi... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef string str;
#define f(i, begin, end) \
for (auto i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); \
i += 1 - 2 * ((begin) > (end)))
#defi... | delete | 18 | 22 | 18 | 18 | 0 | |
p02833 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define repr(i, n) for (int i = (n)-1; 0 <= i; --i)
#define each(e, v) for (auto &&e : (v))
#define all(v) begin(v), end(v)
#define dump(x) cerr << #x << ": " << (x) << endl
using namespace std;
using vint = vec... | #include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define repr(i, n) for (int i = (n)-1; 0 <= i; --i)
#define each(e, v) for (auto &&e : (v))
#define all(v) begin(v), end(v)
#define dump(x) cerr << #x << ": " << (x) << endl
using namespace std;
using vint = vec... | insert | 23 | 23 | 23 | 25 | TLE | |
p02833 | C++ | Runtime Error | //
// Created by Mahmoud Rashad on 11/27/19.
//
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> ii;
long long count_P_in_nfact(long long n, long long p) {
long long res = 0;
while (n) {
n /= p;
res += n;
}
return res;
}
long long count_5_in_nfact(long long n, long long p) {
lo... | //
// Created by Mahmoud Rashad on 11/27/19.
//
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> ii;
long long count_P_in_nfact(long long n, long long p) {
long long res = 0;
while (n) {
n /= p;
res += n;
}
return res;
}
long long count_5_in_nfact(long long n, long long p) {
lo... | replace | 29 | 30 | 29 | 30 | 0 | |
p02833 | C++ | Time Limit Exceeded | #include <iostream>
#include <vector>
using namespace std;
long cntfive(long n) {
long ans = 0;
while (n % 5 == 0) {
ans++;
n /= 5;
}
return ans;
}
int main(void) {
long n;
cin >> n;
long ans = 0;
if (n % 2 == 0) {
for (long i = n; i >= 10; i -= 2) {
ans += cntfive(i);
}
}
cout... | #include <iostream>
#include <vector>
using namespace std;
long cntfive(long n) {
long ans = 0;
while (n % 5 == 0) {
ans++;
n /= 5;
}
return ans;
}
int main(void) {
long n;
cin >> n;
long ans = 0;
if (n % 2 == 0) {
for (long i = 10; i <= n; i *= 5) {
ans += n / i;
}
}
cout << a... | replace | 16 | 18 | 16 | 18 | TLE | |
p02833 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
long long ans = 0;
int main() {
long long n;
cin >> n;
if (n % 2 != 0)
cout << "0";
else {
for (int i = 10; i <= n; i *= 5) {
ans += (n / i);
}
cout << ans;
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
long long ans = 0;
int main() {
long long n;
cin >> n;
if (n % 2 != 0)
cout << "0";
else {
for (long long i = 10; i <= n; i *= 5) {
ans += (n / i);
}
cout << ans;
}
return 0;
} | replace | 9 | 10 | 9 | 10 | TLE | |
p02833 | Python | Runtime Error | import math
def main():
N = int(input())
if N % 2 == 0:
B = N // 2
n = math.floor(math.log(B) / math.log(5))
ans = 0
for i in range(1, n + 1):
ans += B // (5**i)
else:
ans = 0
print(int(ans))
main()
| import math
def main():
N = int(input())
if N == 0 or N == 1:
ans = 0
elif N % 2 == 0:
B = N // 2
n = math.floor(math.log(B) / math.log(5))
ans = 0
for i in range(1, n + 1):
ans += B // (5**i)
else:
ans = 0
print(int(ans))
main()
| replace | 6 | 7 | 6 | 10 | 0 | |
p02833 | Python | Runtime Error | import math
N = int(input())
ans = 0
if N % 2 != 0:
pass
else:
max_pow_five = int(math.log(N, 5))
for i in range(1, max_pow_five + 1):
ans += N // ((5**i) * 2)
print(ans)
| import math
N = int(input())
ans = 0
if N % 2 != 0 or N == 0:
pass
else:
max_pow_five = int(math.log(N, 5))
for i in range(1, max_pow_five + 1):
ans += N // ((5**i) * 2)
print(ans)
| replace | 6 | 7 | 6 | 7 | 0 | |
p02833 | Python | Runtime Error | import math
def run(N):
ans = 0
if N % 2 == 0:
for i in range(int(math.log(N, 5))):
ans += N // (10 * (5**i))
return ans
def main():
N = int(input())
print(run(N))
if __name__ == "__main__":
main()
| import math
def run(N):
if N == 0:
return 0
ans = 0
if N % 2 == 0:
for i in range(int(math.log(N, 5))):
ans += N // (10 * (5**i))
return ans
def main():
N = int(input())
print(run(N))
if __name__ == "__main__":
main()
| insert | 4 | 4 | 4 | 6 | 0 | |
p02833 | Python | Runtime Error | N = int(input())
if N % 2 == 1:
print(0)
else:
ans = 0
for i in range(1, 30):
ans += (N // 2) // (5**i)
print(ans)
| N = int(input())
if N % 2 == 1:
print(0)
else:
ans = 0
for i in range(1, 30):
ans += (N // 2) // (5**i)
print(ans)
| replace | 7 | 9 | 7 | 8 | 0 | |
p02833 | Python | Runtime Error | import math
N = int(input())
if N % 2 == 1:
print(0)
else:
div10 = N // 10
sum_val = div10
count_5 = math.floor(math.log(div10, 5))
for i in range(count_5):
sum_val += div10 // pow(5, i + 1)
print(sum_val)
| import math
N = int(input())
if N % 2 == 1:
print(0)
else:
div10 = N // 10
sum_val = div10
if sum_val > 0:
count_5 = math.floor(math.log(div10, 5))
for i in range(count_5):
sum_val += div10 // pow(5, i + 1)
print(sum_val)
| replace | 8 | 11 | 8 | 12 | 0 | |
p02833 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a;
cin >> a;
if (a % 2 != 0) {
cout << 0 << endl;
} else {
long long c = 0;
long long d = 5;
long long j = a;
while (j / d > 0) {
if (j % (d * 2) == 0) {
c += j / (d * 2);
d *= 5;
j = a;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a;
cin >> a;
if (a % 2 != 0) {
cout << 0 << endl;
} else {
long long c = 0;
long long d = 5;
while (a / d > 0) {
c += a / (d * 2);
d *= 5;
}
cout << min(a / 2, c) << endl;
}
} | replace | 11 | 20 | 11 | 14 | TLE | |
p02833 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
// ifstream cin("lineup.in");
// ofstream cout("lineup.out");
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#define IOS ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
int main() {
IOS;
long long n;
cin >> n;
if (n % 2) {
cout << 0 << ... | #include <bits/stdc++.h>
using namespace std;
// ifstream cin("lineup.in");
// ofstream cout("lineup.out");
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#define IOS ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
int main() {
IOS;
long long n;
cin >> n;
if (n % 2) {
cout << 0 << ... | replace | 15 | 16 | 15 | 16 | TLE | |
p02833 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using Vec = vector<int>;
ll five_count(ll n) {
ll c = 0;
ll f = 5;
for (; f <= n; f *= 5) {
if (!(n % f))
c++;
else
break;
}
return (c);
}
int main(void) {
ll n;
cin >> n;
if (n % 2) {
... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using Vec = vector<int>;
ll five_count(ll n) {
ll c = 0;
ll f = 5;
for (; f <= n; f *= 5) {
if (!(n % f))
c++;
else
break;
}
return (c);
}
int main(void) {
ll n;
cin >> n;
if (n % 2) {
... | replace | 27 | 29 | 27 | 35 | TLE | |
p02833 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
ll f_2(ll n) {
if (n == 1)
return 0;
return f_2(n / 2) + n / 2;
}
ll f_5(ll n) {
if (n <= 1)
return 0;
return f_5(n / 5) + n / 5;
}
signed main(void) {
ll n, ans;
cin >> n;
ans = ... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
ll f_2(ll n) {
if (n == 1)
return 0;
return f_2(n / 2) + n / 2;
}
ll f_5(ll n) {
if (n <= 1)
return 0;
return f_5(n / 5) + n / 5;
}
signed main(void) {
ll n, ans;
cin >> n;
ans = ... | replace | 21 | 22 | 21 | 22 | TLE | |
p02833 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define ll long long
#define all(x) (x).begin(), (x).end()
#define int long long
signed main() {
int n;
cin >> n;
// 奇数なら約数に2がないので0
if (n % 2 == 1) {
cout << 0 << endl;
return 0;
}
// 偶数なら明らかに約数は5の数が少な... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define ll long long
#define all(x) (x).begin(), (x).end()
#define int long long
signed main() {
int n;
cin >> n;
// 奇数なら約数に2がないので0
if (n % 2 == 1) {
cout << 0 << endl;
return 0;
}
// 偶数なら明らかに約数は5の数が少な... | replace | 18 | 21 | 18 | 22 | TLE | |
p02833 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
template <class T> bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> bool chmin(T &a, T b) {
if (a > b) {
a = b;
... | #include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
template <class T> bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> bool chmin(T &a, T b) {
if (a > b) {
a = b;
... | replace | 59 | 69 | 59 | 61 | 0 | |
p02833 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <string>
#include <vector>
#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 ... | #include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <string>
#include <vector>
#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 ... | replace | 46 | 48 | 46 | 47 | TLE | |
p02833 | C++ | Runtime Error | // C
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#i... | // C
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#i... | replace | 101 | 102 | 101 | 102 | -8 | |
p02833 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
long long ans = 0;
long long a;
int main() {
cin >> a;
if (a % 2 == 1) {
cout << 0;
return 0;
} else {
while (a >= 0) {
a /= 10;
ans += a;
}
cout << ans;
return 0;
}
} | #include <iostream>
using namespace std;
long long ans = 0;
long long a;
int main() {
cin >> a;
if (a % 2 == 1) {
cout << 0;
return 0;
} else {
a /= 10;
ans += a;
while (a > 0) {
a /= 5;
ans += a;
}
cout << ans;
return 0;
}
} | replace | 10 | 12 | 10 | 14 | TLE | |
p02833 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define For(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) For(i, 0, n)
// Write From This Line
int main() {
ll n;
cin >> n;
if (n % 2) {
cout << 0 << endl;
return 0;
}
ll ans = 0;
ll five = 10;... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define For(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) For(i, 0, n)
// Write From This Line
int main() {
ll n;
cin >> n;
if (n % 2) {
cout << 0 << endl;
return 0;
}
ll ans = 0;
n /= 2;
ll ... | replace | 17 | 21 | 17 | 22 | TLE | |
p02833 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t N, count;
cin >> N;
count = 0;
if (N % 2 != 0) {
cout << count << endl;
} else {
for (int i = 10; i <= N; i = i * 10) {
count += N / i;
}
cout << count << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t N, count;
cin >> N;
count = 0;
if (N % 2 != 0) {
cout << count << endl;
} else {
for (int64_t i = 5; i <= N; i = i * 5) {
count += N / (i * 2);
}
cout << count << endl;
}
}
| replace | 10 | 12 | 10 | 12 | 0 | |
p02833 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
long long n, res = 0;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> n;
if (n % 2) {
cout << 0;
return 0;
}
n /= 2;
for (int i = 5; i <= n; i *= 5)
res += n / i;
cout << res;
}
| #include <bits/stdc++.h>
using namespace std;
long long n, res = 0;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> n;
if (n % 2) {
cout << 0;
return 0;
}
n /= 2;
for (long long i = 5; i <= n; i *= 5)
res += n / i;
cout << res;
}
| replace | 16 | 17 | 16 | 17 | TLE | |
p02833 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
typedef long long ll;
const ll INF = 1LL << 60;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
ll n;
cin >> n;
if (n % 2) {
cout << 0 << endl;
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
typedef long long ll;
const ll INF = 1LL << 60;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
ll n;
cin >> n;
if (n % 2 || n == 0) {
cout << 0 << ... | replace | 14 | 15 | 14 | 15 | 0 | |
p02833 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i < n + 1; i++)
#define sort(A) sort(A.begin(), A.end())
#define reverse(A) reverse(A.begin(), A.end())
typedef long long ll;
typedef pair<int, int> P;
int main() {
ll n;
cin >> n;
if (... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i < n + 1; i++)
#define sort(A) sort(A.begin(), A.end())
#define reverse(A) reverse(A.begin(), A.end())
typedef long long ll;
typedef pair<int, int> P;
int main() {
ll n;
cin >> n;
if (... | replace | 19 | 22 | 19 | 21 | 0 | |
p02833 | C++ | Time Limit Exceeded | // x<<y=x*2^y,x>>y=x/2^y
// 1<<31 gives overflow
// use ll() for using an integer in self-built fn
//(x&-x) bitwise and of (x and its 2's complement) returns (last set bit)
// eg if x=1010 then it will return 0010
// careful dont print empty container(run time error)
// v.erase O(n)
// use ("\n") instead of endl as en... | // x<<y=x*2^y,x>>y=x/2^y
// 1<<31 gives overflow
// use ll() for using an integer in self-built fn
//(x&-x) bitwise and of (x and its 2's complement) returns (last set bit)
// eg if x=1010 then it will return 0010
// careful dont print empty container(run time error)
// v.erase O(n)
// use ("\n") instead of endl as en... | replace | 197 | 210 | 197 | 208 | TLE | |
p02834 | Python | Runtime Error | n, u, v = map(int, input().split())
# よりたかはしくんが早く辿り着ける葉のうち、青木君から最も遠いで
u -= 1
v -= 1
g = [[] for _ in range(n)]
for _ in range(n - 1):
a, b = map(lambda x: int(x) - 1, input().split())
g[a].append(b)
g[b].append(a)
INF = 1 << 30
t = [INF] * n
a = [INF] * n
t[u] = 0
a[v] = 0
def dfs(v, p, d):
for nv ... | import sys
sys.setrecursionlimit(10**6)
n, u, v = map(int, input().split())
# よりたかはしくんが早く辿り着ける葉のうち、青木君から最も遠いで
u -= 1
v -= 1
g = [[] for _ in range(n)]
for _ in range(n - 1):
a, b = map(lambda x: int(x) - 1, input().split())
g[a].append(b)
g[b].append(a)
INF = 1 << 30
t = [INF] * n
a = [INF] * n
t[u] = ... | insert | 0 | 0 | 0 | 4 | 0 | |
p02834 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const int MOD = 1e9 + 7;
vector<int> g[100100];
int dist[100100] = {};
int ans[100100] = {};
int tak, ao;
void dfs(int u, int pa, int d) {
for (auto v : g[u]) {
if (v == pa)
continue;
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const int MOD = 1e9 + 7;
vector<int> g[100100];
int dist[100100] = {};
int ans[100100] = {};
int tak, ao;
void dfs(int u, int pa, int d) {
for (auto v : g[u]) {
if (v == pa)
continue;
... | replace | 26 | 27 | 26 | 27 | TLE | |
p02834 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long int
#define ull unsigned long long
#define ff first
#define ss second
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(0); ... | #include <bits/stdc++.h>
#define ll long long int
#define ull unsigned long long
#define ff first
#define ss second
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(0); ... | delete | 25 | 30 | 25 | 25 | -11 | |
p02834 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long
#define INF (ll)1e18 + 50
#define MAXN (int)1e5 + 50
#define fi first
#define se second
#define MOD 1000000007
#define all(v) ((v).begin()), ((v).end())
#define A 911382323
#define B 972663749
vector<vector<int>> G;
int dist[101010... | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long
#define INF (ll)1e18 + 50
#define MAXN (int)1e5 + 50
#define fi first
#define se second
#define MOD 1000000007
#define all(v) ((v).begin()), ((v).end())
#define A 911382323
#define B 972663749
vector<int> G[101010];
int dist[101010... | replace | 13 | 14 | 13 | 14 | -11 | |
p02834 | C++ | Time Limit Exceeded | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i, n) for (ll(i) = 0; (i) < (n); (i)++)
#define rep1(i, n) for (ll(i) = 1; (i) <= (n); (i)++)
#define rrep(i, n) for (ll(i) = (n)-1; (i) >= 0; (i)--)
#define rrep1(i, n) for (ll(i) = (n); (i) >= 1; (i)--)
const ll IN... | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i, n) for (ll(i) = 0; (i) < (n); (i)++)
#define rep1(i, n) for (ll(i) = 1; (i) <= (n); (i)++)
#define rrep(i, n) for (ll(i) = (n)-1; (i) >= 0; (i)--)
#define rrep1(i, n) for (ll(i) = (n); (i) >= 1; (i)--)
const ll IN... | replace | 118 | 119 | 118 | 119 | TLE | |
p02834 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using Graph = vector<vector<int>>;
const int INF = 1e9 + 1;
const ll LLINF = 1e18;
const int MOD = 1e9 + 7;
int main() {
int N, u, v;
cin >> N >> u >> v;
u--, v--;
Graph G(N, vector<int>(N)... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using Graph = vector<vector<int>>;
const int INF = 1e9 + 1;
const ll LLINF = 1e18;
const int MOD = 1e9 + 7;
int main() {
int N, u, v;
cin >> N >> u >> v;
u--, v--;
Graph G(N);
for (int i ... | replace | 14 | 15 | 14 | 15 | 0 | |
p02834 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define per(i, n) for (ll i = n - 1; i >= 0; i--)
#define REP(i, n) for (ll i = 1; i < n; i++)
#define PER(i, n) for (ll i = n; i >= 1; i--)
#define sz(x) int(x.size())
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define per(i, n) for (ll i = n - 1; i >= 0; i--)
#define REP(i, n) for (ll i = 1; i < n; i++)
#define PER(i, n) for (ll i = n; i >= 1; i--)
#define sz(x) int(x.size())
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(... | replace | 48 | 49 | 48 | 49 | TLE | |
p02834 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
vector<int> to[10005];
int n;
vector<int> dist;
void dfs(int v, int d = 0, int p = -1) {
dist[v] = d;
for (int u : to[v]) {
if (u == p)
continue;
dfs(u, d + 1, v);
}
}
vector<int> calcDist(int s) {
dist = vector<int>(n);
dfs(s);
return dist;
}
... | #include <bits/stdc++.h>
using namespace std;
vector<int> to[100005];
int n;
vector<int> dist;
void dfs(int v, int d = 0, int p = -1) {
dist[v] = d;
for (int u : to[v]) {
if (u == p)
continue;
dfs(u, d + 1, v);
}
}
vector<int> calcDist(int s) {
dist = vector<int>(n);
dfs(s);
return dist;
}
... | replace | 3 | 4 | 3 | 4 | 0 | |
p02834 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const ll maxs = 1e5;
#define pb push_back
ll n, a, b;
std::vector<ll> Tree[maxs];
ll dist[2][maxs];
void go(ll s, ll p, ll ind) {
dist[ind][s] = dist[ind][p] + 1;
for (auto d : Tree[s]) {
if (d != p)
go(d, s, ind);
}
}
int main... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const ll maxs = 1e5 + 5;
#define pb push_back
ll n, a, b;
std::vector<ll> Tree[maxs];
ll dist[2][maxs];
void go(ll s, ll p, ll ind) {
dist[ind][s] = dist[ind][p] + 1;
for (auto d : Tree[s]) {
if (d != p)
go(d, s, ind);
}
}
int ... | replace | 4 | 5 | 4 | 5 | 0 | |
p02834 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 110;
const ll INF = 2e9 + 10;
struct edge {
int to, next;
} G[maxn << 1];
int tot, head[maxn];
void addEdge(int u, int v) {
G[tot] = {v, head[u]};
head[u] = tot++;
};
int n, s, t, vis[2][maxn];
void dfs(int u, int fa, int x) {
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 5;
const ll INF = 2e9 + 10;
struct edge {
int to, next;
} G[maxn << 1];
int tot, head[maxn];
void addEdge(int u, int v) {
G[tot] = {v, head[u]};
head[u] = tot++;
};
int n, s, t, vis[2][maxn];
void dfs(int u, int fa, int x)... | replace | 3 | 4 | 3 | 4 | 0 | |
p02834 | C++ | Runtime Error | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <utility>
#include <vector>
#define fir first
#define sec second
#define sz(s) (s).size();
#define pb push_back
#define get(n) scanf("%d", &n);
#define gets(s) ... | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <utility>
#include <vector>
#define fir first
#define sec second
#define sz(s) (s).size();
#define pb push_back
#define get(n) scanf("%d", &n);
#define gets(s) ... | replace | 234 | 235 | 234 | 235 | 0 | |
p02834 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <bitset>
using namespace std;
#define M 1000000007
#define pb push_back
#define f first
#define s second
#define rep(i, st, ed) for (int i = st; i < ed; i++)
#define repn(i, st, ed) for (int i = st; i <= ed; i++)
#define repb(i, ed, st) for (int i = ed; i >= st; i--)
#define all(v) v... | #include <bits/stdc++.h>
#include <bitset>
using namespace std;
#define M 1000000007
#define pb push_back
#define f first
#define s second
#define rep(i, st, ed) for (int i = st; i < ed; i++)
#define repn(i, st, ed) for (int i = st; i <= ed; i++)
#define repb(i, ed, st) for (int i = ed; i >= st; i--)
#define all(v) v... | replace | 18 | 19 | 18 | 19 | 0 | |
p02834 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#defi... | #include <bits/stdc++.h>
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#defi... | replace | 49 | 50 | 49 | 50 | -11 | |
p02834 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
vector<bool> seen;
vector<int> U, V;
void dfs(Graph G, int v, int num) {
seen[v] = true;
U[v] = num;
num++;
for (int next_v : G[v]) {
if (seen[next_v])
continue;
dfs(G, next_v, num);
}
}
int main() {
int N, u, v;
... | #include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
vector<bool> seen;
vector<int> U, V;
void dfs(Graph &G, int v, int num) {
seen[v] = true;
U[v] = num;
num++;
for (int next_v : G[v]) {
if (seen[next_v])
continue;
dfs(G, next_v, num);
}
}
int main() {
int N, u, v;... | replace | 5 | 6 | 5 | 6 | TLE | |
p02834 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using vvi = vector<vector<int>>;
#define repex(i, a, b, c) for (int i = a; i < b; i += c)
#define repx(i, a, b) repex(i, a, b, 1)
#define rep(i, n) repx(i, 0, n)
#define pb push_back
int du[101010], dv[101010], duv[101010]; // 距離を保存
// グラフを幅優先探索する.
// https://ja.wikipedia.... | #include <bits/stdc++.h>
using namespace std;
using vvi = vector<vector<int>>;
#define repex(i, a, b, c) for (int i = a; i < b; i += c)
#define repx(i, a, b) repex(i, a, b, 1)
#define rep(i, n) repx(i, 0, n)
#define pb push_back
int du[101010], dv[101010], duv[101010]; // 距離を保存
// グラフを幅優先探索する.
// https://ja.wikipedia.... | replace | 72 | 75 | 72 | 82 | 0 | |
p02834 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
vector<int> G[10500];
int dist[2][10500] = {};
int ans = 0;
void DFS(int node, int parent, int man) {
for (auto it : G[node]) {
if (it != parent) {
dist[man][it] = dist[man][node] + 1;
DFS(it, node, man);
}
}
}
int main() {
int n, v, u;
cin >> ... | #include "bits/stdc++.h"
using namespace std;
vector<int> G[105000];
int dist[2][100500] = {};
int ans = 0;
void DFS(int node, int parent, int man) {
for (auto it : G[node]) {
if (it != parent) {
dist[man][it] = dist[man][node] + 1;
DFS(it, node, man);
}
}
}
int main() {
int n, v, u;
cin >... | replace | 3 | 5 | 3 | 5 | 0 | |
p02834 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define vout(x) rep(i, x.size()) cout << x[i] << " "
template <class T> bool chmin(T &a, T b) {
if (a > b) {
a =... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define vout(x) rep(i, x.size()) cout << x[i] << " "
template <class T> bool chmin(T &a, T b) {
if (a > b) {
a =... | replace | 31 | 32 | 31 | 32 | TLE | |
p02834 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
vector<vector<int>> g;
vector<int> used;
void dfs(int cur, int d, vector<int> &h) {
h[cur] = d;
used[cur] = 1;
for (auto x : g[cur]) {
if (!used[x]) {
dfs(x, d + 1, h);
}
}
}
int main() {
// your code goes here
ios_base::sync_... | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
vector<vector<int>> g;
vector<int> used;
void dfs(int cur, int d, vector<int> &h) {
h[cur] = d;
used[cur] = 1;
for (auto x : g[cur]) {
if (!used[x]) {
dfs(x, d + 1, h);
}
}
}
int main() {
// your code goes here
ios_base::sync_... | replace | 27 | 28 | 27 | 28 | 0 | |
p02834 | Python | Time Limit Exceeded | def p_f():
from sys import stdin
input = stdin.readline
N, u, v = map(int, input().split())
edges = [list(map(int, input().split())) for i in range(N - 1)]
if u == v:
print(0)
exit()
def BFS(K, edges, N):
roots = [[] for i in range(N)]
for a, b in edges:
... | def p_f():
from sys import stdin
input = stdin.readline
N, u, v = map(int, input().split())
edges = [list(map(int, input().split())) for i in range(N - 1)]
if u == v:
print(0)
exit()
def BFS(K, edges, N):
roots = [[] for i in range(N)]
for a, b in edges:
... | replace | 29 | 40 | 29 | 34 | TLE | |
p02834 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
vector<vector<int>> c(10010, vector<int>(0));
int N;
// 既に探索した部分をboolの配列で表現したところREとなった
// 上記boolをやめて,一つ前のpositionをppで把握→ppを飛ばすとしても提出結果に変わりなし
void DFS(int p, int ans, int pp, vector<int> &d) {
d.at(p) = ans;
for (int i : c.at(p)) {
if (i == pp) {
... | #include <iostream>
#include <vector>
using namespace std;
vector<vector<int>> c(100100, vector<int>(0));
int N;
// 既に探索した部分をboolの配列で表現したところREとなった
// 上記boolをやめて,一つ前のpositionをppで把握→ppを飛ばすとしても提出結果に変わりなし
void DFS(int p, int ans, int pp, vector<int> &d) {
d.at(p) = ans;
for (int i : c.at(p)) {
if (i == pp) {
... | replace | 3 | 4 | 3 | 4 | 0 | |
p02834 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define bit(x) (1L << (x))
using ll = long long;
using namespace std;
template <typename T> vector<T> make_v(size_t a, T b) {
return vector<T>(a, b);
}
template <typenam... | #include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define bit(x) (1L << (x))
using ll = long long;
using namespace std;
template <typename T> vector<T> make_v(size_t a, T b) {
return vector<T>(a, b);
}
template <typenam... | replace | 39 | 53 | 39 | 40 | TLE | |
p02834 | Python | Runtime Error | # 解説を見た
def solve(N, t, a, g) -> int:
def calc_dist(init):
dist = [-1] * N
dist[init] = 0
def _calc_dist(curr):
for next_ in g[curr]:
if dist[next_] != -1:
continue
dist[next_] = dist[curr] + 1
_calc_dist(next... | # 解説を見た
def solve(N, t, a, g) -> int:
import sys
sys.setrecursionlimit(10**7)
def calc_dist(init):
dist = [-1] * N
dist[init] = 0
def _calc_dist(curr):
for next_ in g[curr]:
if dist[next_] != -1:
continue
dist[next_... | insert | 4 | 4 | 4 | 8 | 0 | |
p02834 | Python | Runtime Error | from collections import deque
def nearlist(N, LIST): # 隣接リスト
NEAR = [set() for _ in range(N)]
for a, b in LIST:
NEAR[a - 1].add(b - 1)
NEAR[b - 1].add(a - 1)
return NEAR
def bfs(NEAR, S, N): # 幅優先探索 # キュー
dist = [-1 for _ in range(N)] # 前処理
dist[S] = 0
que, frag = deque([... | from collections import deque
def nearlist(N, LIST): # 隣接リスト
NEAR = [set() for _ in range(N)]
for a, b in LIST:
NEAR[a - 1].add(b - 1)
NEAR[b - 1].add(a - 1)
return NEAR
def bfs(NEAR, S, N): # 幅優先探索 # キュー
dist = [-1 for _ in range(N)] # 前処理
dist[S] = 0
que, frag = deque([... | replace | 34 | 35 | 34 | 35 | TypeError: 'int' object is not subscriptable | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02834/Python/s347111194.py", line 35, in <module>
print(ans[0] - 1)
TypeError: 'int' object is not subscriptable
|
p02834 | C++ | Runtime Error | // #undef _DEBUG
// #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace std::chrono;
#define int long long
#define ll long long
auto start_time = system_clock::now();
#define debugName(VariableName) #V... | // #undef _DEBUG
// #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace std::chrono;
#define int long long
#define ll long long
auto start_time = system_clock::now();
#define debugName(VariableName) #V... | replace | 5,032 | 5,033 | 5,032 | 5,033 | -11 | |
p02834 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <vector>
int parent[18][100000];
int depth[100000];
std::vector<int> edge[100000];
void dfs(int v, int p, int d) {
parent[0][v] = p;
depth[v] = d;
for (auto to : edge[v]) {
if (to != p)
dfs(to, v, d + 1);
}
}
int lca(int u, int v) {
if (depth[u] > d... | #include <algorithm>
#include <cstdio>
#include <vector>
int parent[20][100000];
int depth[100000];
std::vector<int> edge[100000];
void dfs(int v, int p, int d) {
parent[0][v] = p;
depth[v] = d;
for (auto to : edge[v]) {
if (to != p)
dfs(to, v, d + 1);
}
}
int lca(int u, int v) {
if (depth[u] > d... | replace | 4 | 5 | 4 | 5 | 0 | |
p02834 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define FOR(i, a, b) for (int i = a; i < (int)b; ++i)
#define rrep(i, n) for (int i = ((int)n - 1); i >= 0; --i)
typedef long long ll;
typedef long double ld;
const int Inf = 1e9;
const double EPS = 1e-9;
const int MOD ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define FOR(i, a, b) for (int i = a; i < (int)b; ++i)
#define rrep(i, n) for (int i = ((int)n - 1); i >= 0; --i)
typedef long long ll;
typedef long double ld;
const int Inf = 1e9;
const double EPS = 1e-9;
const int MOD ... | replace | 17 | 18 | 17 | 18 | 0 | |
p02834 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using uint = unsigned int;
using pcc = pair<char, char>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
using tuplis = array<ll, 3>;
template <class T> usi... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using uint = unsigned int;
using pcc = pair<char, char>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
using tuplis = array<ll, 3>;
template <class T> usi... | insert | 371 | 371 | 371 | 373 | TLE | |
p02834 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
vector<int> dists_from(int v);
void dfs(int v, int d, int p);
int n;
vector<int> N[20000];
vector<int> dists;
int main(void) {
int u, v;
cin >> n >> u >> v;
u--;
v--;
for (int i = 0; i < n - 1; i++) {
int a, b;
cin >> ... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
vector<int> dists_from(int v);
void dfs(int v, int d, int p);
int n;
vector<int> N[200000];
vector<int> dists;
int main(void) {
int u, v;
cin >> n >> u >> v;
u--;
v--;
for (int i = 0; i < n - 1; i++) {
int a, b;
cin >>... | replace | 9 | 10 | 9 | 10 | 0 | |
p02834 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define fast_io ... | #include <algorithm>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define fast_io ... | insert | 123 | 123 | 123 | 125 | TLE | |
p02834 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
// long long
using ll = long long;
// pair<int, int>
using PII = pair<int, int>;
// 最大値、mod
const int MOD = 1000000007;
const int mod = 1000000007;
const int INF = 1000000000;
const long long LINF = 1e18;
const int MAX = 510000;
// 出力系
#define print(x) cout << x << endl... | #include <bits/stdc++.h>
using namespace std;
// long long
using ll = long long;
// pair<int, int>
using PII = pair<int, int>;
// 最大値、mod
const int MOD = 1000000007;
const int mod = 1000000007;
const int INF = 1000000000;
const long long LINF = 1e18;
const int MAX = 510000;
// 出力系
#define print(x) cout << x << endl... | replace | 285 | 286 | 285 | 286 | TLE | |
p02834 | C++ | Runtime Error | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
// vector string deque break continue
#define forn(i, s, f) for (int i = (int)s; i < (int)f; i++)
#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair<int, int>
#define fs first
#define sc second
#define... | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
// vector string deque break continue
#define forn(i, s, f) for (int i = (int)s; i < (int)f; i++)
#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair<int, int>
#define fs first
#define sc second
#define... | replace | 52 | 54 | 52 | 55 | 0 | |
p02834 | C++ | Runtime Error | #include "bits/stdc++.h"
// Begin Header {{{
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (i64 i = 0, i##_limit = (n); i < i##_limit; ++i)
#define reps(i, s, t) for (i64 i = (s), i##_limit = (t); i <= i##_limit; ++i)
#define repr(i, s, t) for (i64 i = (s), i##_limit = (t); i >= i##_limit; --i)
#define va... | #include "bits/stdc++.h"
// Begin Header {{{
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (i64 i = 0, i##_limit = (n); i < i##_limit; ++i)
#define reps(i, s, t) for (i64 i = (s), i##_limit = (t); i <= i##_limit; ++i)
#define repr(i, s, t) for (i64 i = (s), i##_limit = (t); i >= i##_limit; --i)
#define va... | replace | 221 | 222 | 221 | 222 | 0 | |
p02835 | Python | Runtime Error | A1 = input()
A2 = input()
A3 = input()
| a, b, c = map(int, input().split())
if a + b + c >= 22:
print("bust")
else:
print("win")
| replace | 0 | 3 | 0 | 5 | EOFError: EOF when reading a line | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02835/Python/s614017612.py", line 2, in <module>
A2 = input()
EOFError: EOF when reading a line
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.