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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p00296 | C++ | Runtime Error | #include <algorithm>
#include <stdio.h>
using namespace std;
int v[110000];
int L[110000];
int R[110000];
int main() {
int a, b, c;
scanf("%d%d%d", &a, &b, &c);
for (int i = 0; i < a; i++) {
v[i] = 1;
L[i] = (i + a - 1) % a;
R[i] = (i + 1) % a;
}
int now = 0;
for (int i = 0; i < b; i++) {
in... | #include <algorithm>
#include <stdio.h>
using namespace std;
int v[210000];
int L[210000];
int R[210000];
int main() {
int a, b, c;
scanf("%d%d%d", &a, &b, &c);
for (int i = 0; i < a; i++) {
v[i] = 1;
L[i] = (i + a - 1) % a;
R[i] = (i + 1) % a;
}
int now = 0;
for (int i = 0; i < b; i++) {
in... | replace | 3 | 6 | 3 | 6 | 0 | |
p00296 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, j, k) for (int i = (int)j; i < (int)k; i++)
#define itrep(i, x) for (auto i = (x).begin(); i != (x).end(); i++)
#define Sort(x) sort((x).begin(), (x).end())
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define vi vector<int>
#define INF (int)1e9
#defin... | #include <bits/stdc++.h>
#define rep(i, j, k) for (int i = (int)j; i < (int)k; i++)
#define itrep(i, x) for (auto i = (x).begin(); i != (x).end(); i++)
#define Sort(x) sort((x).begin(), (x).end())
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define vi vector<int>
#define INF (int)1e9
#defin... | replace | 32 | 34 | 32 | 36 | TLE | |
p00296 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
int a[200000];
int q[1000];
int f[200000];
int main() {
int n, m, Q;
scanf("%d%d%d", &n, &m, &Q);
memset(f, 0, sizeof(f));
REP(i, m) scanf("%d", a + i);
REP(i, Q) scanf("%d", q + i);
list<int> ls;
REP(i, n)... | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
int a[200000];
int q[1000];
int f[200000];
int main() {
int n, m, Q;
scanf("%d%d%d", &n, &m, &Q);
memset(f, 0, sizeof(f));
REP(i, m) scanf("%d", a + i);
REP(i, Q) scanf("%d", q + i);
list<int> ls;
REP(i, n)... | replace | 17 | 18 | 17 | 18 | TLE | |
p00296 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
list<int> L;
signed main() {
int a, b, c;
cin >> a >> b >> c;
for (int d = 0; d < a; d++) {
L.push_back(d);
}
auto f = L.begin();
for (int d = 0; d < b; d++) {
int e;
scanf("%d", &e);
for (int g = 0; g < e; g++) {
if (e & 1) {
if (... | #include <bits/stdc++.h>
using namespace std;
list<int> L;
signed main() {
int a, b, c;
cin >> a >> b >> c;
for (int d = 0; d < a; d++) {
L.push_back(d);
}
auto f = L.begin();
for (int d = 0; d < b; d++) {
int e;
scanf("%d", &e);
for (int g = 0; g < e; g++) {
if (e & 1) {
if (... | insert | 27 | 27 | 27 | 29 | -11 | |
p00297 | C++ | Time Limit Exceeded | #include "climits"
#include "stdio.h"
#define MAX 200000
int star;
int dif;
int box_x[MAX];
int x[MAX];
int y[MAX];
int box_y[MAX];
int blight[MAX];
int box[MAX];
int end[MAX] = {};
int x_max = 0;
int x_min = INT_MAX;
int y_max = 0;
int y_min = INT_MAX;
int child;
int fig = 1;
int RMinQx[MAX * 4];
int RMinQy[MAX * 4];
... | #include "climits"
#include "stdio.h"
#define MAX 200000
int star;
int dif;
int box_x[MAX];
int x[MAX];
int y[MAX];
int box_y[MAX];
int blight[MAX];
int box[MAX];
int end[MAX] = {};
int x_max = 0;
int x_min = INT_MAX;
int y_max = 0;
int y_min = INT_MAX;
int child;
int fig = 1;
int RMinQx[MAX * 4];
int RMinQy[MAX * 4];
... | replace | 163 | 164 | 163 | 164 | TLE | |
p00297 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <limits.h>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
#define N 200000
#define F first
#define S second
#define MP(i, j) make_pair((i), (j))
#define int long long
typedef pair<int, int> P;
typedef pair<int, P> Pi;
int cn... | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <limits.h>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
#define N 200000
#define F first
#define S second
#define MP(i, j) make_pair((i), (j))
#define int long long
typedef pair<int, int> P;
typedef pair<int, P> Pi;
int cn... | replace | 43 | 44 | 43 | 44 | 0 | |
p00297 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#define INF 1000000000
#define f first
#define s second
using namespace std;
typedef pair<int, pair<int, int>> P;
typedef long long ll;
int n, d, tree[4][(1 << 19)];
P star[200001];
void update(int i, int flg, int x) {
i = i + (1 << 18) - 1;
tree[flg][i] = x;
while (i) {
... | #include <algorithm>
#include <iostream>
#define INF 1000000000
#define f first
#define s second
using namespace std;
typedef pair<int, pair<int, int>> P;
typedef long long ll;
int n, d, tree[4][(1 << 19)];
P star[200001];
void update(int i, int flg, int x) {
i = i + (1 << 18) - 1;
tree[flg][i] = x;
while (i) {
... | replace | 51 | 52 | 51 | 52 | -11 | |
p00297 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define fr first
#define sc second
#define Rep(i, n) for (int i = 0; i < (n); i++)
#define Rrep(i, m, n) for (int i = (m); i < (n); i++)
#define All(v) v.begin(), v.end()
#define Uniq(v) v.erase(unique(All(v)), ... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define fr first
#define sc second
#define Rep(i, n) for (int i = 0; i < (n); i++)
#define Rrep(i, m, n) for (int i = (m); i < (n); i++)
#define All(v) v.begin(), v.end()
#define Uniq(v) v.erase(unique(All(v)), ... | replace | 18 | 19 | 18 | 19 | 0 | |
p00297 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
struct SegTree {
static const int N = 1 << 18;
int *dat;
SegTree() {
dat = new int[N * 2 - 1];
for (int i = 0; i < N * 2 - 1; i++)
dat[i] = INT_MAX;
}
void update(int k, int x) {
k += N - 1;
dat[k] = min(dat[k], x);
while (k) {
k... | #include <bits/stdc++.h>
using namespace std;
struct SegTree {
static const int N = 1 << 18;
int *dat;
SegTree() {
dat = new int[N * 2 - 1];
for (int i = 0; i < N * 2 - 1; i++)
dat[i] = INT_MAX;
}
void update(int k, int x) {
k += N - 1;
dat[k] = min(dat[k], x);
while (k) {
k... | replace | 25 | 26 | 25 | 26 | TLE | |
p00298 | C++ | Runtime Error | #include <bits/stdc++.h>
#define REP(i, a, n) for (ll i = ((ll)a); i < ((ll)n); i++)
#define INF (1LL << 60)
using namespace std;
typedef long long ll;
ll N, C[2000], W[2000];
ll sum[2000], memo[2000][2000];
struct edge {
ll v, dist;
};
struct state {
ll v, cost;
bool operator>(const state s) const { return c... | #include <bits/stdc++.h>
#define REP(i, a, n) for (ll i = ((ll)a); i < ((ll)n); i++)
#define INF (1LL << 60)
using namespace std;
typedef long long ll;
ll N, C[2000], W[2000];
ll sum[2000], memo[2000][2000];
struct edge {
ll v, dist;
};
struct state {
ll v, cost;
bool operator>(const state s) const { return c... | replace | 67 | 70 | 67 | 70 | 0 | |
p00298 | C++ | Runtime Error | #include "bits/stdc++.h"
#define REP(i, n, N) for (int i = (n); i < (N); i++)
#define RREP(i, n, N) for (ll i = (N - 1); i >= n; i--)
#define CK(n, a, b) ((a) <= (n) && (n) < (b))
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout << (s) << endl
#define p2(a, b) cout << (a) << " " << (b) << endl
#define v2(T) vect... | #include "bits/stdc++.h"
#define REP(i, n, N) for (int i = (n); i < (N); i++)
#define RREP(i, n, N) for (ll i = (N - 1); i >= n; i--)
#define CK(n, a, b) ((a) <= (n) && (n) < (b))
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout << (s) << endl
#define p2(a, b) cout << (a) << " " << (b) << endl
#define v2(T) vect... | replace | 13 | 14 | 13 | 14 | 0 | |
p00299 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
template <typename T> struct edge {
int src, to;
T cost;
edge(int to, T cost) : src(-1), to(to), cost(cost) {}
edge(int src, int to, T cost) : src(src), to(to), cost(cost) {}
edge &operator=(const int &x) {
to = x;
return *this;
}
operator int() ... | #include <bits/stdc++.h>
using namespace std;
template <typename T> struct edge {
int src, to;
T cost;
edge(int to, T cost) : src(-1), to(to), cost(cost) {}
edge(int src, int to, T cost) : src(src), to(to), cost(cost) {}
edge &operator=(const int &x) {
to = x;
return *this;
}
operator int() ... | insert | 95 | 95 | 95 | 97 | 0 | |
p00302 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<pint> vpint;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, f, n) for (int i = (f); i < (n); i++)
#define all(v) (v).begin(), (v).end()
#define each(it, v) ... | #include <bits/stdc++.h>
using namespace std;
#define int long long
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<pint> vpint;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, f, n) for (int i = (f); i < (n); i++)
#define all(v) (v).begin(), (v).end()
#define each(it, v) ... | replace | 29 | 30 | 29 | 30 | 0 | |
p00303 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
bool dfs(int v, int const s, vector<vector<int>> const &es,
vector<bool> &visited) {
visited[v] = true;
bool res = false;
for (auto &u : es[v]) {
if (!visited[u]) {
res |= dfs(u, s, es, visited);
} else if (visited[v] && u == s) {
res = t... | #include <bits/stdc++.h>
using namespace std;
bool dfs(int v, int const s, vector<vector<int>> const &es,
vector<bool> &visited) {
visited[v] = true;
bool res = false;
for (auto &u : es[v]) {
if (!visited[u]) {
res |= dfs(u, s, es, visited);
} else if (visited[v] && u == s) {
res = t... | replace | 21 | 22 | 21 | 22 | 0 | |
p00303 | C++ | Runtime Error | #define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <numer... | #define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <numer... | insert | 93 | 93 | 93 | 95 | 0 | |
p00303 | C++ | Runtime Error | #include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;
vector<int> G[240];
int dist[240];
int main() {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
int a, b;
string S;
cin >> a >> S >> b;
a--;
b--;
if (S == "wait") {
G[a].push_back(b + 120);
... | #include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;
vector<int> G[240];
int dist[240];
int main() {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
int a, b;
string S;
cin >> a >> S >> b;
a--;
b--;
if (S == "wait") {
G[a].push_back(b + 120);
... | replace | 24 | 25 | 24 | 25 | 0 | |
p00303 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define PB push_back
#define MP make_pair
typedef pair<int, int> pii;
int n;
vector<int> rods[200];
bool visited[200];
int nw;
bool chk(int pl) {
visited[pl] = true;
REP(i, rods[pl].size... | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define PB push_back
#define MP make_pair
typedef pair<int, int> pii;
int n;
vector<int> rods[200];
bool visited[200];
int nw;
bool chk(int pl) {
visited[pl] = true;
REP(i, rods[pl].size... | replace | 42 | 43 | 42 | 43 | 0 | |
p00303 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
vector<int> g[200];
int main() {
int n;
cin >> n;
REP(i, n) {
int a, b;
string str;
... | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
vector<int> g[200];
int main() {
int n;
cin >> n;
REP(i, n) {
int a, b;
string str;
... | replace | 32 | 33 | 32 | 33 | 0 | |
p00305 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstring>
#include <iostream>
using namespace std;
int k[1000][1000], x[1000][1000], n, cnt, maxn = -10000000;
int main() {
cin >> n;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
scanf("%d", &k[i][j]);
}
}
for (int i = 1; i <= n; i++) {
cnt = 0;
... | #include <algorithm>
#include <cstring>
#include <iostream>
using namespace std;
int k[1000][1000], x[1000][1000], n, cnt, maxn = -10000000;
int main() {
cin >> n;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
scanf("%d", &k[i][j]);
}
}
for (int i = 1; i <= n; i++) {
cnt = 0;
... | replace | 39 | 44 | 39 | 46 | TLE | |
p00305 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int p[333][333];
int yoko[333][333];
int tate[333][333];
int dp[301][301][301];
signed main() {
int n;
cin >> n;
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
cin >> p[i][j];
for (int i = 0; i < n; i++) {
int sum = 0;
for (int j = 0; ... | #include <bits/stdc++.h>
using namespace std;
int p[333][333];
int yoko[333][333];
int tate[333][333];
int dp[301][301][301];
signed main() {
int n;
cin >> n;
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
cin >> p[i][j];
for (int i = 0; i < n; i++) {
int sum = 0;
for (int j = 0; ... | replace | 29 | 30 | 29 | 30 | -11 | |
p00305 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typede... | #include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typede... | delete | 61 | 66 | 61 | 61 | -11 | |
p00306 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <complex>
#include <iomanip>
#include <iostream>
#include <utility>
#include <vector>
using namespace std;
const double EPS = 1e-10;
const double INF = 1e12;
const double PI = acos(-1);
struct Point {
double x, y, z;
Point(double x, double y, double z) : x(x), y(y), z... | #include <algorithm>
#include <cmath>
#include <complex>
#include <iomanip>
#include <iostream>
#include <utility>
#include <vector>
using namespace std;
const double EPS = 1e-10;
const double INF = 1e12;
const double PI = acos(-1);
struct Point {
double x, y, z;
Point(double x, double y, double z) : x(x), y(y), z... | replace | 84 | 85 | 84 | 85 | TLE | |
p00314 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> p(N);
for (int &t : p)
cin >> t;
for (int A = 100; A >= 0; A--) {
int c = 0;
for (int t : p)
if (t >= A)
c++;
if (c >= A) {
cout << A << endl;
break;
}
}
} | #include <iostream>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> p(N);
for (int &t : p)
cin >> t;
for (int A = 100; A >= 0; A--) {
int c = 0;
for (int t : p)
if (t >= A)
c++;
if (c >= A) {
cout << A << endl;
break;
}
}
ret... | insert | 21 | 21 | 21 | 22 | 0 | |
p00314 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using LL = long long;
int main() {
int n;
cin >> n;
vector<int> vec;
int ma = 0;
for (int a = 0; a < n; a++) {
int b;
cin >> b;
vec.push_back(b);
ma = max(ma, b);
}
for (int a = ma; a >= 0; a--) {
int ins = 0;
for (int b = 0; b < n; b+... | #include <bits/stdc++.h>
using namespace std;
using LL = long long;
int main() {
int n;
cin >> n;
vector<int> vec;
int ma = 0;
for (int a = 0; a < n; a++) {
int b;
cin >> b;
vec.push_back(b);
ma = max(ma, b);
}
for (int a = ma; a >= 0; a--) {
int ins = 0;
for (int b = 0; b < n; b+... | replace | 24 | 25 | 24 | 25 | 4 | |
p00316 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define pb push_back
#define rep(i, a, n) for (int i = (a); i < (n); i++)
#define dep(i, a, n) for (int i = (a); i >= (n); i--)
#define mod 1e9 + 7
__attribute__((constructor)) void initial() {
cin.tie(0);
ios::sync_wit... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define pb push_back
#define rep(i, a, n) for (int i = (a); i < (n); i++)
#define dep(i, a, n) for (int i = (a); i >= (n); i--)
#define mod 1e9 + 7
__attribute__((constructor)) void initial() {
cin.tie(0);
ios::sync_wit... | replace | 55 | 56 | 55 | 56 | 0 | |
p00317 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
// #include<chrono>
#include <random>
using namespace std;
typedef long long int lli... | #include <algorithm>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
// #include<chrono>
#include <random>
using namespace std;
typedef long long int lli... | replace | 87 | 88 | 87 | 89 | 0 | |
p00317 | C++ | Memory Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define dbg(...) \
do { \
cerr << __LINE__ <<... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define dbg(...) \
do { \
cerr << __LINE__ <<... | insert | 141 | 141 | 141 | 142 | MLE | |
p00317 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> T;
const int mod1 = 1000000007;
const int base1 = 1009;
const int mod2 = 1000000007;
const int base2 = 1007;
int N, M;
char s[100000][201];
char d[100000][201];
int ans[100000];
bool rev[100000];
map<pair<int, int>, int> hash1[200];
set<pair<int,... | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> T;
const int mod1 = 1000000007;
const int base1 = 1009;
const int mod2 = 1000000007;
const int base2 = 1007;
int N, M;
char s[100000][201];
char d[100000][201];
int ans[100000];
bool rev[100000];
map<pair<int, int>, int> hash1[200];
set<pair<int,... | replace | 56 | 57 | 56 | 57 | TLE | |
p00317 | 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 | 19 | 20 | 19 | 20 | 0 | |
p00317 | C++ | Memory Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for (int64 i = 0; i < (n); i++)
#define FOR(i, a, b) for (int64 i = (a); i < (b); i++)
#define all(x) x.begin(), x.end()
#define fs first
#define sc second
using int32 = int_fast32_t;
using uint32 = uint_... | #include <bits/stdc++.h>
using namespace std;
#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for (int64 i = 0; i < (n); i++)
#define FOR(i, a, b) for (int64 i = (a); i < (b); i++)
#define all(x) x.begin(), x.end()
#define fs first
#define sc second
using int32 = int_fast32_t;
using uint32 = uint_... | replace | 49 | 50 | 49 | 51 | MLE | |
p00318 | C++ | Time Limit Exceeded | #include "bits/stdc++.h"
#include <unordered_map>
#include <unordered_set>
#pragma warning(disable : 4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;
//// < "d:\d_download\visual studio
///2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual
///studio 2015\projects\programin... | #include "bits/stdc++.h"
#include <unordered_map>
#include <unordered_set>
#pragma warning(disable : 4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;
//// < "d:\d_download\visual studio
///2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual
///studio 2015\projects\programin... | replace | 47 | 48 | 47 | 48 | TLE | |
p00318 | C++ | Time Limit Exceeded | // 2分探索, 座標圧縮的な何か, imos法
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <vector>
#define rep(i, n) for (i = 0; i < n; i++)
using namespace std;
int n;
double x[100000], r[100000];
bool check(double y) {
int i;
vector<double> vec;
static int imos[200001];
rep(i, n) {
... | // 2分探索, 座標圧縮的な何か, imos法
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <vector>
#define rep(i, n) for (i = 0; i < n; i++)
using namespace std;
int n;
double x[100000], r[100000];
bool check(double y) {
int i;
vector<double> vec;
static int imos[200001];
rep(i, n) {
... | replace | 49 | 50 | 49 | 50 | TLE | |
p00321 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, ans = 0;
string t;
cin >> n >> m;
vector<int> a(n);
vector<string> s(0);
vector<vector<string>> u(n, vector<string>(0));
for (int i = 0; i < n; i++) {
cin >> a.at(i);
for (int j = 0; j < a.at(i); j++) {
int y = 0;
ci... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, ans = 0;
string t;
cin >> n >> m;
vector<int> a(n);
vector<string> s(0);
vector<vector<string>> u(n, vector<string>(0));
for (int i = 0; i < n; i++) {
cin >> a.at(i);
for (int j = 0; j < a.at(i); j++) {
int y = 0;
ci... | replace | 43 | 47 | 43 | 49 | TLE | |
p00321 | C++ | Runtime Error | #include <iostream>
using namespace std;
// include
//------------------------------------------
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
// math
... | #include <iostream>
using namespace std;
// include
//------------------------------------------
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
// math
... | replace | 83 | 84 | 83 | 84 | 0 | |
p00321 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
int main() {
int n, f;
int num = 0;
map<string, int> mp;
int con[1001][1001] = {};
cin >> n >> f;
string str[1001];
for (int i = 0; i < n; i++) {
int m;
cin >> m;
vector<string> it(... | #include <algorithm>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
int main() {
int n, f;
int num = 0;
map<string, int> mp;
int con[1001][1001] = {};
cin >> n >> f;
string str[1001];
for (int i = 0; i < n; i++) {
int m;
cin >> m;
vector<string> it(... | replace | 40 | 41 | 40 | 41 | 0 | |
p00323 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#define INF 210000
using namespace std;
int c[INF];
int main() {
int n, a, b;
for (int i = 0; i < INF; i++)
c[i] = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a >> b;
c[a + b]++;
}
for (int i = 0; i < INF; i++) {
c[i + 1] += c[i] / 2;
if (c[... | #include <algorithm>
#include <iostream>
#define INF 210000
using namespace std;
int c[INF];
int main() {
int n, a, b;
for (int i = 0; i < INF; i++)
c[i] = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a >> b;
c[a + b]++;
}
for (int i = 0; i < INF - 1; i++) {
c[i + 1] += c[i] / 2;
if... | replace | 14 | 15 | 14 | 15 | 0 | |
p00324 | C++ | Time Limit Exceeded | #include <algorithm>
#include <array>
#include <cstdint>
#include <functional>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string>
#include <utility>
#include <vector>
#define INF 1000000000
#define MOD 1000000007
#define rep(i, a, b) for (uint32 i... | #include <algorithm>
#include <array>
#include <cstdint>
#include <functional>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string>
#include <utility>
#include <vector>
#define INF 1000000000
#define MOD 1000000007
#define rep(i, a, b) for (uint32 i... | replace | 44 | 45 | 44 | 45 | TLE | |
p00324 | C++ | Time Limit Exceeded | #include <algorithm>
#include <array>
#include <cstdint>
#include <functional>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string>
#include <utility>
#include <vector>
#define INF 1000000000
#define MOD 1000000007
#define rep(i, a, b) for (uint32 i... | #include <algorithm>
#include <array>
#include <cstdint>
#include <functional>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string>
#include <utility>
#include <vector>
#define INF 1000000000
#define MOD 1000000007
#define rep(i, a, b) for (uint32 i... | replace | 108 | 109 | 108 | 109 | TLE | |
p00325 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
struct cmd {
int line;
string p;
vector<string> v;
};
vector<cmd> A;
map<int, int> idx;
map<string, int> var;
bool isNum(const string &a) { return isdigit(a[0]); }
int StoI(const string &a) {
int res = 0;
for (int i = 0; i < a.size(); i++)
res = res * 10 + a... | #include <bits/stdc++.h>
using namespace std;
struct cmd {
int line;
string p;
vector<string> v;
};
vector<cmd> A;
map<int, int> idx;
map<string, int> var;
bool isNum(const string &a) { return isdigit(a[0]); }
int StoI(const string &a) {
int res = 0;
for (int i = 0; i < a.size(); i++)
res = res * 10 + a... | replace | 41 | 42 | 41 | 42 | TLE | |
p00325 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF (1e9)
#define N 1005
using namespace std;
string s[N], s1[N], s2[N], s3[N];
set<char> S;
int n, num;
int d[N], p;
int var[N];
int get_num(string str) {
if ('a' <= str[0] && str[0] <= 'z')
return var[(int)str[0]];
int res... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF (1e9)
#define N 1005
using namespace std;
string s[N], s1[N], s2[N], s3[N];
set<char> S;
int n, num;
int d[N], p;
int var[N];
int get_num(string str) {
if ('a' <= str[0] && str[0] <= 'z')
return var[(int)str[0]];
int res... | replace | 21 | 22 | 21 | 22 | TLE | |
p00329 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define MAX_V 1000
int N, a, cc = 1;
vector<int> G[MAX_V];
int match[MAX_V];
bool used[MAX_V];
bool dfs(int v) {
used[v] = cc;
for (int i = 0; i < (int)G[v].size(); i++) {
int u = G[v][i], w = match[u];
if (w < 0 || (used[w] != cc && dfs(w))) {
match[u] ... | #include <bits/stdc++.h>
using namespace std;
#define MAX_V 1000
int N, a, cc = 1;
vector<int> G[MAX_V];
int match[MAX_V];
int used[MAX_V];
bool dfs(int v) {
used[v] = cc;
for (int i = 0; i < (int)G[v].size(); i++) {
int u = G[v][i], w = match[u];
if (w < 0 || (used[w] != cc && dfs(w))) {
match[u] =... | replace | 7 | 8 | 7 | 8 | -11 | |
p00329 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif
// #define int long long
#define rep(v, a, b) for (int v = (a); v < (b); v++)
#define rrep(v, a, b) for (int v = (b)-1; v >= (a); v--)
#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(v, a, b) for (int v = (a); v < (b); v++)
#define rrep(v, a, b) for (int v = (b)-1; v >= (a); v--)
#define all(c) begin(c), end(c)
const int INF =
sizeof(int) == sizeof... | replace | 77 | 78 | 77 | 78 | 0 | |
p00333 | C++ | Runtime Error | #include <iostream>
using namespace std;
int gcd(int a, int b) {
if (b == 0)
return a;
return (b, a % b);
}
int main() {
int W, H, C;
cin >> W >> H >> C;
int GCD = gcd(W, H);
cout << ((W / GCD) * (H / GCD) * C) << endl;
return 0;
}
| #include <iostream>
using namespace std;
int gcd(int a, int b) {
if (b == 0)
return a;
return gcd(b, a % b);
}
int main() {
int W, H, C;
cin >> W >> H >> C;
int GCD = gcd(W, H);
cout << ((W / GCD) * (H / GCD) * C) << endl;
return 0;
}
| replace | 6 | 7 | 6 | 7 | 0 | |
p00333 | C++ | Runtime Error | #include <iostream>
using namespace std;
int gcd(int m, int n) {
if (n == 0)
return 0;
return gcd(n, m % n);
}
int main() {
int W, H, C;
cin >> W >> H >> C;
int g = gcd(W, H);
cout << W / g * H / g * C << endl;
return 0;
}
| #include <iostream>
using namespace std;
int gcd(int m, int n) {
if (n == 0)
return m;
return gcd(n, m % n);
}
int main() {
int W, H, C;
cin >> W >> H >> C;
int g = gcd(W, H);
cout << W / g * H / g * C << endl;
return 0;
}
| replace | 5 | 6 | 5 | 6 | -8 | |
p00334 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int te[100][3];
bool ka[100] = {0};
int n;
int cnt;
int i, j;
int tmp;
cin >> n;
for (i = 0; i < n; i++) {
cin >> te[i][0] >> te[i][1] >> te[i][2];
if (te[i][0] > te[i][1]) {
tmp = te[i][0];
te[i][0] = te[i][1];
te[i][1] =... | #include <iostream>
using namespace std;
int main() {
int te[1000 + 1][3];
bool ka[1000 + 1] = {0};
int n;
int cnt;
int i, j;
int tmp;
cin >> n;
for (i = 0; i < n; i++) {
cin >> te[i][0] >> te[i][1] >> te[i][2];
if (te[i][0] > te[i][1]) {
tmp = te[i][0];
te[i][0] = te[i][1];
... | replace | 3 | 5 | 3 | 5 | 0 | |
p00334 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
using namespace std;
int kumi[100][100][100] = {0};
int main() {
int N;
int count = 0;
int p[3003];
cin >> N;
for (int i = 0; i < N; i++) {
cin >> p[(3 * i)] >> p[(3 * i) + 1] >> p[(3 * i) + 2];
sort(p + (3 * i), p + (3 * i) + 3);
if (kumi[p[3 * i]][p[(... | #include <algorithm>
#include <iostream>
using namespace std;
int kumi[1000][1000][1000] = {0};
int main() {
int N;
int count = 0;
int p[3003];
cin >> N;
for (int i = 0; i < N; i++) {
cin >> p[(3 * i)] >> p[(3 * i) + 1] >> p[(3 * i) + 2];
sort(p + (3 * i), p + (3 * i) + 3);
if (kumi[p[3 * i]][... | replace | 4 | 5 | 4 | 5 | 0 | |
p00334 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
class triangle {
public:
int position[3];
};
bool compare(triangle &a, triangle &b) {
for (int i = 0; i < 3; ++i) {
if (a.position[i] < b.position[i]) {
return true;
} else if (a.position[i] > b.position[i]) {
return... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
class triangle {
public:
int position[3];
};
bool compare(triangle &a, triangle &b) {
for (int i = 0; i < 3; ++i) {
if (a.position[i] < b.position[i]) {
return true;
} else if (a.position[i] > b.position[i]) {
return... | replace | 16 | 17 | 16 | 17 | 0 | |
p00335 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (n); i++)
#define pb push_back
#define all(v) (v).begin(), (v).end()
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<pint> vpint;
#define fi first
#define se second
template <typename A, type... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (n); i++)
#define pb push_back
#define all(v) (v).begin(), (v).end()
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<pint> vpint;
#define fi first
#define se second
template <typename A, type... | replace | 25 | 26 | 25 | 26 | TLE | |
p00336 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int dp[1000][1000];
int main() {
string t, b;
cin >> t >> b;
dp[0][0] = 0;
int MOD = 1000000007;
for (int i = 1; i <= b.size(); i++) {
for (int j = 1 + i - 1; j <= t.size(); j++) {
if (b[i - 1] == t[j - 1]) {
if... | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int dp[1001][1001];
int main() {
string t, b;
cin >> t >> b;
dp[0][0] = 0;
int MOD = 1000000007;
for (int i = 1; i <= b.size(); i++) {
for (int j = 1 + i - 1; j <= t.size(); j++) {
if (b[i - 1] == t[j - 1]) {
if... | replace | 4 | 5 | 4 | 5 | 0 | |
p00336 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <queue>
#include <stack>
#include <string>
#include <vector>
#define bigone t.size() + 1
#define bangone b.size() + 1
#define big t.size()
#define bang b.size()
#define USA 1000000007
using namespace std;
int P[1000][1000];
int main() {
string t,... | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <queue>
#include <stack>
#include <string>
#include <vector>
#define bigone t.size() + 1
#define bangone b.size() + 1
#define big t.size()
#define bang b.size()
#define USA 1000000007
using namespace std;
long long P[10000][10000];
int main() {
s... | replace | 16 | 17 | 16 | 17 | 0 | |
p00336 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> mp;
#define inf 1e9
ll mod = 1e9 + 7;
int main() {
string t, b;
cin >> t >> b;
ll n1 = t.size(), n2 = b.size();
vector<vector<ll>> dp(n1, vector<ll>(n2, 0));
for (int i = 0; i < n1; i++) {
if (t[i] == b[0])
... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> mp;
#define inf 1e9
ll mod = 1e9 + 7;
int main() {
string t, b;
cin >> t >> b;
ll n1 = t.size(), n2 = b.size();
vector<vector<ll>> dp(n1, vector<ll>(n2, 0));
for (int i = 0; i < n1; i++) {
if (t[i] == b[0])
... | replace | 16 | 17 | 16 | 20 | 0 | |
p00336 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
long long int dp[1001][1001];
int main() {
string t, b;
cin >> t >> b;
int tsize = t.size(), bsize = b.size();
dp[0][0] = 1;
for (int i = 0; i <= t.size(); i++) {
for (int j = 0; j <= b.size(); j++) {
if (t[i] == b[j]) {
dp[i + 1][j + 1] +... | #include <bits/stdc++.h>
using namespace std;
long long int dp[1002][1002];
int main() {
string t, b;
cin >> t >> b;
int tsize = t.size(), bsize = b.size();
dp[0][0] = 1;
for (int i = 0; i <= t.size(); i++) {
for (int j = 0; j <= b.size(); j++) {
if (t[i] == b[j]) {
dp[i + 1][j + 1] +... | replace | 3 | 4 | 3 | 4 | 0 | |
p00336 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int A, B;
string a, b;
cin >> a >> b;
A = a.size();
B = b.size();
vector<vector<ll>> dp(B, vector<ll>(A));
constexpr ll MOD = ((1e9) + 7);
for (int i = 0; i < B; i++) {
for (int j = 0; j < A; j++) {
if (i > 0... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int A, B;
string a, b;
cin >> a >> b;
A = a.size();
B = b.size();
vector<vector<ll>> dp(B + 1, vector<ll>(A + 1));
constexpr ll MOD = ((1e9) + 7);
for (int i = 0; i < B; i++) {
for (int j = 0; j < A; j++) {
i... | replace | 13 | 14 | 13 | 14 | -11 | |
p00338 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <set>
#include <vector>
using namespace std;
#define B 600
#define F first
#define S second
typedef long long ll;
typedef pair<ll, ll> P;
ll t[100005];
struct que {
ll o, a, b;
};
struct z {
ll x;
bool operator<(z &q) {
if (t[x] != t[q.x])
... | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <set>
#include <vector>
using namespace std;
#define B 500
#define F first
#define S second
typedef long long ll;
typedef pair<ll, ll> P;
ll t[100005];
struct que {
ll o, a, b;
};
struct z {
ll x;
bool operator<(z &q) {
if (t[x] != t[q.x])
... | replace | 6 | 7 | 6 | 7 | TLE | |
p00342 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int a[1001], i, ma = 100000, p, n;
double m1, m2;
int main() {
for (cin >> n; i < n; i++)
cin >> a[i];
sort(a, a + n);
m1 = (double)(a[n - 1] + a[n - 2]) / (a[1] - a[0]);
for (i = n - 1; i > 0; i--)
if (a[i] - a[i - 1] <= ma)
ma = a[i] - a[i++ - 1];
... | #include <bits/stdc++.h>
using namespace std;
int a[1001], i, ma = 100000, p, n;
double m1, m2;
int main() {
for (cin >> n; i < n; i++)
cin >> a[i];
sort(a, a + n);
m1 = (double)(a[n - 1] + a[n - 2]) / (a[1] - a[0]);
for (i = n - 1; i > 0; i--)
if (a[i] - a[i - 1] <= ma) {
ma = a[i] - a[i - 1];
... | replace | 10 | 12 | 10 | 14 | TLE | |
p00343 | C++ | Runtime Error | #include <bits/stdc++.h>
#define fo(i, a, b) for (int i = a; i <= b; ++i)
#define fd(i, a, b) for (int i = a; i >= b; --i)
#define rep(i, a, b) for (int i = a; i < b; ++i)
#define fore(i, a) for (__typeof(a.begin()) i = a.begin(); i != a.end(); ++i)
#define __unique(V) V.resize(unique(V.begin(), V.end()) - V.begin())
#... | #include <bits/stdc++.h>
#define fo(i, a, b) for (int i = a; i <= b; ++i)
#define fd(i, a, b) for (int i = a; i >= b; --i)
#define rep(i, a, b) for (int i = a; i < b; ++i)
#define fore(i, a) for (__typeof(a.begin()) i = a.begin(); i != a.end(); ++i)
#define __unique(V) V.resize(unique(V.begin(), V.end()) - V.begin())
#... | delete | 73 | 77 | 73 | 73 | 0 | |
p00343 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
vector<int> AP;
vector<int> AQ;
vector<int> BP;
vector<int> BQ;
bool check(vector<int> AP, int ap, int r) {
if (AP[ap] == r)
return true;
return false;
}
bool dfs(int p, int ap, int aq, int bp, int bq, int l, int r) {
if (p == 1) { // 先手
if (ap >= AP.size()... | #include <bits/stdc++.h>
using namespace std;
vector<int> AP;
vector<int> AQ;
vector<int> BP;
vector<int> BQ;
bool check(vector<int> AP, int ap, int r) {
if (AP.size() <= ap)
return false;
if (AP[ap] == r)
return true;
return false;
}
bool dfs(int p, int ap, int aq, int bp, int bq, int l, int r) {
if... | insert | 9 | 9 | 9 | 11 | -11 | |
p00344 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, n) for (int i = n - 1; i >= 0; --i)
#define yesno(flg) \
if (flg) { \
cout << "yes" << endl; ... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, n) for (int i = n - 1; i >= 0; --i)
#define yesno(flg) \
if (flg) { \
cout << "yes" << endl; ... | replace | 40 | 45 | 40 | 46 | TLE | |
p00344 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
bool a[10000], s[10000];
int b[10000], c[10000];
signed main() {
int d, sum = 0;
cin >> d;
for (int e = 0; e < d; e++) {
scanf("%d", &b[e]);
}
for (int i = 0; i < d; i++) {
if (!a[i]) {
memset(c, 0, sizeof(c));
int now = i;
while (1) {
... | #include <bits/stdc++.h>
using namespace std;
bool a[100000], s[100000];
int b[100000], c[100000];
signed main() {
int d, sum = 0;
cin >> d;
for (int e = 0; e < d; e++) {
scanf("%d", &b[e]);
}
for (int i = 0; i < d; i++) {
if (!a[i]) {
memset(c, 0, sizeof(c));
int now = i;
while (1)... | replace | 3 | 5 | 3 | 5 | 0 | |
p00344 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using names... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using names... | replace | 46 | 47 | 46 | 47 | 0 | |
p00345 | C++ | Runtime Error | #include <cmath>
#include <iostream>
#include <string>
using namespace std;
string S;
int e, f1, f2, g1, g2;
int gcd(int a, int b) {
if (b == 0)
return a;
return gcd(b, a % b);
}
int main() {
cin >> S;
string T;
bool flag = false;
for (int i = 0; i < S.size(); i++) {
if (S[i] == '.') {
e = sto... | #include <cmath>
#include <iostream>
#include <string>
using namespace std;
string S;
int e, f1, f2, g1, g2;
int gcd(int a, int b) {
if (b == 0)
return a;
return gcd(b, a % b);
}
int main() {
cin >> S;
string T;
bool flag = false;
for (int i = 0; i < S.size(); i++) {
if (S[i] == '.') {
e = sto... | replace | 20 | 21 | 20 | 23 | -6 | terminate called after throwing an instance of 'std::invalid_argument'
what(): stoi
|
p00346 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <queue>
#include <vector>
const int LIM = 1.5e3 + 5;
struct data {
int x, d;
};
bool operator<(data a, data b) { return a.d > b.d; }
int n, m, dis[LIM][LIM], max, ans;
std::vector<data> edg[LIM];
bool chk[LIM], vis[LIM];
std::priority_queue<data> q... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <queue>
#include <vector>
const int LIM = 1.5e3 + 5;
struct data {
int x, d;
};
bool operator<(data a, data b) { return a.d > b.d; }
int n, m, dis[LIM][LIM], max, ans;
std::vector<data> edg[LIM];
bool chk[LIM], vis[LIM];
std::priority_queue<data> q... | insert | 34 | 34 | 34 | 35 | TLE | |
p00346 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < ... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < ... | insert | 71 | 71 | 71 | 72 | TLE | |
p00347 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
int w, h;
int dp[2000][2000][2], s[2000][2000];
int sum[2000][2000];
int dx[]{1, 0}, dy[]{0, 1};
int rec(int x, int y, int a) {
if (dp[x][y][a] != -1)
return dp[x][y][a];
if (y == w)
return 0;
int res = (a == 0... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
int w, h;
int dp[2000][2000][2], s[2000][2000];
int sum[2000][2000];
int dx[]{1, 0}, dy[]{0, 1};
int rec(int x, int y, int a) {
if (dp[x][y][a] != -1)
return dp[x][y][a];
if (y == w)
return 0;
int res = (a == 0... | replace | 25 | 26 | 25 | 26 | TLE | |
p00348 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define removeDuplicate(a) \
sort(a.begin(), a.end()); \
a.resize(distance(a.begin(), unique(a.begin(), a.end())));
const int N = 2e5 + 10;
int n;
int a[N];
set<int... | #include <bits/stdc++.h>
using namespace std;
#define removeDuplicate(a) \
sort(a.begin(), a.end()); \
a.resize(distance(a.begin(), unique(a.begin(), a.end())));
const int N = 6e5 + 10;
int n;
int a[N];
set<int... | replace | 7 | 8 | 7 | 8 | 0 | |
p00348 | 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 | 83 | 84 | 83 | 84 | 0 | |
p00348 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <map>
#include <queue>
#include <vector>
const int LIM = 1e5 + 5;
int n, dsu[LIM], a[LIM], b[LIM];
long long ans;
std::map<int, int> map;
std::queue<int> q;
int root(int x) {
if (dsu[x] <= 0)
return x;
else
return dsu[x] = root(dsu[x]);
}... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <map>
#include <queue>
#include <vector>
const int LIM = 2e5 + 5;
int n, dsu[LIM], a[LIM], b[LIM];
long long ans;
std::map<int, int> map;
std::queue<int> q;
int root(int x) {
if (dsu[x] <= 0)
return x;
else
return dsu[x] = root(dsu[x]);
}... | replace | 7 | 8 | 7 | 8 | 0 | |
p00349 | C++ | Runtime Error | // http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0354
#include <bits/stdc++.h>
const int N = 1e5 + 5;
const int inf = 1e9 + 7;
using namespace std;
vector<int> mv[2];
int n, w, h, x[N], y[N], p[N], ans[N];
char s[N];
void cal(vector<int> &a, bool ck) {
if (a.size() == 0)
return;
queue<int> Q1, Q2;... | // http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0354
#include <bits/stdc++.h>
const int N = 2e5 + 5;
const int inf = 1e9 + 7;
using namespace std;
vector<int> mv[2];
int n, w, h, x[N], y[N], p[N], ans[N];
char s[N];
void cal(vector<int> &a, bool ck) {
if (a.size() == 0)
return;
queue<int> Q1, Q2;... | replace | 3 | 4 | 3 | 4 | 0 | |
p00351 | C++ | Time Limit Exceeded | ////////////////////
// ???????????????
#include <algorithm>
#include <cassert>
#include <cmath>
////////////////////
// ??¨????????¢???
using D = double;
////////////////////
// ?????°
const D EPS = 1e-9; // |EPS|???????????°???0??¨????????±???
enum POSITION {
ONLINE_FRONT = -2,
CLOCKWISE,
ON_SEGMENT,
COUNTER_... | ////////////////////
// ???????????????
#include <algorithm>
#include <cassert>
#include <cmath>
////////////////////
// ??¨????????¢???
using D = double;
////////////////////
// ?????°
const D EPS = 1e-9; // |EPS|???????????°???0??¨????????±???
enum POSITION {
ONLINE_FRONT = -2,
CLOCKWISE,
ON_SEGMENT,
COUNTER_... | replace | 347 | 348 | 347 | 348 | TLE | |
p00355 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int a, b, n, s, f, i = 0;
cin >> a >> b >> n;
while (1) {
cin >> s >> f;
if ((a >= s && b <= f) || (s > a && s < b) || (f > a && f < b)) {
cout << '1' << endl;
break;
}
if (++i == n) {
cout << '0' << endl;
break;
}
... | #include <iostream>
using namespace std;
int main() {
int a, b, n, s, f, i = 0;
cin >> a >> b >> n;
while (1) {
cin >> s >> f;
if ((a >= s && b <= f) || (s > a && s < b) || (f > a && f < b)) {
cout << '1' << endl;
break;
}
if (++i >= n) {
cout << '0' << endl;
break;
}
... | replace | 11 | 12 | 11 | 12 | TLE | |
p00355 | C++ | Runtime Error | #include <bits/stdc++.h>
#define syosu(x) fixed << setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd... | #include <bits/stdc++.h>
#define syosu(x) fixed << setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd... | replace | 41 | 42 | 41 | 42 | 0 | |
p00357 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
int n, t[100000], r = 1;
cin >> n;
for (int i = 0; i < n; i++)
cin >> t[i];
int le = t[0];
for (int i = 1; i < n; i++) {
le -= 10;
if (le < 0)
r = 0;
le = max(le, t[i]);
}
reverse(t, t + n);
le = t[0];
... | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
int n, t[300010], r = 1;
cin >> n;
for (int i = 0; i < n; i++)
cin >> t[i];
int le = t[0];
for (int i = 1; i < n; i++) {
le -= 10;
if (le < 0)
r = 0;
le = max(le, t[i]);
}
reverse(t, t + n);
le = t[0];
... | replace | 5 | 6 | 5 | 6 | 0 | |
p00357 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
int d[300000];
int a[300000];
#ifndef MAX
#define MAX 400000
#endif
// Range Update Query+Range Sum Query
template <class T> class RUQ_RSQ {
public:
int n;
T dat[MAX], lazy[MAX], ZERO, DEFAULT;
void init(int n_, T d =... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
int d[300000];
int a[300000];
#ifndef MAX
#define MAX 1200000
#endif
// Range Update Query+Range Sum Query
template <class T> class RUQ_RSQ {
public:
int n;
T dat[MAX], lazy[MAX], ZERO, DEFAULT;
void init(int n_, T d ... | replace | 8 | 9 | 8 | 9 | 0 | |
p00357 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define FI first
#define SE second
#define VE vector<int>
#define PB push_back
#define PA pair<int, int>
#define MA make_pair
#define LL long long
#define FOR(i, a, b) for (int... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define FI first
#define SE second
#define VE vector<int>
#define PB push_back
#define PA pair<int, int>
#define MA make_pair
#define LL long long
#define FOR(i, a, b) for (int... | replace | 33 | 37 | 33 | 34 | TLE | |
p00357 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
int a[100000];
int main() {
long int N;
bool flag = 0;
cin >> N;
for (int i = 1; i <= N; i++) {
cin >> a[i - 1];
}
if (a[0] >= 10 && a[N - 1] >= 10) {
for (int k = 1; k <= N - 2; k++) {
if (a[k] < 10) {
flag = 0;
int yosi = 0;
... | #include "bits/stdc++.h"
using namespace std;
int a[300000];
int main() {
long int N;
bool flag = 0;
cin >> N;
for (int i = 1; i <= N; i++) {
cin >> a[i - 1];
}
if (a[0] >= 10 && a[N - 1] >= 10) {
for (int k = 1; k <= N - 2; k++) {
if (a[k] < 10) {
flag = 0;
int yosi = 0;
... | replace | 2 | 3 | 2 | 3 | 0 | |
p00357 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int a[100001];
bool solve1(int n) {
int p = 0;
for (int i = 0; i < n; i++) {
if (i > p)
return 0;
p = max(p, i + (a[i] / 10));
}
return p >= n - 1;
}
bool solve2(int n) {
int p = n - 1;
for (int i = n - 1; i >= 0; i--) {
if (i < p)
retu... | #include <bits/stdc++.h>
using namespace std;
int a[300001];
bool solve1(int n) {
int p = 0;
for (int i = 0; i < n; i++) {
if (i > p)
return 0;
p = max(p, i + (a[i] / 10));
}
return p >= n - 1;
}
bool solve2(int n) {
int p = n - 1;
for (int i = n - 1; i >= 0; i--) {
if (i < p)
retu... | replace | 3 | 4 | 3 | 4 | 0 | |
p00358 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int H, N;
int ngmask[1000];
int dp[1000][1 << 4];
int rec(int idx, int upbit) {
if (idx == H)
return (0);
if (~dp[idx][upbit])
return (dp[idx][upbit]);
int ret = rec(idx + 1, ngmask[idx]);
for (int i = 0; i < 3; i++) {
if ((upbit >> i) & 3)
cont... | #include <bits/stdc++.h>
using namespace std;
int H, N;
int ngmask[10000];
int dp[10000][1 << 4];
int rec(int idx, int upbit) {
if (idx == H)
return (0);
if (~dp[idx][upbit])
return (dp[idx][upbit]);
int ret = rec(idx + 1, ngmask[idx]);
for (int i = 0; i < 3; i++) {
if ((upbit >> i) & 3)
co... | replace | 5 | 7 | 5 | 7 | 0 | |
p00359 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define FI first
#define SE second
#define PF push_front
#define PB push_back
#define PPF pop_front
#define PPB pop_back
#define MA make_pair
#define ll long long
#define PA pa... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define FI first
#define SE second
#define PF push_front
#define PB push_back
#define PPF pop_front
#define PPB pop_back
#define MA make_pair
#define ll long long
#define PA pa... | insert | 49 | 49 | 49 | 53 | 0 | |
p00359 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
int wh[10001] = {};
int main(void) {
int w, h, n;
cin >> w >> h >> n;
int at_most_w = 0, at_most_h = 0;
for (int i = 0; i < n; i++) {
int x, y;
scanf("%d%d", &x, &y);
wh[y] = max(wh[y], x);
at_most_w = max(x, at_mo... | #include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
int wh[100001] = {};
int main(void) {
int w, h, n;
cin >> w >> h >> n;
int at_most_w = 0, at_most_h = 0;
for (int i = 0; i < n; i++) {
int x, y;
scanf("%d%d", &x, &y);
wh[y] = max(wh[y], x);
at_most_w = max(x, at_m... | replace | 5 | 6 | 5 | 6 | 0 | |
p00360 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef pair<int, int> P;
#ifndef MAX
#define MAX 400000
#endif
// Range Update Query+Range Minimum Query
template <class T> class RUQ_RMQ {
public:
int n;
T dat[MAX], lazy[MAX], DEFAULT;
bool (*cmp)(T, T);
void init... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef pair<int, int> P;
#ifndef MAX
#define MAX 800000
#endif
// Range Update Query+Range Minimum Query
template <class T> class RUQ_RMQ {
public:
int n;
T dat[MAX], lazy[MAX], DEFAULT;
bool (*cmp)(T, T);
void init... | replace | 6 | 7 | 6 | 7 | 0 | |
p00362 | C++ | Time Limit Exceeded | #include <algorithm>
#include <assert.h>
#include <cmath>
#include <iostream>
#include <stack>
#include <tuple>
#include <vector>
using namespace std;
struct LeastCommonAncestor {
public:
LeastCommonAncestor(int n, int root = 0)
: root(root), graph(n), parent(ilogb(n) + 1, vector<int>(n)), depth(n) {}
void... | #include <algorithm>
#include <assert.h>
#include <cmath>
#include <iostream>
#include <stack>
#include <tuple>
#include <vector>
using namespace std;
struct LeastCommonAncestor {
public:
LeastCommonAncestor(int n, int root = 0)
: root(root), graph(n), parent(ilogb(n) + 1, vector<int>(n)), depth(n) {}
void... | replace | 214 | 217 | 214 | 219 | TLE | |
p00362 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
const int inf = 1001001001;
struct e {
int to, cost;
e(int to, int cost) : to(to), cost(cost) {}
};
struct edge {
int to;
bool edge_type;
long long cost, scost, tcost;
edge() {}
// edge(int to, long long cost) : to(to), cost(cost) {}
edge(int to, long lo... | #include <bits/stdc++.h>
using namespace std;
const int inf = 1001001001;
struct e {
int to, cost;
e(int to, int cost) : to(to), cost(cost) {}
};
struct edge {
int to;
bool edge_type;
long long cost, scost, tcost;
edge() {}
// edge(int to, long long cost) : to(to), cost(cost) {}
edge(int to, long lo... | replace | 48 | 49 | 48 | 49 | TLE | |
p00365 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define dbg(...) \
do { \
cerr << __LINE__ <<... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define dbg(...) \
do { \
cerr << __LINE__ <<... | replace | 112 | 113 | 112 | 113 | 0 | 57: get<0>(now)= 2001 get<1>(now)= 11 get<2>(now)= 3
|
p00367 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int n;
int ax[50], bx[50];
int ay[50], by[50];
int az[50], bz[50];
int input() {
int fi, se;
cin >> fi >> se;
return fi * 60 + se;
}
int main() {
cin >> n;
vector<int> X, Y, Z;
for (int i = 0; i < n; i++) {
ax[i] = input();
bx[i] = input();
ay[i] ... | #include <bits/stdc++.h>
using namespace std;
int n;
int ax[50], bx[50];
int ay[50], by[50];
int az[50], bz[50];
int input() {
int fi, se;
cin >> fi >> se;
return fi * 60 + se;
}
int main() {
cin >> n;
vector<int> X, Y, Z;
for (int i = 0; i < n; i++) {
ax[i] = input();
bx[i] = input();
ay[i] ... | replace | 30 | 31 | 30 | 31 | 0 | |
p00369 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (n); i++)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define fi first
#define se second
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<pint> vpint;
template <typename A, ty... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (n); i++)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define fi first
#define se second
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<pint> vpint;
template <typename A, ty... | insert | 50 | 50 | 50 | 52 | TLE | |
p00370 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define dbg(...) \
do { \
cerr << __LINE__ <<... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define dbg(...) \
do { \
cerr << __LINE__ <<... | replace | 151 | 152 | 151 | 152 | 0 | |
p00373 | C++ | Runtime Error | #include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
int w1, w2, h1, h2, sum;
int hash_a[700][700][13], hash_b[700][13];
int cumo_a[700][700][13], cumo_b[700][13];
char s[700][700], t[700][700];
void make_table() {
rep(i, h1) rep(j, w1 - w2 + 1) {
rep... | #include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
int w1, w2, h1, h2, sum;
int hash_a[800][800][13], hash_b[800][13];
int cumo_a[800][800][13], cumo_b[800][13];
char s[800][800], t[800][700];
void make_table() {
rep(i, h1) rep(j, w1 - w2 + 1) {
rep... | replace | 6 | 9 | 6 | 9 | 127 | /tmp/0f306e58-bb53-4bf2-b3ff-db2fd7d55ff7.out: error while loading shared libraries: libstdc++.so.6: failed to map segment from shared object
|
p00373 | C++ | Runtime Error | #include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
int w1, w2, h1, h2, sum;
int hash_a[700][700][10], hash_b[700][10];
int cumo_a[700][700][10], cumo_b[700][10];
char s[700][700], t[700][700];
void make_table() {
rep(i, h1) rep(j, w1 - w2 + 1) {
rep... | #include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
int w1, w2, h1, h2, sum;
int hash_a[800][800][10], hash_b[800][10];
int cumo_a[800][800][10], cumo_b[800][10];
char s[800][700], t[800][800];
void make_table() {
rep(i, h1) rep(j, w1 - w2 + 1) {
rep... | replace | 6 | 9 | 6 | 9 | 0 | |
p00384 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double D;
typedef pair<ll, ll> P;
#define M 1000000007
#define F first
#define S second
#define PB push_back
#define INF 100000000000000000
#define MP make_pair
struct t {
ll r, s1, s2;
t(void) { r = 0, s1 = 0, s2 = 0; }
void up(ll x) {
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double D;
typedef pair<ll, ll> P;
#define M 1000000007
#define F first
#define S second
#define PB push_back
#define INF 100000000000000000
#define MP make_pair
struct t {
ll r, s1, s2;
t(void) { r = 0, s1 = 0, s2 = 0; }
void up(ll x) {
... | replace | 34 | 35 | 34 | 36 | TLE | |
p00384 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
vector<int> graph[100010];
vector<int> tree[100010];
int mas[100010];
int n;
bool used[100010] = {};
void makeTree(int m) {
used[m] = true;
for (int i = 0; i < graph[m].size(); i++) {
if (!used[graph[m][i]]) {
tree[m].push_back(graph[m][i]);
makeTree(... | #include <bits/stdc++.h>
using namespace std;
vector<int> graph[100010];
vector<int> tree[100010];
int mas[100010];
int n;
bool used[100010] = {};
void makeTree(int m) {
used[m] = true;
for (int i = 0; i < graph[m].size(); i++) {
if (!used[graph[m][i]]) {
tree[m].push_back(graph[m][i]);
makeTree(... | replace | 37 | 38 | 37 | 39 | 0 | |
p00392 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
const double EPS = 1e-15;
using ll = long long;
using ull = unsigned long long;
const int inf = 2e9;
const ll INF = 2e18;
const ll MOD = 1e9 + 7;
const ll MOD1 = 998244353;
typedef pair<int, int> P;
#define REP(i, n) for (int i = 0; i < (n); i+... | #include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
const double EPS = 1e-15;
using ll = long long;
using ull = unsigned long long;
const int inf = 2e9;
const ll INF = 2e18;
const ll MOD = 1e9 + 7;
const ll MOD1 = 998244353;
typedef pair<int, int> P;
#define REP(i, n) for (int i = 0; i < (n); i+... | replace | 60 | 61 | 60 | 61 | TLE | |
p00423 | C++ | Time Limit Exceeded | #include <cstdio>
int main() {
int a, b, n;
while (scanf("%d", &n) != 0) {
int asum = 0, bsum = 0;
for (int i = 0; i < n; i++) {
scanf("%d %d", &a, &b);
if (a > b) {
asum += a + b;
} else if (a < b) {
bsum += a + b;
} else {
asum += a;
bsum += b;
... | #include <cstdio>
int main() {
int a, b, n;
while (scanf("%d", &n), n) {
int asum = 0, bsum = 0;
for (int i = 0; i < n; i++) {
scanf("%d %d", &a, &b);
if (a > b) {
asum += a + b;
} else if (a < b) {
bsum += a + b;
} else {
asum += a;
bsum += b;
}... | replace | 3 | 4 | 3 | 4 | TLE | |
p00423 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int maisuu, a[10], b[10];
long long int a_p = 0, b_p = 0;
int anser[2][10];
int hasi;
for (int i = 0; i < 5; i++) {
cin >> maisuu;
if (maisuu == 0) {
break;
}
for (int i2 = 0; i2 < maisuu; i2++) {
cin >> a[i2];
cin >> b[i2... | #include <iostream>
using namespace std;
int main() {
int maisuu, a[15000], b[15000];
long long int a_p = 0, b_p = 0;
int anser[2][10];
int hasi;
for (int i = 0; i < 5; i++) {
cin >> maisuu;
if (maisuu == 0) {
break;
}
for (int i2 = 0; i2 < maisuu; i2++) {
cin >> a[i2];
cin >... | replace | 3 | 4 | 3 | 4 | 0 | |
p00423 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int t;
while (cin >> t && t > 0) {
int p1 = 0, p2 = 0;
while (t > 0) {
int a = 0, b = 0;
cin >> a >> b;
if (a >= 0 && a <= 9 && a >= 0 && a <= 9) {
continue;
}
if (a > b) {
p1 += a + b;
} else if (a < b... | #include <iostream>
using namespace std;
int main() {
int t;
while (cin >> t && t > 0) {
int p1 = 0, p2 = 0;
while (t > 0) {
int a = 0, b = 0;
cin >> a >> b;
if (a < 0 || a > 9 || a < 0 || a > 9) {
continue;
}
if (a > b) {
p1 += a + b;
} else if (a < b) {
... | replace | 9 | 10 | 9 | 10 | TLE | |
p00423 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int n[10000000], s1, s2;
int main() {
int p, a, b;
while (true) {
s1 = 0;
s2 = 0;
cin >> p;
for (int i = 0; i < p; i++) {
cin >> a >> b;
if (a > b) {
s1 += a + b;
} else if (b > a) {
s2 += a + b;
} else {
s1 += ... | #include <iostream>
using namespace std;
int n[10000000], s1, s2;
int main() {
int p, a, b;
while (true) {
s1 = 0;
s2 = 0;
cin >> p;
if (p == 0) {
break;
}
for (int i = 0; i < p; i++) {
cin >> a >> b;
if (a > b) {
s1 += a + b;
} else if (b > a) {
s2 +=... | insert | 9 | 9 | 9 | 12 | TLE | |
p00423 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <queue>
#include <sstream>
#include <stdlib.h>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
int main(void) {
int n;
while (cin >> n, !0) {
int a = 0;
int b = 0;
for (int i = 0; i < n; i++) {
int r, l;
cin >> l >>... | #include <algorithm>
#include <iostream>
#include <queue>
#include <sstream>
#include <stdlib.h>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
int main(void) {
int n;
while (cin >> n) {
if (n == 0)
break;
int a = 0;
int b = 0;
for (int i = 0; i < n; i++) {
in... | replace | 11 | 12 | 11 | 14 | TLE | |
p00423 | C++ | Runtime Error | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
#include <list>
#include <queue>
#include <set>
#include <string>
#include <vector>
#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... | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
#include <list>
#include <queue>
#include <set>
#include <string>
#include <vector>
#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... | replace | 42 | 43 | 42 | 43 | 0 | |
p00423 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int n, a, b, at, bt;
loop:
scanf("%d\n", &n); // 各人のカード枚数
if (n == 0)
goto end_scope;
at = 0;
bt = 0;
labl_testloop:
scanf("%d %d\n", a, b);
if (a > b)
at += a + b;
else if (a == b) {
at += a;
bt += b;
} else
bt += a + b;
n... | #include <iostream>
using namespace std;
int main() {
int n, a, b, at, bt;
loop:
scanf("%d\n", &n); // 各人のカード枚数
if (n == 0)
goto end_scope;
at = 0;
bt = 0;
labl_testloop:
scanf("%d %d\n", &a, &b);
if (a > b)
at += a + b;
else if (a == b) {
at += a;
bt += b;
} else
bt += a + b;
... | replace | 14 | 15 | 14 | 15 | -11 | |
p00423 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int n, a, b, ap, bp, i;
while (1) {
cin >> n;
ap = bp = 0;
for (i = 0; i < n; i++) {
cin >> a >> b;
if (a > b)
ap += a + b;
else if (b > a)
bp += a + b;
else
ap += a, bp += b;
}
cout << ap << ' ... | #include <iostream>
using namespace std;
int main() {
int n, a, b, ap, bp, i;
while (1) {
cin >> n;
if (n == 0)
break;
ap = bp = 0;
for (i = 0; i < n; i++) {
cin >> a >> b;
if (a > b)
ap += a + b;
else if (b > a)
bp += a + b;
else
ap += a, bp += ... | insert | 6 | 6 | 6 | 8 | TLE | |
p00423 | C++ | Time Limit Exceeded | #include <stdio.h>
int main(void) {
int n;
int a[10000];
int b[10000];
int i;
int suma, sumb;
scanf("%d", &n);
while (n != 0) {
suma = 0;
sumb = 0;
for (i = 0; i < n; i++) {
scanf("%d %d", &a[i], &b[i]);
if (a[i] > b[i]) {
suma = suma + a[i] + b[i];
} else if (a[i] <... | #include <stdio.h>
int main(void) {
int n;
int a[10000];
int b[10000];
int i;
int suma, sumb;
scanf("%d", &n);
while (n != 0) {
suma = 0;
sumb = 0;
for (i = 0; i < n; i++) {
scanf("%d %d", &a[i], &b[i]);
if (a[i] > b[i]) {
suma = suma + a[i] + b[i];
} else if (a[i] <... | replace | 24 | 25 | 24 | 25 | TLE |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.