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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p00712 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
int gcd(int p, int q) {
if (p < q) {
int t = p;
p = q;
q = t;
}
while (q != 0) {
int t = p;
p = q;
q = t % q;
}
return p;
}
int pow2(int a, int b) {
int e = a, p = 1;... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
int gcd(int p, int q) {
if (p < q) {
int t = p;
p = q;
q = t;
}
while (q != 0) {
int t = p;
p = q;
q = t % q;
}
return p;
}
int pow2(int a, int b) {
int e = a, p = 1;... | replace | 85 | 86 | 85 | 86 | TLE | |
p00712 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int p, q, a, n, answer;
void search(int pp, int qq, int start, int count) {
if (count == n)
return;
for (int i = start; i <= a; ++i) {
int ppp = pp * i + qq;
int qqq = qq * i;
if (qqq > a)
return;
if (!(qqq % q) && !(ppp % p) && qqq / q == ppp / ... | #include <iostream>
using namespace std;
int p, q, a, n, answer;
void search(int pp, int qq, int start, int count) {
if (count == n)
return;
for (int i = start; i <= a; ++i) {
int ppp = pp * i + qq;
int qqq = qq * i;
if (qqq > a)
return;
if (ppp / qqq > p / q)
continue;
if (!(... | insert | 14 | 14 | 14 | 16 | TLE | |
p00712 | C++ | Time Limit Exceeded | #include <cmath>
#include <iostream>
using namespace std;
int p, q, a, n;
double EPS = 1e-9;
int solve(double sum, int mul, int prev, int num) {
if (num > n)
return 0;
if (mul > a)
return 0;
if (fabs(sum - (double)p / (double)q) < EPS)
return 1;
if (sum > (double)p / (double)q)
return 0;
... | #include <cmath>
#include <iostream>
using namespace std;
int p, q, a, n;
double EPS = 1e-9;
int solve(double sum, int mul, int prev, int num) {
if (num > n)
return 0;
if (mul > a)
return 0;
if (fabs(sum - (double)p / (double)q) < EPS)
return 1;
if (sum > (double)p / (double)q)
return 0;
... | replace | 20 | 21 | 20 | 21 | TLE | |
p00712 | C++ | Time Limit Exceeded | #include <stdio.h>
int dfs(int p, int q, int a, int n, int pre) {
if (p == 0)
return 1;
if (n == 0)
return 0;
int res = 0;
for (int i = pre; i <= 12000; i++) {
if ((a / i) == 0)
break;
res += dfs(i * p - q, i * q, a / i, n - 1, i);
}
return res;
}
int main() {
int p, q, a, n;
whi... | #include <stdio.h>
int dfs(int p, int q, int a, int n, int pre) {
if (p == 0)
return 1;
if (n == 0)
return 0;
int res = 0;
for (int i = pre; i <= 6000; i++) {
if ((a / i) == 0)
break;
res += dfs(i * p - q, i * q, a / i, n - 1, i);
}
return res;
}
int main() {
int p, q, a, n;
whil... | replace | 8 | 9 | 8 | 9 | TLE | |
p00712 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
typedef long long ll;
ll p, q, a, n, an;
ll gcd(ll a, ll b) {
if (b)
return gcd(b, a % b);
return a;
}
void dfs(ll d, ll s, ll t, ll k, ll j) {
if (d > n || s * q > p * k)
return;
if (s * q == p * k) {
an++;
return;
}
for (int i = j; t * i <= a; i++... | #include <iostream>
using namespace std;
typedef long long ll;
ll p, q, a, n, an;
ll gcd(ll a, ll b) {
if (b)
return gcd(b, a % b);
return a;
}
void dfs(ll d, ll s, ll t, ll k, ll j) {
if (d > n || s * q > p * k)
return;
if (s * q == p * k) {
an++;
return;
}
for (int i = j; t * i <= a; i++... | replace | 19 | 21 | 19 | 21 | TLE | |
p00712 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
#define ISEQ(c) (c).begin(), (c).end()
typedef long long ll;
typedef pair<int, int> P;
int gcd(int a, int b) {
if (... | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
#define ISEQ(c) (c).begin(), (c).end()
typedef long long ll;
typedef pair<int, int> P;
int gcd(int a, int b) {
if (... | insert | 34 | 34 | 34 | 36 | TLE | |
p00712 | C++ | Time Limit Exceeded | #include <iostream>
#include <set>
#include <vector>
using namespace std;
int p, q, n, a;
int ans;
int rec(int sum_u, int sum_l, int nn, int k) {
if (sum_l > a || nn == 0)
return -1;
if (sum_u * q == sum_l * p) {
ans++;
return 0;
}
nn--;
for (int x = k;; x++) {
if (rec(sum_u * x + sum_l, ... | #include <iostream>
#include <set>
#include <vector>
using namespace std;
int p, q, n, a;
int ans;
int rec(int sum_u, int sum_l, int nn, int k) {
if (sum_l > a || nn == 0)
return -1;
if (sum_u * q == sum_l * p) {
ans++;
return 0;
}
if (p / double(q) < sum_u / double(sum_l))
return 0;
nn--... | insert | 17 | 17 | 17 | 19 | TLE | |
p00712 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int ans = 0;
int p, q, a, n;
void dfs(int num, int seki, int deno, int nume, int value) {
if (nume > 0) {
int g = __gcd(deno, nume);
deno /= g;
nume /= g;
}
if (p * deno == q * nume) {
ans++;
}
if (p * deno <= q *... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int ans = 0;
int p, q, a, n;
void dfs(int num, int seki, int deno, int nume, int value) {
if (nume > 0) {
int g = __gcd(deno, nume);
deno /= g;
nume /= g;
}
if ((nume / (double)deno) + (double)(n - num) / (double)value <
... | insert | 13 | 13 | 13 | 16 | TLE | |
p00712 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <cxxabi.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
#define rep(i, n) range(i, 0, n)
#define range(i, a, n) for (int i = a; i < n; i++)
#define all(a) a.begin(), a.end()
#define LINF ((ll)1ll < 60)
#define IN... | #include <bits/stdc++.h>
#include <cxxabi.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
#define rep(i, n) range(i, 0, n)
#define range(i, a, n) for (int i = a; i < n; i++)
#define all(a) a.begin(), a.end()
#define LINF ((ll)1ll < 60)
#define IN... | replace | 43 | 48 | 43 | 48 | TLE | |
p00712 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <st... | #include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <st... | replace | 54 | 57 | 54 | 57 | TLE | |
p00712 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int p, q, a, n;
int dfs(int A, int B, int C, int D, int MAX) {
int res = 0;
if (B * p == A * q) {
// cout<<A<<' '<<B<<' '<<C<<' '<<D<<' '<<MAX<<endl;
return 1;
}
if (D == n)
return 0;
for (int i = MAX; i * C <= a; i++) {
int t = __gcd(B, i);
... | #include <bits/stdc++.h>
using namespace std;
int p, q, a, n;
int dfs(int A, int B, int C, int D, int MAX) {
int res = 0;
if (B * p == A * q) {
// cout<<A<<' '<<B<<' '<<C<<' '<<D<<' '<<MAX<<endl;
return 1;
}
if (B * p < A * q)
return 0;
if (D == n)
return 0;
for (int i = MAX; i * C <=... | insert | 13 | 13 | 13 | 17 | TLE | |
p00712 | C++ | Time Limit Exceeded | #include <cstdio>
int gcd(int a, int b) {
if (b == 0)
return a;
return gcd(b, a % b);
}
int p, q, a, n, cnt;
void dfs(int v, int l, int r, int now) {
if (v != 0) {
int d = gcd(r, l);
if (l / d == p && r / d == q) {
cnt++;
return;
}
}
if (v < n) {
for (int i = a / r; i >= now... | #include <cstdio>
int gcd(int a, int b) {
if (b == 0)
return a;
return gcd(b, a % b);
}
int p, q, a, n, cnt;
void dfs(int v, int l, int r, int now) {
double dsum = (double)l / r;
dsum += (double)(n - v + 1) / now;
if ((double)p / q > dsum)
return;
if (v != 0) {
int d = gcd(r, l);
if (l / ... | insert | 11 | 11 | 11 | 15 | TLE | |
p00712 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
using pii = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
int p, q, a, n;
map<vector<int>, int> dp;
int gcd(int a, int b) { return a ? gcd(b % a, a) : b; }
int lcm(int a,... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
using pii = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
int p, q, a, n;
map<vector<int>, int> dp;
int gcd(int a, int b) { return a ? gcd(b % a, a) : b; }
int lcm(int a,... | replace | 34 | 40 | 34 | 41 | TLE | |
p00712 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) REP(i, 0, n)
#define REP(i, s, e) for (int i = (s); i < (int)(e); i++)
#define pb push_back
#define all(r) (r).begin(), (r).end()
#define rall(r) (r).rbegin(), (r).rend()
#define fi first
#define se second
typedef long long ll;
typedef vector<int> vi;
t... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) REP(i, 0, n)
#define REP(i, s, e) for (int i = (s); i < (int)(e); i++)
#define pb push_back
#define all(r) (r).begin(), (r).end()
#define rall(r) (r).rbegin(), (r).rend()
#define fi first
#define se second
typedef long long ll;
typedef vector<int> vi;
t... | replace | 35 | 38 | 35 | 38 | TLE | |
p00712 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sst... | #include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sst... | replace | 90 | 92 | 90 | 91 | TLE | |
p00712 | C++ | Time Limit Exceeded | #include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif
// #define int long long
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define all(c) begin(c), end(c)
const int INF =
sizeof(int) == sizeof... | #include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif
// #define int long long
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define all(c) begin(c), end(c)
const int INF =
sizeof(int) == sizeof... | insert | 36 | 36 | 36 | 38 | TLE | |
p00712 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int GCD(int m, int n) {
if (n == 0)
return m;
return GCD(n, m % n);
}
int dfs(int p, int q, int a, int n, int temp) {
if (a == 0 || n == 0)
return 0;
int res = 0;
int gcd = GCD(p, q);
p /= gcd;
q /= gcd;
for (int i = max((q + p - 1) / p, temp); i <= a;... | #include <iostream>
using namespace std;
int GCD(int m, int n) {
if (n == 0)
return m;
return GCD(n, m % n);
}
int dfs(int p, int q, int a, int n, int temp) {
if (a < temp || n == 0)
return 0;
int res = 0;
int gcd = GCD(p, q);
p /= gcd;
q /= gcd;
for (int i = max((q + p - 1) / p, temp); i <= ... | replace | 11 | 12 | 11 | 12 | TLE | |
p00712 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define mind(a, b) (a > b ? b : a)
#define maxd(a, b) (a > b ? a : b)
#define abs... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define mind(a, b) (a > b ? b : a)
#define maxd(a, b) (a > b ? a : b)
#define abs... | replace | 65 | 66 | 65 | 66 | TLE | |
p00712 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[] = {0, 0, 1, -1, 1, 1, -1, -1};
int dx[] = {1, -1, 0, 0, 1, -1, -1, 1};
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define ... | #include <bits/stdc++.h>
typedef int ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[] = {0, 0, 1, -1, 1, 1, -1, -1};
int dx[] = {1, -1, 0, 0, 1, -1, -1, 1};
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define REP(i,... | replace | 1 | 2 | 1 | 2 | TLE | |
p00712 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <queue>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
#define reps(i, f, n) for (int i = f; i < int(n); i++)
#define rep(i, n) reps(i, 0, n)
int cont;
void saiki(double rest, int a, i... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <queue>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
#define reps(i, f, n) for (int i = f; i < int(n); i++)
#define rep(i, n) reps(i, 0, n)
int cont;
void saiki(double rest, int a, i... | insert | 23 | 23 | 23 | 25 | TLE | |
p00712 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <climits>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#... | #include <algorithm>
#include <bitset>
#include <climits>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#... | insert | 136 | 136 | 136 | 140 | TLE | |
p00712 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <random>
#include <sstream>
#include <stack>
#include <string.h>
#include <string>
#include <type_traits>
#... | #include <algorithm>
#include <bitset>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <random>
#include <sstream>
#include <stack>
#include <string.h>
#include <string>
#include <type_traits>
#... | replace | 59 | 62 | 59 | 61 | TLE | |
p00712 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(v) (v).begin(), (v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define BIT(x, n) bitset<n>(x)
#def... | #include <bits/stdc++.h>
using namespace std;
#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(v) (v).begin(), (v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define BIT(x, n) bitset<n>(x)
#def... | replace | 36 | 37 | 36 | 38 | TLE | |
p00712 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int P, Q, A, N;
int P_, Q_;
int gcd(int a, int b) { return a % b ? gcd(b, a % b) : b; }
int solve(int a, int n, int sum, int b) {
int res = 0;
int div = gcd(sum, a);
if (P_ == sum / div && Q_ == a / div)
return 1;
if (P_ * a < Q_ * sum)
return 0;
if (n >= N... | #include <iostream>
using namespace std;
int P, Q, A, N;
int P_, Q_;
int gcd(int a, int b) { return a % b ? gcd(b, a % b) : b; }
int solve(int a, int n, int sum, int b) {
int res = 0;
/*
int div = gcd(sum , a);
if(P_ == sum / div && Q_ == a / div)
return 1;
// */
if (sum / P_ == a / Q_ && sum ... | replace | 11 | 13 | 11 | 17 | TLE | |
p00712 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iostream>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1(i, n) for (int i = 1; i <= (n); ++i)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define fs first
#define s... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iostream>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1(i, n) for (int i = 1; i <= (n); ++i)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define fs first
#define s... | insert | 19 | 19 | 19 | 21 | TLE | |
p00712 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long LL;
static const double EPS = 1e-9;
#define FOR(i, k, n) for (int i = (k); i < (... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long LL;
static const double EPS = 1e-9;
#define FOR(i, k, n) for (int i = (k); i < (... | insert | 30 | 30 | 30 | 32 | TLE | |
p00712 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <map>
#include <vector>
using namespace std;
int memo[12001][8];
int b_pow(int a, int b) {
if (memo[a][b])
return memo[a][b];
else if (b == 0)
return 1;
else if (b == 1)
return a;
else
return memo[a][b] = b_pow(a, b / 2) * b_pow(a, (b + 1) / 2);
... | #include <algorithm>
#include <iostream>
#include <map>
#include <vector>
using namespace std;
int memo[12001][8];
int b_pow(int a, int b) {
if (memo[a][b])
return memo[a][b];
else if (b == 0)
return 1;
else if (b == 1)
return a;
else
return memo[a][b] = b_pow(a, b / 2) * b_pow(a, (b + 1) / 2);
... | replace | 19 | 20 | 19 | 20 | TLE | |
p00712 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <... | #include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <... | insert | 83 | 83 | 83 | 85 | TLE | |
p00713 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <vector>
#define rep(n) for (int i = 0; i < n; i++)
#define repp(j, n) for (int j = 0; j < n; j++)
#define reppp(i, m, n) for (int i = m; i < n; i++)
#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define debug... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <vector>
#define rep(n) for (int i = 0; i < n; i++)
#define repp(j, n) for (int j = 0; j < n; j++)
#define reppp(i, m, n) for (int i = m; i < n; i++)
#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define debug... | delete | 65 | 66 | 65 | 65 | 0 | ans: 2
ans: 5
ans: 5
ans: 11
|
p00713 | C++ | Runtime Error | #include <algorithm>/*{{{*/
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#inclu... | #include <algorithm>/*{{{*/
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#inclu... | replace | 70 | 71 | 70 | 71 | 0 | (6.476340, 7.696280) and (5.168280, 4.799150)
(6.476340, 7.696280) and (6.695330, 6.203780)
center: (7.235478, 7.045350)
center: (5.936192, 6.854710)
(5.168280, 4.799150) and (6.695330, 6.203780)
(7.152960, 4.083280) and (6.508270, 2.694660)
center: (7.414234, 3.118015)
center: (6.246996, 3.659925)
(7.152960, 4.083... |
p00714 | C++ | Time Limit Exceeded | #define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#inc... | #define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#inc... | replace | 237 | 238 | 237 | 238 | TLE | |
p00715 | C++ | Runtime Error | #define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<... | #define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<... | insert | 63 | 63 | 63 | 64 | 0 | |
p00715 | C++ | Runtime Error | #include <algorithm>
#include <cfloat>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <time.h>
#include <vector>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 100000... | #include <algorithm>
#include <cfloat>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <time.h>
#include <vector>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 100000... | replace | 79 | 80 | 79 | 80 | 0 | |
p00715 | C++ | Runtime Error | #include <algorithm>
#include <map>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
char in[50];
char L[50];
char R[50];
int p[500];
int q[500];
int UF[500];
int FIND(int a) {
if (UF[a] < 0)
return a;
return UF[a] = FIND(UF[a]);
}
void UNION(int a, int b) {
a = FIND(a);
b = FIND(... | #include <algorithm>
#include <map>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
char in[50];
char L[50];
char R[50];
int p[5100];
int q[5100];
int UF[500];
int FIND(int a) {
if (UF[a] < 0)
return a;
return UF[a] = FIND(UF[a]);
}
void UNION(int a, int b) {
a = FIND(a);
b = FIN... | replace | 9 | 11 | 9 | 11 | 0 | |
p00717 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long // <-----!!!!!!!!!!!!!!!!!!!
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define rrep2(i, a, b) for (int i = (a)-1; i >= b; i--)
#define chmi... | #include <bits/stdc++.h>
using namespace std;
#define int long long // <-----!!!!!!!!!!!!!!!!!!!
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define rrep2(i, a, b) for (int i = (a)-1; i >= b; i--)
#define chmi... | replace | 101 | 102 | 101 | 102 | 0 | |
p00717 | C++ | Runtime Error | #include "bits/stdc++.h"
#include <fstream>
#include <sys/timeb.h>
using namespace std;
#define repl(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repl(i, 0, n)
#define replrev(i, a, b) for (int i = (int)(b)-1; i >= (int)(a); i--)
#define reprev(i, n) replrev(i, 0, n)
#define repi(itr, ds) for ... | #include "bits/stdc++.h"
#include <fstream>
#include <sys/timeb.h>
using namespace std;
#define repl(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repl(i, 0, n)
#define replrev(i, a, b) for (int i = (int)(b)-1; i >= (int)(a); i--)
#define reprev(i, n) replrev(i, 0, n)
#define repi(itr, ds) for ... | delete | 44 | 47 | 44 | 44 | TLE | |
p00717 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n, m, x, y;
while (true) {
cin >> n;
if (n == 0) {
break;
}
vector<vector<pair<long double, long double>>> L(2 * n + 2);
long double theta, theta2, x4, y4;
for (int ... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n, m, x, y;
while (true) {
cin >> n;
if (n == 0) {
break;
}
vector<vector<pair<long double, long double>>> L(2 * n + 2);
long double theta, theta2, x4, y4;
for (int ... | replace | 45 | 46 | 45 | 46 | 0 | |
p00717 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
typedef vector<pair<int, int>> VP;
int main(void) {
while (1) {
int n;
cin >> n;
if (n == 0) {
break;
}
// make base
int m;
cin >> m;
VP base(m);
VP base2(m);
VP base3(m);
VP base4(m);
... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
typedef vector<pair<int, int>> VP;
int main(void) {
while (1) {
int n;
cin >> n;
if (n == 0) {
break;
}
// make base
int m;
cin >> m;
VP base(m);
VP base2(m);
VP base3(m);
VP base4(m);
... | replace | 51 | 52 | 51 | 52 | 0 | |
p00718 | C++ | Runtime Error | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(void) {
int n;
vector<string> s(510);
vector<string> t(510);
int dp[510] = {};
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> s[i] >> t[i];
}
for (int i = 1; i <= n; i++) {
int a, b, c, d;
for (int p ... | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(void) {
int n;
vector<string> s(10000);
vector<string> t(10000);
int dp[10000] = {};
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> s[i] >> t[i];
}
for (int i = 1; i <= n; i++) {
int a, b, c, d;
for (... | replace | 8 | 11 | 8 | 11 | 0 | |
p00719 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <... | replace | 123 | 124 | 123 | 124 | 0 | cost[b] 1.06111e+09 1.06111e+09 1.06111e+09 1.06111e+09 1.06111e+09 1.06111e+09 1.06111e+09 30 1.06111e+09 1.06111e+09 1.06111e+09 1.06111e+09 1.06111e+09 1.06111e+09 1.06111e+09 1.06111e+09 1.06111e+09 1.06111e+09 1.06111e+09 1.06111e+09 1.06111e+09 1.06111e+09 1.06111e+09 1.06111e+09 1.06111e+09 1.06111e+09 1.06111e+... |
p00719 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <vector>
#pragma warning(disable : 4996)
#define INF 1000000000.0
using namespace std;
int n, m, p, a, b, x, y, z, t[8];
double dp[128][30];
vector<pair<int, int>> G[30];
int main() {
while (true) {
scanf("%d", &n);
scanf("%d", &m);
scanf("%d", &p);... | #include <algorithm>
#include <iostream>
#include <vector>
#pragma warning(disable : 4996)
#define INF 1000000000.0
using namespace std;
int n, m, p, a, b, x, y, z, t[8];
double dp[256][30];
vector<pair<int, int>> G[30];
int main() {
while (true) {
scanf("%d", &n);
scanf("%d", &m);
scanf("%d", &p);... | replace | 12 | 13 | 12 | 13 | -11 | |
p00719 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, double> P;
int main() {
int n, m, p, a, b;
while (cin >> n >> m >> p >> a >> b, n) {
a--, b--;
double t[8], tp;
vector<P> e[31];
for (int i = 0; i < n; i++)
cin >> t[i];
for (int j = 0, x, y; j < p; j++) {
cin >> x >> ... | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, double> P;
int main() {
int n, m, p, a, b;
while (cin >> n >> m >> p >> a >> b, n) {
a--, b--;
double t[8], tp;
vector<P> e[31];
for (int i = 0; i < n; i++)
cin >> t[i];
for (int j = 0, x, y; j < p; j++) {
cin >> x >> ... | replace | 29 | 30 | 29 | 30 | 0 | |
p00719 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stri... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stri... | replace | 54 | 55 | 54 | 55 | -6 | munmap_chunk(): invalid pointer
|
p00721 | C++ | Memory Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int w, h;
vector<string> field;
int dist(pair<int, int> a, pair<int, int> b) {
queue<pair<pair<int, int>, int>> bfs;
set<pair<int, int>> already;
bfs.push(make_pair(a, 0));
while (!bfs.empty()) {
pair<int, int> pos;
int cost;
tie(pos, cost) = bfs.front()... | #include <bits/stdc++.h>
using namespace std;
int w, h;
vector<string> field;
int dist(pair<int, int> a, pair<int, int> b) {
queue<pair<pair<int, int>, int>> bfs;
set<pair<int, int>> already;
bfs.push(make_pair(a, 0));
while (!bfs.empty()) {
pair<int, int> pos;
int cost;
tie(pos, cost) = bfs.front()... | replace | 15 | 16 | 15 | 16 | MLE | |
p00721 | C++ | Memory Limit Exceeded | #include <algorithm>
#include <chrono>
#include <functional>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;
#define INF 1e9
//????????????
class Timer {
chrono::high_resolution_clock::time_point start, end;
double limit;
public:
Timer() { start = chrono::high_reso... | #include <algorithm>
#include <chrono>
#include <functional>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;
#define INF 1e9
//????????????
class Timer {
chrono::high_resolution_clock::time_point start, end;
double limit;
public:
Timer() { start = chrono::high_reso... | replace | 163 | 164 | 163 | 164 | MLE | |
p00721 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string.h>
#include <string>
using namespace std;
#define FOR(i, n) for (int i = 0; i < n; i++)
#define bit(i) static_cast<bitset<8>>(i)
typedef long long ll;
typedef unsigned long lo... | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string.h>
#include <string>
using namespace std;
#define FOR(i, n) for (int i = 0; i < n; i++)
#define bit(i) static_cast<bitset<8>>(i)
typedef long long ll;
typedef unsigned long lo... | insert | 302 | 302 | 302 | 303 | 0 | |
p00721 | C++ | Runtime Error | #include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include ... | #include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include ... | replace | 149 | 150 | 149 | 150 | 0 | |
p00721 | C++ | Runtime Error | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
#define REP(i, a, b) for (i = a; i < b; ++i)
#define rep(i, n) REP(i, 0, n)
#define ll long long
#define ull unsigned ll
typedef long double ld;
#define ALL(a) (a).begin(), (a).end()
#define ifnot(a) if (not a)
#define dump(x) cerr << #... | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
#define REP(i, a, b) for (i = a; i < b; ++i)
#define rep(i, n) REP(i, 0, n)
#define ll long long
#define ull unsigned ll
typedef long double ld;
#define ALL(a) (a).begin(), (a).end()
#define ifnot(a) if (not a)
#define dump(x) cerr << #... | replace | 190 | 191 | 190 | 191 | 0 | ????????????
|
p00722 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;
const int MAX_SIZE = 100000;
int prime[MAX_SIZE];
bool isPrime[MAX_SIZE];
int p;
int main() {
fill(isPrime, isPrime + MAX_SIZE, true);
p = 0;
isPrime[0] = isPrime[1] = false;
for (int i = 2; i <= MAX_SIZE; i++)... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;
const int MAX_SIZE = 1000000;
int prime[MAX_SIZE];
bool isPrime[MAX_SIZE];
int p;
int main() {
fill(isPrime, isPrime + MAX_SIZE, true);
p = 0;
isPrime[0] = isPrime[1] = false;
for (int i = 2; i <= MAX_SIZE; i++... | replace | 7 | 8 | 7 | 8 | -11 | |
p00722 | C++ | Memory Limit Exceeded |
#include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <iostream>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define vi vector<int>
#define vvi vector<vector<int>>
#define ll long long int
#define vl vector<ll>
#define vvl vecto... |
#include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <iostream>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define vi vector<int>
#define vvi vector<vector<int>>
#define ll long long int
#define vl vector<ll>
#define vvl vecto... | replace | 28 | 29 | 28 | 29 | MLE | |
p00722 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main(void) {
for (;;) {
int a, d, n;
cin >> a >> d >> n;
if (a == 0 && d == 0 && n == 0) {
return 0;
}
int ans = -1;
for (int i = 0; ((a + d * i <= 1000000) && (ans == -1)); i++) {
bool prime = true;
for (int j = 2; j <= 10000; j++... | #include <iostream>
using namespace std;
int main(void) {
for (;;) {
int a, d, n;
cin >> a >> d >> n;
if (a == 0 && d == 0 && n == 0) {
return 0;
}
int ans = -1;
for (int i = 0; ((a + d * i <= 1000000) && (ans == -1)); i++) {
bool prime = true;
if (a + d * i == 1) {
p... | replace | 12 | 15 | 12 | 19 | TLE | |
p00722 | C++ | Time Limit Exceeded | #include <algorithm>
#include <fstream>
#include <iostream>
#include <list>
#include <queue>
#include <stdio.h>
#include <string>
#include <vector>
#define REP(i, n) for (int i = 0; i < n; ++i)
#define LL long long
using namespace std;
#define int LL
bool func(int x) {
if (x < 2)
return false;
for (int i = ... | #include <algorithm>
#include <fstream>
#include <iostream>
#include <list>
#include <queue>
#include <stdio.h>
#include <string>
#include <vector>
#define REP(i, n) for (int i = 0; i < n; ++i)
#define LL long long
using namespace std;
#define int LL
bool func(int x) {
if (x < 2)
return false;
for (int i = ... | insert | 36 | 36 | 36 | 39 | TLE | |
p00722 | C++ | Time Limit Exceeded | #include <math.h>
#include <stdio.h>
int main();
bool prime_chk(int num);
int main() {
int a[100] = {0};
int d[100] = {0};
int n[100] = {0};
int result[100] = {0};
int n_series;
int s_series;
int nth_prime_num;
int i, i_dataset;
bool prime_flg;
// データ入力
i_dataset = 0;
while (1) {
scanf(... | #include <math.h>
#include <stdio.h>
int main();
bool prime_chk(int num);
int main() {
int a[1000] = {0};
int d[1000] = {0};
int n[1000] = {0};
int result[1000] = {0};
int n_series;
int s_series;
int nth_prime_num;
int i, i_dataset;
bool prime_flg;
// データ入力
i_dataset = 0;
while (1) {
sc... | replace | 8 | 12 | 8 | 12 | TLE | |
p00722 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for (int i = s; i < (int)n; i++)
#define per(i, n) for (int i = n; i >= 0; i--)
#define ROF(i, s, n) for (int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(), (a).end()
#defin... | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for (int i = s; i < (int)n; i++)
#define per(i, n) for (int i = n; i >= 0; i--)
#define ROF(i, s, n) for (int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(), (a).end()
#defin... | replace | 45 | 46 | 45 | 46 | TLE | |
p00722 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
#include <queue>
#include <set>
#include <stack>
#include <string.h>
#include <string>
using namespace std;
#define INF 1 << 21
#define MOD 1000000007
#define MAX 1000000
int main() {
int p[MAX];
memset(p, 1, sizeof(p));
p[0] = 0;
... | #include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
#include <queue>
#include <set>
#include <stack>
#include <string.h>
#include <string>
using namespace std;
#define INF 1 << 21
#define MOD 1000000007
#define MAX 1000000
int main() {
char p[MAX];
memset(p, 1, sizeof(p));
p[0] = 0;
... | replace | 16 | 17 | 16 | 17 | -11 | |
p00722 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
int main(int argc, char *argv[]) {
const int N = 1000001;
vector<bool> prime(N, true);
prime[0] = false;
prime[1] = false;
for (int i = 2; i < N; i++) {
if (prime[i]) {
for (int j = i + i; j < N; j += i) {
prime[j] = false;
}
... | #include <iostream>
#include <vector>
using namespace std;
int main(int argc, char *argv[]) {
const int N = 1000001;
vector<bool> prime(N, true);
prime[0] = false;
prime[1] = false;
for (int i = 2; i < N; i++) {
if (prime[i]) {
for (int j = i + i; j < N; j += i) {
prime[j] = false;
}
... | insert | 24 | 24 | 24 | 25 | -11 | |
p00722 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, n;
while (cin >> a >> b >> n && n) {
int count = 0, flag = 0;
for (int i = a; i < 1000000; i += b) {
for (int j = 2; j < i; j++) {
if (i % j == 0 && i != j) {
flag++;
break;
}
}
if (... | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, n;
while (cin >> a >> b >> n && n) {
int count = 0, flag = 0;
for (int i = a; i <= 1000000; i += b) {
for (int j = 2; j <= sqrt(i); j++) {
if (i % j == 0 && i != j) {
flag++;
break;
}
}
... | replace | 9 | 11 | 9 | 11 | TLE | |
p00722 | C++ | Time Limit Exceeded | #include <iostream>
#include <vector>
using namespace std;
bool isPrime(int x) {
if (x == 1) {
return false;
}
if (x == 2) {
return true;
}
if (x % 2 == 0) {
return false;
}
for (int i = 3; i < x; i += 2) {
if (x % i == 0) {
return false;
}
}
return true;
}
int main() {
... | #include <iostream>
#include <vector>
using namespace std;
bool isPrime(int x) {
if (x == 1) {
return false;
}
if (x == 2) {
return true;
}
if (x % 2 == 0) {
return false;
}
for (int i = 3; i * i <= x; i += 2) {
if (x % i == 0) {
return false;
}
}
return true;
}
int main... | replace | 16 | 17 | 16 | 17 | TLE | |
p00722 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int a[100000] = {0, 0, 1, 1}, n, k = 0;
for (int i = 4; i < 100000; i++) {
for (int j = 2; j * j <= i; j++) {
if (i % j == 0) {
k++;
break;
}
}
if (!k)
a[i]++;
k = 0;
}
int b, c, d, x, s, q;
while (cin >> b... | #include <iostream>
using namespace std;
int main() {
int a[1000000] = {0, 0, 1, 1}, n, k = 0;
for (int i = 4; i < 1000000; i++) {
for (int j = 2; j * j <= i; j++) {
if (i % j == 0) {
k++;
break;
}
}
if (!k)
a[i]++;
k = 0;
}
int b, c, d, x, s, q;
while (cin >>... | replace | 3 | 5 | 3 | 5 | -11 | |
p00722 | C++ | Time Limit Exceeded | // #define _GRIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
vector<int> sieve_of_eratosthenes(int n) {
vector<int> primes(n);
for (int i = 2; i < n; ++i)
primes[i] = i;
for (int i = 2; i * i < n; ++i)
if (primes[i])
for (int j = i * i; j < n; j += i)
prime... | // #define _GRIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
vector<int> sieve_of_eratosthenes(int n) {
vector<int> primes(n);
for (int i = 2; i < n; ++i)
primes[i] = i;
for (int i = 2; i * i < n; ++i)
if (primes[i])
for (int j = i * i; j < n; j += i)
prime... | replace | 26 | 27 | 26 | 27 | TLE | |
p00722 | C++ | Time Limit Exceeded | #include <cstdio>
bool isprime(int n, int k = 2) {
if (n == 1) {
return false;
}
if (n < k * k) {
return true;
}
if (n % k == 0) {
return false;
}
return isprime(n, k + 1);
}
int main() {
int a, d, n, c;
while (true) {
scanf("%d%d%d", &n, &d, &a);
if (n == 0) {
break;
}
... | #include <cstdio>
bool isprime(int n, int k = 2) {
if (n == 1) {
return false;
}
if (n < k * k) {
return true;
}
if (n % k == 0) {
return false;
}
return isprime(n, k + 1);
}
int main() {
int a, d, n, c;
while (true) {
scanf("%d%d%d", &a, &d, &n);
if (n == 0) {
break;
}
... | replace | 16 | 17 | 16 | 17 | TLE | |
p00722 | C++ | Time Limit Exceeded | #include <algorithm>
#include <math.h>
#include <stdio.h>
#include <string.h>
#define MAXNUM 1000000
using namespace std;
int main(void) {
int flag[MAXNUM + 1], a, d, n, i, j, count;
fill(flag, flag + MAXNUM, 1);
flag[0] = flag[1] = 0;
for (i = 2; i <= sqrt((double)MAXNUM); i++) {
if (flag[i]) {
for... | #include <algorithm>
#include <math.h>
#include <stdio.h>
#include <string.h>
#define MAXNUM 1000000
using namespace std;
int main(void) {
int flag[MAXNUM + 1], a, d, n, i, j, count;
fill(flag, flag + MAXNUM, 1);
flag[0] = flag[1] = 0;
for (i = 2; i <= sqrt((double)MAXNUM); i++) {
if (flag[i]) {
for... | insert | 20 | 20 | 20 | 22 | TLE | |
p00722 | C++ | Runtime Error | #include <cmath>
#include <iostream>
#include <vector>
using std::cin;
using std::cout;
using std::endl;
bool is_prime(int n) {
if (n < 2) {
return false;
}
if (n == 2 || n == 3) {
return true;
}
for (int i = 3; i < n; i = i + 2) {
if (n % i == 0) {
return false;
}
}
return true;
}... | #include <cmath>
#include <iostream>
#include <vector>
using std::cin;
using std::cout;
using std::endl;
bool is_prime(int n) {
if (n < 2) {
return false;
}
if (n == 2 || n == 3) {
return true;
}
for (int i = 3; i < n; i = i + 2) {
if (n % i == 0) {
return false;
}
}
return true;
}... | replace | 24 | 25 | 24 | 25 | 0 | |
p00722 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int a = 0, d = 0, n = 0;
int sum = 0;
while (1) {
int count = 0;
cin >> a >> d >> n;
if (a == 0 && d == 0 && n == 0)
break;
sum = a;
while (1) {
if (sum == 2) {
count++;
} else if (sum > 2) {
bool fl... | #include <bits/stdc++.h>
using namespace std;
int main() {
int a = 0, d = 0, n = 0;
int sum = 0;
while (1) {
int count = 0;
cin >> a >> d >> n;
if (a == 0 && d == 0 && n == 0)
break;
sum = a;
while (1) {
if (sum == 2) {
count++;
} else if (sum > 2) {
bool fl... | replace | 18 | 19 | 18 | 21 | TLE | |
p00722 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <iterator>
using namespace std;
struct Fast {
Fast() {
std::cin.tie(0);
ios::sync_with_stdio(false);
}
} fast;
/* cpp template {{{ */
/* short */
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) begin(v),... | #include <bits/stdc++.h>
#include <iterator>
using namespace std;
struct Fast {
Fast() {
std::cin.tie(0);
ios::sync_with_stdio(false);
}
} fast;
/* cpp template {{{ */
/* short */
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) begin(v),... | replace | 108 | 109 | 108 | 109 | TLE | |
p00723 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <set>
#include <string>
using namespace std;
int main(int argc, const char *argv[]) {
int n;
cin >> n;
while (n--) {
set<string> kinds;
string str;
cin >> str;
for (int i = 1; i < str.size(); i++) {
string s1 = str.substr(i), s2 = str.subst... | #include <algorithm>
#include <iostream>
#include <set>
#include <string>
using namespace std;
int main(int argc, const char *argv[]) {
int n;
cin >> n;
while (n--) {
set<string> kinds;
string str;
cin >> str;
for (int i = 1; i < str.size(); i++) {
string s1 = str.substr(i), s2 = str.subst... | replace | 25 | 26 | 25 | 26 | 0 | |
p00723 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define ALL(c) (c).begin(), (c).end()
int main() {
int M;
cin >> M;
while (M--) {
string s;
cin >> s;
vector<string> v;
for (int i = 0; i < (int)s.length() - 1; i++) {
string front = s.substr(... | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define ALL(c) (c).begin(), (c).end()
int main() {
int M;
cin >> M;
while (M--) {
string s;
cin >> s;
vector<string> v;
for (int i = 0; i < (int)s.length() - 1; i++) {
string front = s.substr(... | replace | 38 | 43 | 38 | 44 | 0 | -----
aa
-----
-----
aabb
abab
abba
baab
baba
bbaa
-----
-----
abcd
abdc
adcb
bacd
badc
bcda
cbad
cdab
cdba
dabc
dcab
dcba
-----
-----
abcde
abced
abedc
aedcb
bacde
baedc
bcdea
cbade
cbaed
cdeab
cdeba
dcbae
deabc
decba
eabcd
edabc
edcab
edcba
-----
|
p00723 | C++ | Time Limit Exceeded | #include <iostream>
#define rep(i, n) for (int i = 0; i < n; i++)
int main() {
int n;
char str[500][73];
std::cin >> n;
int strsize;
int moji;
int ans;
rep(h, n) {
std::cin >> str[0];
strsize = 0;
rep(i, 73) {
if (str[0][i] == '\0') {
strsize = i;
break;
}
}
... | #include <iostream>
#define rep(i, n) for (int i = 0; i < n; i++)
int main() {
int n;
char str[500][73];
std::cin >> n;
int strsize;
int moji;
int ans;
rep(h, n) {
std::cin >> str[0];
strsize = 0;
rep(i, 73) {
if (str[0][i] == '\0') {
strsize = i;
break;
}
}
... | replace | 90 | 91 | 90 | 93 | TLE | |
p00723 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(void) {
vector<string> str;
vector<string> ans;
string s[120];
int n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> s[i];
}
for (int k = 0; k < n; k++) {
for (unsigned int i = 0; i < ... | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(void) {
vector<string> str;
vector<string> ans;
string s[120];
int n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> s[i];
}
for (int k = 0; k < n; k++) {
str.clear();
ans.clear();... | insert | 20 | 20 | 20 | 22 | TLE | |
p00724 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
typedef pair<int, int> pii;
#define REP(i, x) for (int i = 0; i < (int)(x); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define FOR(i, c) ... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
typedef pair<int, int> pii;
#define REP(i, x) for (int i = 0; i < (int)(x); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define FOR(i, c) ... | insert | 124 | 124 | 124 | 125 | TLE | |
p00724 | C++ | Runtime Error | #include <cstdio>
#include <cstdlib>
#include <queue>
#include <set>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; ++i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define QCLR(q) \
while (!q.empty()) ... | #include <cstdio>
#include <cstdlib>
#include <queue>
#include <set>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; ++i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define QCLR(q) \
while (!q.empty()) ... | replace | 129 | 130 | 129 | 130 | TLE | |
p00724 | C++ | Runtime Error | #include <cmath>
#include <cstdlib>
#include <exception>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <utility>
#include <vector>
using namespace std;
struct coordinate {
int x, y;
coordinate() {
x = 0;
y = 0;
}
coordinate(int X, int Y) {
x = X;
y = Y;
}
coo... | #include <cmath>
#include <cstdlib>
#include <exception>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <utility>
#include <vector>
using namespace std;
struct coordinate {
int x, y;
coordinate() {
x = 0;
y = 0;
}
coordinate(int X, int Y) {
x = X;
y = Y;
}
coo... | replace | 304 | 308 | 304 | 305 | TLE | |
p00725 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int INF = 1000000000;
#define REP(i, s, n) for (int i = (int)(s); i < (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
typedef vector<int> vec;
typedef vector<vec> mat;
typedef pair<int, int> pint;
const int dx[4] = {0, 1, -1, 0}, dy[4] = {1, 0,... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int INF = 1000000000;
#define REP(i, s, n) for (int i = (int)(s); i < (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
typedef vector<int> vec;
typedef vector<vec> mat;
typedef pair<int, int> pint;
const int dx[4] = {0, 1, -1, 0}, dy[4] = {1, 0,... | replace | 14 | 15 | 14 | 15 | TLE | |
p00725 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
using namespace std;
int w, h;
int ans;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
bool canmove(int x, int y) { return (0 <= x && x < w && 0 <= y && y < h); }
struct Map {
int map[20][20];
int s, g;
int cnt;
int cur;
Map(int m[20][20]) {
for (int i = ... | #include <algorithm>
#include <iostream>
using namespace std;
int w, h;
int ans;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
bool canmove(int x, int y) { return (0 <= x && x < w && 0 <= y && y < h); }
struct Map {
int map[20][20];
int s, g;
int cnt;
int cur;
Map(int m[20][20]) {
for (int i = ... | insert | 77 | 77 | 77 | 79 | TLE | |
p00725 | C++ | Time Limit Exceeded | #include <iostream>
#define MAX 1000000000
using namespace std;
int w, h;
int dx[] = {1, -1, 0, 0}, dy[] = {0, 0, -1, 1};
int func(int y, int x, int now, int tab[][20]) {
int ans = MAX, nx, ny;
for (int i = 0; i < 4; i++) {
nx = dx[i] + x;
ny = dy[i] + y;
if (nx >= 0 && nx < w && ny >= 0 && ny < h && ta... | #include <iostream>
#define MAX 1000000000
using namespace std;
int w, h;
int dx[] = {1, -1, 0, 0}, dy[] = {0, 0, -1, 1};
int func(int y, int x, int now, int tab[][20]) {
if (now > 10)
return MAX;
int ans = MAX, nx, ny;
for (int i = 0; i < 4; i++) {
nx = dx[i] + x;
ny = dy[i] + y;
if (nx >= 0 && n... | insert | 6 | 6 | 6 | 8 | TLE | |
p00725 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <vector>
// 0 : space 1 : twall 2 : start 3 : goal 4 : wall
int board[32][32];
int W, H;
void init() {
for (int i = 0; i < (in... | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <vector>
// 0 : space 1 : twall 2 : start 3 : goal 4 : wall
int board[32][32];
int W, H;
void init() {
for (int i = 0; i < (in... | replace | 47 | 48 | 47 | 48 | TLE | |
p00725 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define foreach(itr, a) \
for (__typeof((a).begin()) itr = (a).begin(); itr != (a).end(); itr++)
#define ALL(... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define foreach(itr, a) \
for (__typeof((a).begin()) itr = (a).begin(); itr != (a).end(); itr++)
#define ALL(... | replace | 60 | 61 | 60 | 61 | TLE | |
p00725 | C++ | Memory Limit Exceeded | #include <algorithm>
#include <cstring>
#include <iostream>
#include <queue>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
int w, h;
struct t_node {
int f[20][20];
int x, y;
int d;
t_node() { d = 0; }
t_node(c... | #include <algorithm>
#include <cstring>
#include <iostream>
#include <queue>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
int w, h;
struct t_node {
short f[20][20];
int x, y;
int d;
t_node() { d = 0; }
t_node... | replace | 15 | 16 | 15 | 16 | MLE | |
p00725 | C++ | Memory Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef vector<int> Vi;
typedef tuple<int, int, int> T;
#define FOR(i, s, x) for (int i = s; i < (int)(x); i++)
#define REP(i, x) FOR(i, 0, x)
#define ALL(c) c.begin(), c.end()
#define DUMP(x) ce... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef vector<int> Vi;
typedef tuple<int, int, int> T;
#define FOR(i, s, x) for (int i = s; i < (int)(x); i++)
#define REP(i, x) FOR(i, 0, x)
#define ALL(c) c.begin(), c.end()
#define DUMP(x) ce... | replace | 51 | 52 | 51 | 52 | MLE | |
p00725 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <... | #include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <... | replace | 76 | 77 | 76 | 77 | TLE | |
p00725 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
typedef long long LL;
#define SORT(c) sort((c).begin(), (c).end())
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
using namespace std;
int dx[4] = {0, 0, -1, 1}, dy[4] = {-1, 1, 0, 0};
int solve(vector<vector<int>> field, int h, int w, int y, int x, int st... | #include <bits/stdc++.h>
typedef long long LL;
#define SORT(c) sort((c).begin(), (c).end())
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
using namespace std;
int dx[4] = {0, 0, -1, 1}, dy[4] = {-1, 1, 0, 0};
int solve(vector<vector<int>> field, int h, int w, int y, int x, int st... | replace | 10 | 11 | 10 | 11 | TLE | |
p00725 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctype.h>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
using namespace std;
int w, h;
int board[21][21];
int tesu[21][21];
int dx[4] = {1,... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctype.h>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
using namespace std;
int w, h;
int board[21][21];
int tesu[21][21];
int dx[4] = {1,... | insert | 24 | 24 | 24 | 26 | TLE | |
p00725 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cassert>
#include <cmath>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef pair<int, int> pi;
#define MK make_pair
#define F first
#define S second
int a[50][50];
const... | #include <algorithm>
#include <cassert>
#include <cmath>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef pair<int, int> pi;
#define MK make_pair
#define F first
#define S second
int a[50][50];
const... | insert | 99 | 99 | 99 | 102 | TLE | |
p00725 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
int w, h;
int sx, sy;
int res;
int table[30]... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
int w, h;
int sx, sy;
int res;
int table[30]... | replace | 71 | 72 | 71 | 72 | TLE | |
p00725 | C++ | Time Limit Exceeded | #include <cstdio>
#include <vector>
using namespace std;
#define MAX_H 20
#define MAX_W 20
#define INF (1 << 28)
int w, h;
int F[MAX_H][MAX_W];
int G[MAX_H][MAX_W];
int gy, gx;
int y, x;
int py, px;
void debug();
const int dy[] = {1, 0, -1, 0};
const int dx[] = {0, 1, 0, -1};
void move(int d) {
// printf(" %... | #include <cstdio>
#include <vector>
using namespace std;
#define MAX_H 20
#define MAX_W 20
#define INF (1 << 28)
int w, h;
int F[MAX_H][MAX_W];
int G[MAX_H][MAX_W];
int gy, gx;
int y, x;
int py, px;
void debug();
const int dy[] = {1, 0, -1, 0};
const int dx[] = {0, 1, 0, -1};
void move(int d) {
// printf(" %... | replace | 71 | 72 | 71 | 72 | TLE | |
p00725 | C++ | Runtime Error | #include <stdio.h>
#include <string.h>
int gx, gy, h, w;
int cost[20][20];
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
void solve(int x, int y, int field[20][20]) {
static int count = 0;
int i, j, flag;
if (cost[y][x] > count || cost[y][x] == -1) {
cost[y][x] = count;
if (field[y][x] == 3)
... | #include <stdio.h>
#include <string.h>
int gx, gy, h, w;
int cost[20][20];
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
void solve(int x, int y, int field[20][20]) {
static int count = 0;
int i, j, flag;
if (cost[y][x] > count || cost[y][x] == -1) {
cost[y][x] = count;
if (field[y][x] == 3)
... | replace | 26 | 27 | 26 | 27 | 0 | |
p00725 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int w, h;
int sx, sy;
int ans = 100;
bool outofrange(int y, int x) {
if (y < 0 || y >= h || x < 0 || x >= w) {
return true;
} else {
return false;
}
}
void dfs(vector<vect... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int w, h;
int sx, sy;
int ans = 100;
bool outofrange(int y, int x) {
if (y < 0 || y >= h || x < 0 || x >= w) {
return true;
} else {
return false;
}
}
void dfs(vector<vect... | replace | 20 | 21 | 20 | 21 | TLE | |
p00725 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-10)
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
struct st {
int f[20][20], cnt, x, y, id;
};
int dx[]{1, -1, 0, 0}, dy[]{0, 0, ... | #include <bits/stdc++.h>
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-10)
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
struct st {
int f[20][20], cnt, x, y, id;
};
int dx[]{1, -1, 0, 0}, dy[]{0, 0, ... | replace | 44 | 45 | 44 | 45 | TLE | |
p00725 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; i++)
con... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; i++)
con... | replace | 55 | 56 | 55 | 56 | TLE | |
p00725 | C++ | Memory Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
#define rep(i, n) for (int i = 0; i < n; i++)
#define range(i, a, n) for (int i = a; i < n; i++)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<bool>;
using vvi = vector<vi>;
using pii = pair<int, int>;
#define rep(i, n) for (int i = 0; i < n; i++)
#define range(i, a, n) for (int i = a; i < n; i++)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define... | replace | 3 | 4 | 3 | 4 | MLE | |
p00726 | C++ | Runtime Error | #include <algorithm>
#include <cctype>
#include <iostream>
#include <string>
#define range(i, a, b) for (int(i) = a; (i) < (b); (i)++)
#define rep(i, n) range(i, 0, n)
using namespace std;
const int imax = 1234567;
int n;
string S;
size_t cur = 0;
int digit();
int number();
string expression();
int digit() { retu... | #include <algorithm>
#include <cctype>
#include <iostream>
#include <string>
#define range(i, a, b) for (int(i) = a; (i) < (b); (i)++)
#define rep(i, n) range(i, 0, n)
using namespace std;
const int imax = 1234567;
int n;
string S;
size_t cur = 0;
int digit();
int number();
string expression();
int digit() { retu... | replace | 73 | 74 | 73 | 74 | 0 | |
p00726 | C++ | Runtime Error | #include <iostream>
using namespace std;
typedef long long ll;
string str;
int pos;
int loc;
ll now;
int number() {
int res = 0;
while (pos < str.size() && isdigit(str[pos])) {
res = res * 10 + (int)(str[pos] - '0');
++pos;
}
return res;
}
string alp() {
string res = "";
while (pos < str.size() ... | #include <iostream>
using namespace std;
typedef long long ll;
string str;
int pos;
int loc;
ll now;
int number() {
int res = 0;
while (pos < str.size() && isdigit(str[pos])) {
res = res * 10 + (int)(str[pos] - '0');
++pos;
}
return res;
}
string alp() {
string res = "";
while (pos < str.size() ... | replace | 72 | 73 | 72 | 81 | 0 | |
p00726 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define reps(i, j, k) for (int i = j; i < k; i++)
#define rep(i, j) reps(i, 0, j)
#define InumF 1 << 30
#define fr first
#define sc second
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
typedef pair<int, int> Pii;
int main() {
string str;
int n;
whil... | #include <bits/stdc++.h>
using namespace std;
#define reps(i, j, k) for (int i = j; i < k; i++)
#define rep(i, j) reps(i, 0, j)
#define InumF 1 << 30
#define fr first
#define sc second
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
typedef pair<int, int> Pii;
int main() {
string str;
int n;
whil... | replace | 33 | 35 | 33 | 35 | 0 | |
p00726 | C++ | Memory Limit Exceeded | #include "bits/stdc++.h"
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
#define dump(x) cerr << #x << " = " << (x) << endl
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(a) (a).begin(), (a).end()
#define pb push_back
// string solve(int times,string s){
/... | #include "bits/stdc++.h"
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
#define dump(x) cerr << #x << " = " << (x) << endl
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(a) (a).begin(), (a).end()
#define pb push_back
// string solve(int times,string s){
/... | replace | 133 | 135 | 133 | 138 | MLE | |
p00726 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using P = pair<int, char>;
string S;
int n, it;
int num() {
int res = 0;
while (it < n && isdigit(S[it])) {
res = res * 10 + S[it] - '0';
it++;
}
return res;
}
P parser(int t) {
P res(0, '0');
while (it < n && S[it] != ')') {
if (isdigit(S[it])) {... | #include <bits/stdc++.h>
using namespace std;
using P = pair<int, char>;
string S;
int n, it;
int num() {
int res = 0;
while (it < n && isdigit(S[it])) {
res = res * 10 + S[it] - '0';
it++;
}
return res;
}
P parser(int t) {
P res(0, '0');
while (it < n && S[it] != ')') {
if (isdigit(S[it])) {... | insert | 32 | 32 | 32 | 33 | 0 | |
p00726 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
string s;
const int MAX = 1e6 + 1;
typedef long long Int;
Int cnt(int &p);
Int get_num(int &p) {
int res = 0;
while (isdigit(s[p])) {
res *= 10;
res += (s[p] - '0');
p++;
}
return res;
}
Int cnt_large(int &p) {
Int res = 0;
while (s[p] != ')') {
... | #include <bits/stdc++.h>
using namespace std;
string s;
const int MAX = 1e6 + 1;
typedef long long Int;
Int cnt(int &p);
Int get_num(int &p) {
int res = 0;
while (isdigit(s[p])) {
res *= 10;
res += (s[p] - '0');
p++;
}
return res;
}
Int cnt_large(int &p) {
Int res = 0;
while (s[p] != ')') {
... | replace | 25 | 26 | 25 | 26 | 0 | |
p00728 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
int n;
int main() {
int ave;
while (cin >> n) {
int a[20];
int sum = 0;
for (int i = 0; i <= n - 1; i++) {
cin >> a[i];
}
sort(a, a + n);
for (int j = 1; j <= n - 2; j++) {
sum += a[j];
}
ave... | #include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
int n;
int main() {
int ave;
while (cin >> n && (n > 0)) {
int a[100];
int sum = 0;
for (int i = 0; i <= n - 1; i++) {
cin >> a[i];
}
sort(a, a + n);
for (int j = 1; j <= n - 2; j++) {
sum += a[j];
... | replace | 9 | 11 | 9 | 11 | 0 | |
p00728 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <vector>
#define REP(i, n) for (int i = 0; i < (n); i++)
using namespace std;
int main() {
vector<int> vc;
int n;
while (cin >> n) {
int tmp;
vc.clear();
REP(i, n) {
cin >> tmp;
vc.push_back(tmp);
}
sort(vc.begin(), vc.end());
... | #include <algorithm>
#include <iostream>
#include <vector>
#define REP(i, n) for (int i = 0; i < (n); i++)
using namespace std;
int main() {
vector<int> vc;
int n;
while (cin >> n) {
if (n == 0)
break;
int tmp;
vc.clear();
REP(i, n) {
cin >> tmp;
vc.push_back(tmp);
}
s... | insert | 12 | 12 | 12 | 14 | -11 | |
p00728 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int n, s;
while (cin >> n && n > 0) {
int large = 0;
int small = 1000;
int sum = 0;
for (int i = 0; i > n; ++i) {
cin >> s;
sum = sum + s;
if (large < s) {
large = s;
}
if (small > s) {
small = s;
... | #include <iostream>
using namespace std;
int main() {
int n, s;
while (cin >> n && n > 0) {
int large = 0;
int small = 1000;
int sum = 0;
for (int i = 0; i < n; ++i) {
cin >> s;
sum = sum + s;
if (large < s) {
large = s;
}
if (small > s) {
small = s;
... | replace | 10 | 11 | 10 | 11 | 0 | |
p00728 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
int a[20];
int b, sum = 0, point;
while (1) {
cin >> b;
if (b == 0)
break;
for (int i = 0; i < b; i++) {
cin >> a[i];
}
sort(a, a + b);
for (int j = 1; j < b - 1; j++) {
sum += ... | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
int a[100];
int b, sum = 0, point;
while (1) {
cin >> b;
if (b == 0)
break;
for (int i = 0; i < b; i++) {
cin >> a[i];
}
sort(a, a + b);
for (int j = 1; j < b - 1; j++) {
sum +=... | replace | 7 | 8 | 7 | 8 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.