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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p00884 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <map>
#include <sstream>
#include <vector>
using namespace std;
struct Edge {
int src, dst;
Edge() {}
Edge(int s, int d) : src(s), dst(d) {}
};
typedef vector<vector<Edge>> Graph;
void dfs(const Graph &g, int v, vector<int> &flg) {
flg[v] = 1;
for (Edge e :... | #include <algorithm>
#include <iostream>
#include <map>
#include <sstream>
#include <vector>
using namespace std;
struct Edge {
int src, dst;
Edge() {}
Edge(int s, int d) : src(s), dst(d) {}
};
typedef vector<vector<Edge>> Graph;
void dfs(const Graph &g, int v, vector<int> &flg) {
if (flg[v])
return;
f... | insert | 16 | 16 | 16 | 18 | TLE | |
p00884 | C++ | Time Limit Exceeded | #include <iostream>
#include <map>
#include <set>
#include <string>
using namespace std;
set<string> S;
map<string, int> M;
int n;
string str[101];
int saiki(int ima) {
int sum = 0;
string a;
for (int i = 0; i < str[ima].size(); i++) {
if (str[ima][i] == ',') {
if (M.count(a) == 1)
S.insert(a),... | #include <iostream>
#include <map>
#include <set>
#include <string>
using namespace std;
set<string> S;
map<string, int> M;
int n;
string str[101];
int saiki(int ima) {
int sum = 0;
string a;
for (int i = 0; i < str[ima].size(); i++) {
if (str[ima][i] == ',') {
if (M.count(a) == 1 && S.count(a) == 0)
... | replace | 15 | 16 | 15 | 16 | TLE | |
p00885 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF (1 << 28)
int n, p[100], t[100], dp[100][4];
void solve() {
rep(i, 100) rep(j, 4) dp[i][j] = INF;
dp[0][0] = 0;
rep(i, n - 1) ... | #include <algorithm>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF (1 << 28)
int n, p[100], t[100], dp[100][4];
void solve() {
rep(i, 100) rep(j, 4) dp[i][j] = INF;
dp[0][0] = 0;
rep(i, n - 1) ... | insert | 39 | 39 | 39 | 41 | -11 | |
p00885 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, k, n) for (int i = (k); i < (n); i++)
#define REP(i, n) FOR(i, 0, n)
#define ALL(a) a.begin(), a.end()
#define MS(m, v) memset(m, v, sizeof(m))
#define D10 fixed << setprecision(10)
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii... | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, k, n) for (int i = (k); i < (n); i++)
#define REP(i, n) FOR(i, 0, n)
#define ALL(a) a.begin(), a.end()
#define MS(m, v) memset(m, v, sizeof(m))
#define D10 fixed << setprecision(10)
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii... | insert | 25 | 25 | 25 | 27 | TLE | |
p00885 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
using namespace std;
int n, dis[41], t[41], maxball, ans;
void saiki(int x, int now, int ball, int sum, int kai) {
maxball = max(maxball, kai);
if (kai == n && !ball)
ans = min(ans, sum);
if (ball)
saiki(0, now + x * (1 + ball), 0, sum + x, kai);
if (ball == 3 |... | #include <algorithm>
#include <iostream>
using namespace std;
int n, dis[41], t[41], maxball, ans;
void saiki(int x, int now, int ball, int sum, int kai) {
if (ans < sum)
return;
maxball = max(maxball, kai);
if (kai == n && !ball)
ans = min(ans, sum);
if (ball)
saiki(0, now + x * (1 + ball), 0, sum... | insert | 6 | 6 | 6 | 8 | TLE | |
p00885 | C++ | Runtime Error | #include <algorithm>
#include <climits>
#include <cstring>
#include <iostream>
#include <vector>
using namespace std;
int abs(int x) { return x < 0 ? -x : x; }
int table[101][4];
int main() {
while (true) {
int n;
cin >> n;
if (n == 0) {
break;
}
vector<int> t(n), p(n);
for (int i = ... | #include <algorithm>
#include <climits>
#include <cstring>
#include <iostream>
#include <vector>
using namespace std;
int abs(int x) { return x < 0 ? -x : x; }
int table[101][4];
int main() {
while (true) {
int n;
cin >> n;
if (n == 0) {
break;
}
vector<int> t(n + 1), p(n + 1);
for (... | replace | 19 | 20 | 19 | 20 | 0 | |
p00890 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#inclu... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#inclu... | replace | 72 | 73 | 72 | 73 | -6 | free(): invalid pointer
|
p00890 | C++ | Time Limit Exceeded | #include <iostream>
#include <map>
#include <queue>
#include <vector>
#define rep(i, a) for (int i = 0; i < (int)(a); i++)
#define clr clear()
#define pb push_back
#define sz size()
#define fs first
#define sc second
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> P2;
const int INF = 1e8;
int n, m,... | #include <iostream>
#include <map>
#include <queue>
#include <vector>
#define rep(i, a) for (int i = 0; i < (int)(a); i++)
#define clr clear()
#define pb push_back
#define sz size()
#define fs first
#define sc second
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> P2;
const int INF = 1e8;
int n, m,... | insert | 42 | 42 | 42 | 46 | TLE | |
p00890 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(v) (v).begin(), (v).end()
#define resz(v, ...) (v).clear(), (v).resize(__VA_ARGS__)
#define reps(i, m, n) for (int i = (int)(m); i < (int)(n); i++)
#define rep(i, n) reps(i, 0, n)
template <class T1, class T2> void chmin(T1 &a, T2 b) {
... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(v) (v).begin(), (v).end()
#define resz(v, ...) (v).clear(), (v).resize(__VA_ARGS__)
#define reps(i, m, n) for (int i = (int)(m); i < (int)(n); i++)
#define rep(i, n) reps(i, 0, n)
template <class T1, class T2> void chmin(T1 &a, T2 b) {
... | replace | 45 | 46 | 45 | 46 | 0 | |
p00890 | C++ | Runtime Error | #include <bits/stdc++.h>
#define INF (1e9)
#define N 105
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> P1;
int n, m, C, f, t, c;
vector<P> G[N];
int dijkstra() {
int d[N][N];
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
d[i][j] = INF;
priority_queue<P1, vector<P1>, grea... | #include <bits/stdc++.h>
#define INF (1e9)
#define N 105
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> P1;
int n, m, C, f, t, c;
vector<P> G[N];
int dijkstra() {
int d[N][N];
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
d[i][j] = INF;
priority_queue<P1, vector<P1>, grea... | replace | 32 | 33 | 32 | 33 | 0 | |
p00890 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <valarray>
#include <vector>
using namespace std;
#define ... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <valarray>
#include <vector>
using namespace std;
#define ... | replace | 65 | 66 | 65 | 66 | 0 | |
p00891 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
long long H, W, K, c[1002][1002], p[1002][1002], r1[1002][1002], r2[1002][1002],
r3[1002][1002];
long long power[1000002], mod = 1000000007;
vector<long long> v;
void makehush() {
power[0] = 1;
for (int i = 1; i < ... | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
long long H, W, K, c[1002][1002], p[1002][1002], r1[1002][1002], r2[1002][1002],
r3[1002][1002];
long long power[1000002], mod = 1000000007;
vector<long long> v;
void makehush() {
power[0] = 1;
for (int i = 1; i < ... | replace | 62 | 63 | 62 | 63 | TLE | |
p00892 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < int(n); ++i)
const int DIV = 1000000;
int m, n;
double x1[100], y[100], x2[100], z[100];
double mnx, mxx;
double solve(double x) {
double y1 = 0, y2 = 0, z1 = 0, z2 = 0;
static int px11 = 0, px12 = 0, px21 = 0, px22 = 0;
rep(... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < int(n); ++i)
const int DIV = 500000;
int m, n;
double x1[100], y[100], x2[100], z[100];
double mnx, mxx;
double solve(double x) {
double y1 = 0, y2 = 0, z1 = 0, z2 = 0;
static int px11 = 0, px12 = 0, px21 = 0, px22 = 0;
rep(i... | replace | 6 | 7 | 6 | 7 | TLE | |
p00892 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef double dbl;
#define double long double
typedef complex<double> P;
typedef vector<P> G;
#define REP(i, n) for (int i = 0; i < n; i++)
double eps = 1e-11;
double EPS = eps;
bool eq(double a, double b) { return fabs(a - b) < eps; }
double cross(P a, P b) { return ima... | #include <bits/stdc++.h>
using namespace std;
typedef double dbl;
#define double long double
typedef complex<double> P;
typedef vector<P> G;
#define REP(i, n) for (int i = 0; i < n; i++)
double eps = 1e-11;
double EPS = eps;
bool eq(double a, double b) { return fabs(a - b) < eps; }
double cross(P a, P b) { return ima... | replace | 120 | 121 | 120 | 121 | TLE | |
p00892 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <utility>
#include <vector>
using namespace std;
double width(const pair<int, int> P[], double x, int length) {
vector<double> w(0);
for (int i = 0; i < length; i++) {
pair<int, int> p, q;
p = P[i];
i != length - 1 ? q = P[i + 1] : q = P[0];
if (p.fir... | #include <algorithm>
#include <cstdio>
#include <utility>
#include <vector>
using namespace std;
double width(const pair<int, int> P[], double x, int length) {
vector<double> w(0);
for (int i = 0; i < length; i++) {
pair<int, int> p, q;
p = P[i];
i != length - 1 ? q = P[i + 1] : q = P[0];
if (p.fir... | replace | 47 | 48 | 47 | 48 | 0 | |
p00894 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, x, y) for (int i = (x); i < (y); ++i)
#define debug(x) #x << "=" << (x)
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define print(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define print(x)
#endif
const int inf = 1e9;
const int64_t in... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, x, y) for (int i = (x); i < (y); ++i)
#define debug(x) #x << "=" << (x)
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define print(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define print(x)
#endif
const int inf = 1e9;
const int64_t in... | replace | 40 | 42 | 40 | 42 | 0 | |
p00895 | C++ | Memory Limit Exceeded | #include <iostream>
#include <set>
#include <string>
using namespace std;
string mp[11];
int w, h;
set<string> cnt;
string ans;
void check(int x, int y) {
string str;
for (int i = -1; i <= 1; i++)
for (int j = -1; j <= 1; j++) {
if (i == 0 && j == 0)
continue;
str = mp[y][x];
int nx = ... | #include <iostream>
#include <set>
#include <string>
using namespace std;
string mp[11];
int w, h;
set<string> cnt;
string ans;
void check(int x, int y) {
string str;
for (int i = -1; i <= 1; i++)
for (int j = -1; j <= 1; j++) {
if (i == 0 && j == 0)
continue;
str = mp[y][x];
int nx = ... | insert | 32 | 32 | 32 | 33 | MLE | |
p00895 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define mp ... | #include <bits/stdc++.h>
using namespace std;
#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define mp ... | replace | 58 | 59 | 58 | 59 | -6 | terminate called after throwing an instance of 'std::logic_error'
what(): basic_string: construction from null is not valid
|
p00895 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <complex>
#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 ... | #include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <complex>
#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 ... | delete | 95 | 96 | 95 | 95 | TLE | |
p00896 | C++ | Memory Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define reep(i, a, b) for (int i = a; i < b; i++)
vector<string> func(string input) {
vector<string> ret;
stringstream ss;
ss << input;
string s;
vector<pair<int, string>> tmp;
while (ss >> s) {
if (s[s.size()... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define reep(i, a, b) for (int i = a; i < b; i++)
vector<string> func(string input) {
vector<string> ret;
stringstream ss;
ss << input;
string s;
vector<pair<int, string>> tmp;
while (ss >> s) {
if (s[s.size()... | insert | 70 | 70 | 70 | 72 | MLE | |
p00896 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int n;
vector<string> word;
vector<string> seq;
map<char, int> mp;
map<char, char> conv;
vector<pair<int, char>> ord;
string ans;
int num;
bool check() {
rep(i, seq.size()) {
bool flag = fal... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int n;
vector<string> word;
vector<string> seq;
map<char, int> mp;
map<char, char> conv;
vector<pair<int, char>> ord;
string ans;
int num;
bool check() {
rep(i, seq.size()) {
bool flag = fal... | insert | 66 | 66 | 66 | 68 | TLE | |
p00896 | C++ | Runtime Error | #include <algorithm>
#include <array>
#include <cstdlib>
#include <functional>
#include <iostream>
#include <sstream>
#include <vector>
using namespace std;
constexpr int MAX_M = 50;
constexpr int MAX_LENGTH = 20;
int n, m;
string target;
vector<string> candidates[MAX_LENGTH];
pair<int, string> words[MAX_M];
vector<c... | #include <algorithm>
#include <array>
#include <cstdlib>
#include <functional>
#include <iostream>
#include <sstream>
#include <vector>
using namespace std;
constexpr int MAX_M = 50;
constexpr int MAX_LENGTH = 20;
int n, m;
string target;
vector<string> candidates[MAX_LENGTH + 1];
pair<int, string> words[MAX_M];
vect... | replace | 14 | 15 | 14 | 15 | 0 | |
p00896 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep1(i, n) for (int i = 1; i <= (n); ++i)
#define all(c) (c).begin(), (c).end()
#define fs first
#define sc second
#define pb push_back
#define show(x) cout << #x << " " << x << endl
typedef pair<string, int> Psi;... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep1(i, n) for (int i = 1; i <= (n); ++i)
#define all(c) (c).begin(), (c).end()
#define fs first
#define sc second
#define pb push_back
#define show(x) cout << #x << " " << x << endl
typedef pair<string, int> Psi;... | replace | 23 | 24 | 23 | 33 | TLE | |
p00896 | C++ | Runtime Error | #pragma GCC optimize "O3"
#include <bits/stdc++.h>
using namespace std;
constexpr int N = 20;
int n, ans;
string tmp, ans_rev;
vector<string> words[N + 1], cands[N + 1];
// vector<bool> vis[N+1];
void init() {
for (int i = 0; i <= N; ++i)
words[i].clear(), cands[i].clear(); //, vis[i].clear();
ans = 0;
}
b... | #pragma GCC optimize "O3"
#include <bits/stdc++.h>
using namespace std;
constexpr int N = 20;
int n, ans;
string tmp, ans_rev;
vector<string> words[N + 1], cands[N + 1];
// vector<bool> vis[N+1];
void init() {
for (int i = 0; i <= N; ++i)
words[i].clear(), cands[i].clear(); //, vis[i].clear();
ans = 0;
}
b... | replace | 63 | 64 | 63 | 64 | -11 | |
p00896 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
string t, ans;
vector<string> words, latte[21];
bool rec(int idx, vector<char> &add) {
if (idx == words.size()) {
if (!ans.empty())
return (false);
ans = t;
for (auto &c : ans)
if (isalpha(c))
c = add[c - 'A'];
return (true);
}
... | #include <bits/stdc++.h>
using namespace std;
string t, ans;
vector<string> words, latte[21];
bool rec(int idx, vector<char> &add) {
if (idx == words.size()) {
if (!ans.empty())
return (false);
ans = t;
for (auto &c : ans)
if (isalpha(c))
c = add[c - 'A'];
return (true);
}
... | replace | 58 | 59 | 58 | 60 | TLE | |
p00897 | C++ | Time Limit Exceeded | // 17
#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
struct E {
string t;
int d;
};
struct S {
string v;
int r, d;
bool operator<(S a) const { return d > a.d; }
};
int main() {
for (int n, mm, cap; cin >> n... | // 17
#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
struct E {
string t;
int d;
};
struct S {
string v;
int r, d;
bool operator<(S a) const { return d > a.d; }
};
int main() {
for (int n, mm, cap; cin >> n... | replace | 52 | 53 | 52 | 53 | TLE | |
p00897 | C++ | Runtime Error | #include <algorithm> // other
#include <bitset>
#include <cassert> // c
#include <complex>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream> // io
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <regex>
#include <set>
#include <sstream>
#inclu... | #include <algorithm> // other
#include <bitset>
#include <cassert> // c
#include <complex>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream> // io
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <regex>
#include <set>
#include <sstream>
#inclu... | replace | 226 | 227 | 226 | 227 | 0 | 0 2 335
0 3 174
3 4 176
4 1 195
5 2 215
5 1 296
0 2 335
0 3 174
3 4 176
4 1 195
5 2 215
5 1 296
|
p00897 | C++ | Runtime Error | #include <bits/stdc++.h>
#define INF (1e9)
#define N 3005
#define M 2005
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> P1;
int n, m, cap, d[N][M], n_max;
map<string, int> num;
string src, dest;
vector<P> G[N];
set<int> lpc;
int dijkstra(int s, int g) {
priority_queue<P1, vector<P1>, greater<P1... | #include <bits/stdc++.h>
#define INF (1e9)
#define N 6005
#define M 2005
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> P1;
int n, m, cap, d[N][M], n_max;
map<string, int> num;
string src, dest;
vector<P> G[N];
set<int> lpc;
int dijkstra(int s, int g) {
priority_queue<P1, vector<P1>, greater<P1... | replace | 2 | 3 | 2 | 3 | 0 | |
p00897 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
class Edge {
public:
int to, cost;
Edge(int to, int cost) : to(to), cost(cost){};
};
vector<int> dijkstra(vector<vector<Edge>> &G, int s) {
int N = G.size();
vector<int> d(N, INF);
priority_queue<pair<int, int>, vector<pair<int, int... | #include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
class Edge {
public:
int to, cost;
Edge(int to, int cost) : to(to), cost(cost){};
};
vector<int> dijkstra(vector<vector<Edge>> &G, int s) {
int N = G.size();
vector<int> d(N, INF);
priority_queue<pair<int, int>, vector<pair<int, int... | replace | 49 | 53 | 49 | 57 | 0 | |
p00897 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = a; i < b; i++)
#define INF INT_MAX / 2
int N, M, CAP;
struct Comp {
bool operator()(pair<int, int> a, pair<int, int> b) {
return a.second > b.second;
}
};
// map<int, ll> dist;
// set<int> done;
// int dist[6010][2010];
// bool ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = a; i < b; i++)
#define INF INT_MAX / 2
int N, M, CAP;
struct Comp {
bool operator()(pair<int, int> a, pair<int, int> b) {
return a.second > b.second;
}
};
// map<int, ll> dist;
// set<int> done;
// int dist[6010][2010];
// bool ... | insert | 65 | 65 | 65 | 66 | -11 | |
p00897 | C++ | Runtime Error | #include <algorithm>
#include <array>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <vecto... | #include <algorithm>
#include <array>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <vecto... | replace | 39 | 40 | 39 | 40 | 0 | |
p00897 | C++ | Memory Limit Exceeded | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
typedef long long ll;
int dx[] = {0, 1, 0, -1}, dy[] = {-1, 0, 1, 0};
using namespace std;
struct Edge {
int src, dst;
int weight;
Edge(int s, int d, int w) : src(s),... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
typedef long long ll;
int dx[] = {0, 1, 0, -1}, dy[] = {-1, 0, 1, 0};
using namespace std;
struct Edge {
int src, dst;
int weight;
Edge(int s, int d, int w) : src(s),... | replace | 36 | 37 | 36 | 37 | MLE | |
p00898 | C++ | Memory Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using Int = long long;
typedef pair<Int, Int> P;
template <typename T1, typename T2> inline void chmin(T1 &a, T2 b) {
if (a > b)
a = b;
}
template <typename T1, typename T2> inline void chmax(T1 &a, T2 b) {
if (a < b)
a = b;
}
vector<vector<P>> nx{{P(0, 5), P(... | #include <bits/stdc++.h>
using namespace std;
using Int = long long;
typedef pair<Int, Int> P;
template <typename T1, typename T2> inline void chmin(T1 &a, T2 b) {
if (a > b)
a = b;
}
template <typename T1, typename T2> inline void chmax(T1 &a, T2 b) {
if (a < b)
a = b;
}
vector<vector<P>> nx{{P(0, 5), P(... | replace | 27 | 28 | 27 | 28 | MLE | |
p00898 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <queue>
// #define _DEBUG
using namespace std;
const int kNext[20][3] = {
{5, 1, 4}, // 0
{6, 2, 0}, // 1
{7, 3, 1}, // 2
{8, 4, 2}, // 3
{9, 0, 3}, // 4
{0, 10, 11}, // 5
{1, 11, 12}, // 6
{2, 12, 13}, // 7
{3, 13,... | #include <algorithm>
#include <iostream>
#include <queue>
// #define _DEBUG
using namespace std;
const int kNext[20][3] = {
{5, 1, 4}, // 0
{6, 2, 0}, // 1
{7, 3, 1}, // 2
{8, 4, 2}, // 3
{9, 0, 3}, // 4
{0, 10, 11}, // 5
{1, 11, 12}, // 6
{2, 12, 13}, // 7
{3, 13,... | replace | 41 | 42 | 41 | 42 | -11 | |
p00898 | C++ | Memory Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
void rA(int t[20]) {
int u[20] = {5, 10, 15, 16, 11, 0, 9, 19, 17, 6,
1, 4, 14, 18, 12, 2, 3, 8, 13, 7};
int tmp[20];
for (int i = 0; i < 20; i++)
tmp[i] = t[u[i]];
for (int i = 0; i < 20; i++)
t[i] = tmp[i];
}
void rB(int t[20]) {
int u... | #include <bits/stdc++.h>
using namespace std;
void rA(int t[20]) {
int u[20] = {5, 10, 15, 16, 11, 0, 9, 19, 17, 6,
1, 4, 14, 18, 12, 2, 3, 8, 13, 7};
int tmp[20];
for (int i = 0; i < 20; i++)
tmp[i] = t[u[i]];
for (int i = 0; i < 20; i++)
t[i] = tmp[i];
}
void rB(int t[20]) {
int u... | replace | 77 | 78 | 77 | 78 | MLE | |
p00899 | C++ | Runtime Error | #define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define int ll
using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#defi... | #define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define int ll
using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#defi... | replace | 55 | 56 | 55 | 56 | TLE | |
p00899 | C++ | Runtime Error | ////////////////////////////////////////
/// tu3 pro-con template ///
////////////////////////////////////////
#include "bits/stdc++.h"
using namespace std;
// -- loop macros -- //
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n)-1; i >= 0; i--)
#define FOR(i, s, n) for (... | ////////////////////////////////////////
/// tu3 pro-con template ///
////////////////////////////////////////
#include "bits/stdc++.h"
using namespace std;
// -- loop macros -- //
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n)-1; i >= 0; i--)
#define FOR(i, s, n) for (... | replace | 170 | 172 | 170 | 172 | 0 | |
p00900 | C++ | Memory Limit Exceeded | #include <bits/stdc++.h>
#define int long long
using namespace std;
string s[15];
int h, w;
int t[15][15], A[15][15];
void init() {
memset(t, 0, sizeof(t));
memset(A, 0, sizeof(A));
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
if (s[i][j] != '.' && s[i][j] != '*') {
if (s[... | #include <bits/stdc++.h>
#define int long long
using namespace std;
string s[15];
int h, w;
int t[15][15], A[15][15];
void init() {
memset(t, 0, sizeof(t));
memset(A, 0, sizeof(A));
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
if (s[i][j] != '.' && s[i][j] != '*') {
if (s[... | replace | 121 | 123 | 121 | 127 | MLE | |
p00900 | C++ | Runtime Error | #include <bits/stdc++.h>
#define r(i, n) for (int i = 0; i < n; i++)
#define re(i, n, a) for (int i = a; i < n; i++)
using namespace std;
typedef pair<int, int> P;
int w, h, a[16][16], md = 14, b[16][16], s1, s2;
bool used[16][16];
string s[16];
int dx[] = {-1, -1, -1, 0, 0, 0, 1, 1, 1};
int dy[] = {-1, 0, 1, -1, 0, 1,... | #include <bits/stdc++.h>
#define r(i, n) for (int i = 0; i < n; i++)
#define re(i, n, a) for (int i = a; i < n; i++)
using namespace std;
typedef pair<int, int> P;
int w, h, a[16][16], md = 14, b[16][16], s1, s2;
bool used[16][16];
string s[16];
int dx[] = {-1, -1, -1, 0, 0, 0, 1, 1, 1};
int dy[] = {-1, 0, 1, -1, 0, 1,... | replace | 114 | 116 | 114 | 117 | TLE | |
p00901 | C++ | Runtime Error | #include <cctype>
#include <iostream>
#include <string>
#include <utility>
#include <vector>
using namespace std;
int mod = 2011;
int inv[2011];
int ruijo(int x, int n) {
int p, ans;
if (n == 0)
return 1;
if (n == 1)
return x;
if (n % 2) {
p = ruijo(x, n / 2);
ans = (x * p) % mod;
ans = (... | #include <cctype>
#include <iostream>
#include <string>
#include <utility>
#include <vector>
using namespace std;
int mod = 2011;
int inv[2011];
int ruijo(int x, int n) {
int p, ans;
if (n == 0)
return 1;
if (n == 1)
return x;
if (n % 2) {
p = ruijo(x, n / 2);
ans = (x * p) % mod;
ans = (... | replace | 72 | 74 | 72 | 79 | 0 | |
p00903 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(v) (v).begin(), (v).end()
#define resz(v, ...) (v).clear(), (v).resize(__VA_ARGS__)
#define reps(i, m, n) for (int i = (int)(m); i < (int)(n); i++)
#define rep(i, n) reps(i, 0, n)
template <class T1, class T2> void chmin(T1 &a, T2 b) {
... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(v) (v).begin(), (v).end()
#define resz(v, ...) (v).clear(), (v).resize(__VA_ARGS__)
#define reps(i, m, n) for (int i = (int)(m); i < (int)(n); i++)
#define rep(i, n) reps(i, 0, n)
template <class T1, class T2> void chmin(T1 &a, T2 b) {
... | insert | 51 | 51 | 51 | 52 | 0 | |
p00904 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#includ... | #include <algorithm>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#includ... | replace | 50 | 51 | 50 | 51 | TLE | |
p00904 | 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 | 51 | 53 | 51 | 53 | TLE | |
p00904 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define INF 100000000
typede... | #include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define INF 100000000
typede... | replace | 31 | 32 | 31 | 32 | TLE | |
p00904 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#includ... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#includ... | replace | 164 | 165 | 164 | 165 | TLE | |
p00904 | C++ | Runtime Error | #include <stdio.h>
int cnt[221212];
int X[221212];
int main() {
int i, j;
for (i = -400; i <= 400; i++) {
for (j = i; j <= 400; j++) {
if (i == 0 || j == 0)
cnt[i * i + j * j] += 2;
else
cnt[i * i + j * j]++;
}
}
for (i = 0; i <= 20000; i++) {
for (j = 0; i * j <= 20000 ... | #include <stdio.h>
int cnt[221212];
int X[221212];
int main() {
int i, j;
for (i = -200; i <= 200; i++) {
for (j = i; j <= 200; j++) {
if (i == 0 || j == 0)
cnt[i * i + j * j] += 2;
else
cnt[i * i + j * j]++;
}
}
for (i = 0; i <= 20000; i++) {
for (j = 0; i * j <= 20000 ... | replace | 6 | 8 | 6 | 8 | 0 | |
p00904 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <iostream>
#include <set>
#include <vector>
#define f first
#define s second
using namespace std;
typedef pair<int, int> P;
int gcd(int a, int b) {
if (b == 0)
return a;
return gcd(b, a % b);
}
int main(void) {
int t;
cin >> t;
while (t--) {
int p, ... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <set>
#include <vector>
#define f first
#define s second
using namespace std;
typedef pair<int, int> P;
int gcd(int a, int b) {
if (b == 0)
return a;
return gcd(b, a % b);
}
int main(void) {
int t;
cin >> t;
while (t--) {
int p, ... | replace | 29 | 30 | 29 | 30 | TLE | |
p00904 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int q;
cin >> q;
while (q--) {
int m, n, t, c = 0;
cin >> m >> n;
t = m * m + n * n;
for (int i = 0; i < 10000; i++)
for (int j = 0; j < 10000; j++)
if (i * i + j * j < 1)
continue;
else if ((m * i + n * j) ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int q;
cin >> q;
while (q--) {
int m, n, t, c = 0;
cin >> m >> n;
t = m * m + n * n;
for (int i = 0; i < 2000; i++)
for (int j = 0; j < 2000; j++)
if (i * i + j * j < 1)
continue;
else if ((m * i + n * j) % ... | replace | 9 | 11 | 9 | 11 | TLE | |
p00905 | C++ | Runtime Error | #include <iostream>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
int x[11][3], y[11][3], b[11];
int n, m;
string S[10], T[10];
void init() {
for (int i = 0; i < 33; i++) {
x[i / 3][i % 3] = 0;
y[i / 3][i % 3] = 0;
}
for (int i = 0; i < n; i++) {
x[i + 1][0] = x[i][0];
... | #include <iostream>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
int x[11][3], y[11][3], b[11];
int n, m;
string S[10], T[10];
void init() {
for (int i = 0; i < 33; i++) {
x[i / 3][i % 3] = 0;
y[i / 3][i % 3] = 0;
b[i / 3] = 0;
}
for (int i = 0; i < n; i++) {
x[i + 1][... | insert | 12 | 12 | 12 | 13 | 0 | |
p00906 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cassert>
#include <functional>
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
namespace libcomp {
namespace math {
template <typename T> class Matrix {
private:
int N, M;
vector<vector<T>> data;
template <typena... | #include <algorithm>
#include <cassert>
#include <functional>
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
namespace libcomp {
namespace math {
template <typename T> class Matrix {
private:
int N, M;
vector<vector<T>> data;
template <typena... | insert | 145 | 145 | 145 | 148 | TLE | |
p00907 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
using Array = vector<double>;
using Matrix = vector<Array>;
const double eps = 1e-10;
Array GaussJordan(const Matrix &A, const Array &b) {
int n... | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
using Array = vector<double>;
using Matrix = vector<Array>;
const double eps = 1e-10;
Array GaussJordan(const Matrix &A, const Array &b) {
int n... | replace | 85 | 86 | 85 | 86 | 0 | |
p00907 | C++ | Runtime Error | #include <iostream>
using namespace std;
int D;
double V[5];
double absd(double x) {
if (x < 0) {
return -x;
}
return x;
}
double interpolate(int n, int E) {
double sum = 0.0;
for (int k = 0; k < D + 3; k++) {
if (k == n || k == E) {
continue;
}
double p = V[k];
for (int i ... | #include <iostream>
using namespace std;
int D;
double V[100];
double absd(double x) {
if (x < 0) {
return -x;
}
return x;
}
double interpolate(int n, int E) {
double sum = 0.0;
for (int k = 0; k < D + 3; k++) {
if (k == n || k == E) {
continue;
}
double p = V[k];
for (int ... | replace | 4 | 5 | 4 | 5 | 0 | |
p00908 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define dump(n) cout << "# " << #n << '=' << (n) << endl
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define peri(i, a, b) for (int i = int(b); i-- > int(a);)
#define rep(i, n) repi(i, 0, n)
#define per(i, n) peri(i, 0, n)
#define all(c) begin(c), end(c)
#d... | #include <bits/stdc++.h>
using namespace std;
#define dump(n) cout << "# " << #n << '=' << (n) << endl
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define peri(i, a, b) for (int i = int(b); i-- > int(a);)
#define rep(i, n) repi(i, 0, n)
#define per(i, n) peri(i, 0, n)
#define all(c) begin(c), end(c)
#d... | insert | 72 | 72 | 72 | 74 | TLE | |
p00908 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
typedef pair<int, int> P;
typedef pair<P, P> PP;
int n, m, INF = 1 << 29, dxx[4] = {-1, 0, 1, 0}, dyy[4] = {0, -1, 0, 1};
int dx[8] = {-1, -1, 0, 1, 2, 2, 0, 1}, dy[8] = {0, 1, -1, -1, 0, 1, 2, 2};
string s[55];
bool check(int x, int y) { re... | #include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
typedef pair<int, int> P;
typedef pair<P, P> PP;
int n, m, INF = 1 << 29, dxx[4] = {-1, 0, 1, 0}, dyy[4] = {0, -1, 0, 1};
int dx[8] = {-1, -1, 0, 1, 2, 2, 0, 1}, dy[8] = {0, 1, -1, -1, 0, 1, 2, 2};
string s[55];
bool check(int x, int y) { re... | replace | 69 | 70 | 69 | 70 | TLE | |
p00908 | C++ | Time Limit Exceeded | #include <algorithm>
#include <queue>
#include <stdio.h>
#include <vector>
using namespace std;
char str[60][60];
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
int bfs[60][60];
int ijk[60][60][4];
int v[60][60][4];
int dis[2][2];
int a, b;
int calc(vector<pair<int, int>> st, vector<pair<int, int>> go, int xr, int... | #include <algorithm>
#include <queue>
#include <stdio.h>
#include <vector>
using namespace std;
char str[60][60];
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
int bfs[60][60];
int ijk[60][60][4];
int v[60][60][4];
int dis[2][2];
int a, b;
int calc(vector<pair<int, int>> st, vector<pair<int, int>> go, int xr, int... | insert | 129 | 129 | 129 | 131 | TLE | |
p00909 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
#define fi first
#define se second
#define repl(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
#define rep(i, n) repl(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define dbg(x) cout << #x "=... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
#define fi first
#define se second
#define repl(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
#define rep(i, n) repl(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define dbg(x) cout << #x "=... | insert | 57 | 57 | 57 | 58 | 0 | |
p00909 | C++ | Runtime Error | #include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
// #include<cctype>
#include <climits>
#include <iostream>
#include <map>
#include <string>
#include <vector>
// #include<list>
#include <algorithm>
#include <deque>
#include <queue>
// #include<numeric>
#include <utility>
// #include<memory>
#inc... | #include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
// #include<cctype>
#include <climits>
#include <iostream>
#include <map>
#include <string>
#include <vector>
// #include<list>
#include <algorithm>
#include <deque>
#include <queue>
// #include<numeric>
#include <utility>
// #include<memory>
#inc... | replace | 65 | 66 | 65 | 66 | 0 | |
p00909 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cstdio>
#include <iostream>
using namespace std;
#define MAX_N 100
class union_find {
private:
int parents[MAX_N];
int rank[MAX_N];
int weight[MAX_N];
public:
union_find() {
for (int i = 0; i < MAX_N; i++) {
parents[i] = i;
rank[i] = 0;
we... | #include <algorithm>
#include <bitset>
#include <cstdio>
#include <iostream>
using namespace std;
#define MAX_N 100100
class union_find {
private:
int parents[MAX_N];
int rank[MAX_N];
int weight[MAX_N];
public:
union_find() {
for (int i = 0; i < MAX_N; i++) {
parents[i] = i;
rank[i] = 0;
... | replace | 5 | 6 | 5 | 6 | 0 | |
p00909 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
long long dist[1 << 18];
long long group[1 << 18];
char q;
long long n, Q, a, b, c;
vector<long long> gr[1 << 18];
int main() {
while (true) {
for (int i = 0; i < (1 << 18); i++) {
dist[i] = 0;
group[i] = i;
gr[i].clear();
gr[i].pu... | #include <iostream>
#include <vector>
using namespace std;
long long dist[1 << 18];
long long group[1 << 18];
char q;
long long n, Q, a, b, c;
vector<long long> gr[1 << 18];
int main() {
while (true) {
for (int i = 0; i < (1 << 18); i++) {
dist[i] = 0;
group[i] = i;
gr[i].clear();
gr[i].pu... | replace | 31 | 32 | 31 | 32 | 0 | |
p00909 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define MAX_N 100005
using namespace std;
typedef pair<int, int> P;
P par[MAX_N];
void init(int n) {
for (int i = 0; i < n; i++)
par[i] = P(i, 0);
}
P find(int x) {
if (par[x].first == x)
return P(x, 0);
P r = find(par[x].firs... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define MAX_N 100005
using namespace std;
typedef pair<int, int> P;
P par[MAX_N];
void init(int n) {
for (int i = 0; i < n; i++)
par[i] = P(i, 0);
}
P find(int x) {
if (par[x].first == x)
return P(x, 0);
P r = find(par[x].firs... | insert | 39 | 39 | 39 | 40 | TLE | |
p00912 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define MAX_N 50000
#define INF 100000000
#define MOD 1000000007
#define RANK 1000000000
#define EPS 1e-10
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> IP;
int w, n;
int bit[MAX_N + 1];
int x[MAX_N];
int... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define MAX_N 50000
#define INF 100000000
#define MOD 1000000007
#define RANK 1000000000
#define EPS 1e-10
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> IP;
int w, n;
int bit[MAX_N + 1];
int x[MAX_N];
int... | replace | 61 | 62 | 61 | 62 | TLE | |
p00912 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
array<int, (int)(1e5)> ok;
array<int, (int)(1e5)> oksum;
array<ll, 100000> ubs;
array<ll, 100000> sumx;
bool check(int w, int n, ll sp) {
fill(ok.begin(), ok.begin() + n + 1, false);
fill(oksum.begin(), oksum.begin() + n + 2, false);
ok[n] = tr... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
array<int, (int)(1e5)> ok;
array<int, (int)(1e5)> oksum;
array<ll, 100000> ubs;
array<ll, 100000> sumx;
bool check(int w, int n, ll sp) {
fill(ok.begin(), ok.begin() + n + 1, false);
fill(oksum.begin(), oksum.begin() + n + 2, false);
ok[n] = tr... | replace | 26 | 27 | 26 | 29 | TLE | |
p00912 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <utility>
#include <vector>
using namespace std;
int main() {
for (int W, N; cin >> W >> N, W | N;) {
int x[52345];
for (int i = 0; i < N; i++) {
cin >> x[i];
}
int l = 0, h = 1e9;
while (h - l > 1) {
int m = (h + l) / 2;
vector... | #include <algorithm>
#include <iostream>
#include <utility>
#include <vector>
using namespace std;
int main() {
for (int W, N; cin >> W >> N, W | N;) {
int x[52345];
for (int i = 0; i < N; i++) {
cin >> x[i];
}
int l = 0, h = 1e9;
while (h - l > 1) {
int m = (h + l) / 2;
vector... | insert | 20 | 20 | 20 | 21 | TLE | |
p00912 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
using namespace std;
inline int f(int n, int i, int L, const vector<int> &sum_rev) {
return (sum_rev[i - n] - sum_rev[i]) + L * (n - 1);
}
int dp[50010];
int sum_dp[50010];
int main() {
int W, N;
while (cin >> W >> N && N) {
vec... | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
using namespace std;
inline int f(int n, int i, int L, const vector<int> &sum_rev) {
return (sum_rev[i - n] - sum_rev[i]) + L * (n - 1);
}
int dp[50010];
int sum_dp[50010];
int main() {
int W, N;
while (cin >> W >> N && N) {
vec... | replace | 36 | 37 | 36 | 37 | TLE | |
p00912 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
#define TIMES(i, n) for (int i = 0; i < (n); ++i)
template <class Pred> int binsearch(const Pred &pred) {
int val = 0;
for (int bit = 20; bit >= 0; --bit) {
const int next = val + (1 << bit);
val = pred(next... | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
#define TIMES(i, n) for (int i = 0; i < (n); ++i)
template <class Pred> int binsearch(const Pred &pred) {
int val = 0;
for (int bit = 17; bit >= 0; --bit) {
const int next = val + (1 << bit);
val = pred(next... | replace | 11 | 12 | 11 | 12 | TLE | |
p00913 | C++ | Time Limit Exceeded | #include <algorithm>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <vector>
using namespace std;
char in[3][3][4];
int DIV = 10;
int gcd(int a, int b) {
while (a) {
b %= a;
int c = a;
a = b;
b = c;
}
return b;
}
const double EPS = 1e-10;
const double INF = 1e+10;
const double PI =... | #include <algorithm>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <vector>
using namespace std;
char in[3][3][4];
int DIV = 7;
int gcd(int a, int b) {
while (a) {
b %= a;
int c = a;
a = b;
b = c;
}
return b;
}
const double EPS = 1e-10;
const double INF = 1e+10;
const double PI = ... | replace | 7 | 8 | 7 | 8 | TLE | |
p00914 | C++ | Memory Limit Exceeded | #include <cstring>
#include <iostream>
using namespace std;
int x[100][1000][250], a, b, c, i, j, k, l, sum;
int main() {
while (true) {
sum = 0;
memset(x, 0, sizeof(x));
cin >> a >> b >> c;
if (a == 0) {
break;
}
x[0][0][0] = 1;
for (i = 1; i <= b; i++) {
for (j = 0; j <= c; j... | #include <cstring>
#include <iostream>
using namespace std;
int x[100][1000][150], a, b, c, i, j, k, l, sum;
int main() {
while (true) {
sum = 0;
memset(x, 0, sizeof(x));
cin >> a >> b >> c;
if (a == 0) {
break;
}
x[0][0][0] = 1;
for (i = 1; i <= b; i++) {
for (j = 0; j <= c; j... | replace | 3 | 4 | 3 | 4 | MLE | |
p00914 | C++ | Time Limit Exceeded | #include <iostream>
#include <vector>
using namespace std;
int main(int argc, char *argv[]) {
for (;;) {
int n, k, s;
cin >> n >> k >> s;
if (n == 0 && k == 0 && s == 0)
break;
int cnt = 0;
for (int i = 0; i < 1 << n; i++) {
int c = 0, ss = 0;
while (i != 0) {
int x = i &... | #include <iostream>
#include <vector>
using namespace std;
int main(int argc, char *argv[]) {
for (;;) {
int n, k, s;
cin >> n >> k >> s;
if (n == 0 && k == 0 && s == 0)
break;
int cnt = 0;
for (int i = 0; i < 1 << n; i++) {
int c = 0, ss = 0, ii = i;
while (ii != 0) {
in... | replace | 11 | 15 | 11 | 15 | TLE | |
p00915 | C++ | Runtime Error | #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 <... | delete | 95 | 101 | 95 | 95 | 0 | sec : 1
1 : 1 2
2 : -1 1
3 : -1 4
sec : 2
1 : -1 3
2 : 0 0
3 : 1 3
sec : 3
1 : -1 2
2 : 0 0
3 : 1 4
sec : 4
1 : -1 1
2 : 0 0
3 : 1 5
sec : 1
1 : 1 2
sec : 2
1 : 1 3
sec : 3
1 : 1 4
sec : 4
1 : 1 5
sec : 5
1 : 1 6
sec : 6
1 : 1 7
sec : 7
1 : 1 8
sec : 8
1 : 1 9
sec : 1
1 : -1 6
2 : 1 6
sec : 2
1 : -1 5
2 : 1 7
sec : 3
1... |
p00915 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define REP(i, a, b) for (int i = a; i < (int)b; i++)
#define rep(i, n) REP(i, 0, n)
#define MP make_pair
int main() {
int N, L;
while (cin >> N >> L && (N | L)) {
vector<pair<int, int>> v;
rep(i, N) {
char d;
int p;
cin >> d >> p;
v... | #include <bits/stdc++.h>
using namespace std;
#define REP(i, a, b) for (int i = a; i < (int)b; i++)
#define rep(i, n) REP(i, 0, n)
#define MP make_pair
int main() {
int N, L;
while (cin >> N >> L && (N | L)) {
vector<pair<int, int>> v;
rep(i, N) {
char d;
int p;
cin >> d >> p;
v... | replace | 25 | 28 | 25 | 27 | 0 | |
p00916 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <queue>
#include <utility>
#include <vector>
using namespace std;
typedef pair<int, int> P;
int n;
vector<int> xid, yid;
int fie[401][401];
int l[51], r[51], t[51], b[51];
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
void bfs(int x, int y) {
... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <queue>
#include <utility>
#include <vector>
using namespace std;
typedef pair<int, int> P;
int n;
vector<int> xid, yid;
int fie[401][401];
int l[51], r[51], t[51], b[51];
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
void bfs(int x, int y) {
... | insert | 39 | 39 | 39 | 41 | 0 | |
p00916 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define LOG(...) fprintf(stderr, __VA_ARGS__)
// #define LOG(...)
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define EXI... | #include <bits/stdc++.h>
using namespace std;
#define LOG(...) fprintf(stderr, __VA_ARGS__)
// #define LOG(...)
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define EXI... | replace | 69 | 70 | 69 | 70 | 0 | 1 7 11 3
5 11 7 1
3 9 9 5
1 15 17 3
5 19 3 1
3 7 15 9
7 13 9 7
11 15 17 13
3 5 7 1
1 7 5 3
|
p00916 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define LOG(...) fprintf(stderr, __VA_ARGS__)
// #define LOG(...)
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define RFOR(i, a, b) for (int i = (int)(b - 1); i >= (int)(a); --i)
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define RREP(i, n) fo... | #include <bits/stdc++.h>
using namespace std;
#define LOG(...) fprintf(stderr, __VA_ARGS__)
// #define LOG(...)
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define RFOR(i, a, b) for (int i = (int)(b - 1); i >= (int)(a); --i)
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define RREP(i, n) fo... | replace | 33 | 35 | 33 | 35 | 0 | |
p00918 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define _overload(_1, _2, _3, name, ...) name
#define _rep(i, n) _range(i, 0, n)
#define _range(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define rep(...) _overload(__VA_ARGS__, _range, _rep, )(__VA_ARGS__)
#define _rrep(i, n) _rrange(i, n, 0)
#define _rrange(i, a, b) for (int i = (i... | #include <bits/stdc++.h>
#define _overload(_1, _2, _3, name, ...) name
#define _rep(i, n) _range(i, 0, n)
#define _range(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define rep(...) _overload(__VA_ARGS__, _range, _rep, )(__VA_ARGS__)
#define _rrep(i, n) _rrange(i, n, 0)
#define _rrange(i, a, b) for (int i = (i... | replace | 89 | 90 | 89 | 90 | TLE | |
p00919 | C++ | Memory Limit Exceeded | #include "bits/stdc++.h"
using namespace std;
using ld = long double;
const ld eps = 1e-9;
ld getdis(vector<ld> &l, vector<ld> &r) {
ld sum = 0;
for (int i = 0; i < 3; ++i) {
sum += (l[i] - r[i]) * (l[i] - r[i]);
}
return sqrt(sum);
}
struct po {
int index;
vector<ld> coors;
po(int _d) : coors(_d) {... | #include "bits/stdc++.h"
using namespace std;
using ld = long double;
const ld eps = 1e-9;
ld getdis(vector<ld> &l, vector<ld> &r) {
ld sum = 0;
for (int i = 0; i < 3; ++i) {
sum += (l[i] - r[i]) * (l[i] - r[i]);
}
return sqrt(sum);
}
struct po {
int index;
vector<ld> coors;
po(int _d) : coors(_d) {... | insert | 131 | 131 | 131 | 133 | MLE | |
p00919 | C++ | Memory Limit Exceeded | #include "bits/stdc++.h"
using namespace std;
using ld = long double;
const ld eps = 1e-9;
ld getdis(vector<ld> &l, vector<ld> &r) {
ld sum = 0;
for (int i = 0; i < 3; ++i) {
sum += (l[i] - r[i]) * (l[i] - r[i]);
}
return sqrt(sum);
}
struct po {
int index;
vector<ld> coors;
po(int _d) : coors(_d) {... | #include "bits/stdc++.h"
using namespace std;
using ld = long double;
const ld eps = 1e-9;
ld getdis(vector<ld> &l, vector<ld> &r) {
ld sum = 0;
for (int i = 0; i < 3; ++i) {
sum += (l[i] - r[i]) * (l[i] - r[i]);
}
return sqrt(sum);
}
struct po {
int index;
vector<ld> coors;
po(int _d) : coors(_d) {... | replace | 185 | 189 | 185 | 193 | MLE | |
p00920 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> P;
#define MAX 300005
int m, n, A, B;
int a, b, C = ~(1 << 31), M = (1 << 16) - 1;
int r() {
a = 36969 * (a & M) + (a >> 16);
b = 18000 * (b & M) + (b >> 16);
return (C & ((a << 16) + b)) % 1000000;
}
int x[MAX], y[MAX], z[MAX];
set<P> t[MAX];... | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> P;
#define MAX 300005
int m, n, A, B;
int a, b, C = ~(1 << 31), M = (1 << 16) - 1;
int r() {
a = 36969 * (a & M) + (a >> 16);
b = 18000 * (b & M) + (b >> 16);
return (C & ((a << 16) + b)) % 1000000;
}
int x[MAX], y[MAX], z[MAX];
set<P> t[MAX];... | replace | 84 | 85 | 84 | 86 | TLE | |
p00920 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int a, b, C = ~(1 << 31), M = (1 << 16) - 1;
int r() {
a = 36969 * (a & M) + (a >> 16);
b = 18000 * (b & M) + (b >> 16);
return (C & ((a << 16) + b)) % 1000000;
}
class HappySequence {
public:
map<int, int> seq;
HappySequence() {
int inf = 1e9;
seq[-inf]... | #include <bits/stdc++.h>
using namespace std;
int a, b, C = ~(1 << 31), M = (1 << 16) - 1;
int r() {
a = 36969 * (a & M) + (a >> 16);
b = 18000 * (b & M) + (b >> 16);
return (C & ((a << 16) + b)) % 1000000;
}
class HappySequence {
public:
map<int, int> seq;
HappySequence() {
int inf = 1e9;
seq[-inf]... | replace | 22 | 28 | 22 | 24 | TLE | |
p00920 | C++ | Time Limit Exceeded | #include <algorithm>
#include <stdio.h>
using namespace std;
struct node {
int LT, RT, LB, RB;
int val;
node() {
LT = RT = LB = RB = -1;
val = 0;
}
node(int a, int b, int c, int d, int e) {
LT = a;
RT = b;
LB = c;
RB = d;
val = e;
}
};
node pool[8000000];
int ind;
int Ret;
int no... | #include <algorithm>
#include <stdio.h>
using namespace std;
struct node {
int LT, RT, LB, RB;
int val;
node() {
LT = RT = LB = RB = -1;
val = 0;
}
node(int a, int b, int c, int d, int e) {
LT = a;
RT = b;
LB = c;
RB = d;
val = e;
}
};
node pool[8000000];
int ind;
int Ret;
int no... | replace | 29 | 30 | 29 | 30 | TLE | |
p00923 | C++ | Runtime Error | // very kuso problem
#include <algorithm> // other
#include <bitset>
#include <cassert> // c
#include <complex>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream> // io
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <regex>
#include <set>
#include <sstream>
#... | // very kuso problem
#include <algorithm> // other
#include <bitset>
#include <cassert> // c
#include <complex>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream> // io
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <regex>
#include <set>
#include <sstream>
#... | delete | 352 | 353 | 352 | 352 | TLE | |
p00923 | C++ | Time Limit Exceeded | // very kuso problem
#include <algorithm> // other
#include <bitset>
#include <cassert> // c
#include <complex>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream> // io
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <regex>
#include <set>
#include <sstream>
#... | // very kuso problem
#include <algorithm> // other
#include <bitset>
#include <cassert> // c
#include <complex>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream> // io
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <regex>
#include <set>
#include <sstream>
#... | replace | 26 | 27 | 26 | 30 | TLE | |
p00926 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int dfs(int n, vector<vector<int>> &adj) {
if ((int)adj[n].size() == 0)
return n;
int ret = 0;
for (int i = 0; i < (int)adj[n].size(); i++) {
ret = max(ret, dfs(adj[n][i], adj));
}
return ret;
}
int main() {
int n, m;
... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int dfs(int n, vector<vector<int>> &adj) {
if ((int)adj[n].size() == 0)
return n;
int ret = 0;
for (int i = 0; i < (int)adj[n].size(); i++) {
ret = max(ret, dfs(adj[n][i], adj));
}
adj[n].clear();
return ret;
}
int mai... | insert | 12 | 12 | 12 | 13 | TLE | |
p00927 | C++ | Time Limit Exceeded | #include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <complex>
#include <cassert>
#include <funct... | #include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <complex>
#include <cassert>
#include <funct... | replace | 41 | 42 | 41 | 42 | TLE | |
p00929 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <queue>
#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)
class E {
public:
int come, to, val;
bool check;
E(int come, int to, int val) : come(come),... | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <queue>
#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)
class E {
public:
int come, to, val;
bool check;
E(int come, int to, int val) : come(come),... | replace | 28 | 29 | 28 | 29 | TLE | |
p00929 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <cstring>
#include <iostream>
#include <vector>
using namespace std;
#define whole(xs) (xs).begin(), (xs.end())
int N, M;
struct Edge {
int from, to, cost;
Edge(int from, int to, int cost) : from(from), to(to), cost(cost) {}
bool operator==(const Edge &e) const ... | #include <algorithm>
#include <cassert>
#include <cstring>
#include <iostream>
#include <vector>
using namespace std;
#define whole(xs) (xs).begin(), (xs.end())
int N, M;
struct Edge {
int from, to, cost;
Edge(int from, int to, int cost) : from(from), to(to), cost(cost) {}
bool operator==(const Edge &e) const ... | replace | 75 | 76 | 75 | 76 | 0 | |
p00929 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <utility>
#include <vector>
using namespace std;
struct UnionFind {
int *data;
UnionFind(int *_data, int size, bool reset = true) : data(_data) {
if (reset)
for (int i = 0; i < size; i++)
data[i] = -1;
}
bool unionSet(int x, int y) {
x = fi... | #include <algorithm>
#include <iostream>
#include <utility>
#include <vector>
using namespace std;
struct UnionFind {
int *data;
UnionFind(int *_data, int size, bool reset = true) : data(_data) {
if (reset)
for (int i = 0; i < size; i++)
data[i] = -1;
}
bool unionSet(int x, int y) {
x = fi... | replace | 57 | 58 | 57 | 58 | 0 | |
p00929 | C++ | Time Limit Exceeded | #include <algorithm>
#include <array>
#include <assert.h>
#include <bitset>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <stack>
#include <stdio.h>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
/... | #include <algorithm>
#include <array>
#include <assert.h>
#include <bitset>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <stack>
#include <stdio.h>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
/... | replace | 248 | 250 | 248 | 255 | TLE | |
p00929 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
struct edge {
int from, to, cost;
bool operator<(const edge &p) const { return cost < p.cost; }
};
int pa[1000], ra[1000];
void init() {
for (int i = 0; i < 1000; i++) {
pa[i] = i;
ra[i] = 0;
}
}
int find(int x) {
if (x == pa[x])
return x;
else
... | #include <bits/stdc++.h>
using namespace std;
struct edge {
int from, to, cost;
bool operator<(const edge &p) const { return cost < p.cost; }
};
int pa[1000], ra[1000];
void init() {
for (int i = 0; i < 1000; i++) {
pa[i] = i;
ra[i] = 0;
}
}
int find(int x) {
if (x == pa[x])
return x;
else
... | replace | 36 | 37 | 36 | 37 | 0 | |
p00929 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
class DisjointSet {
private:
vector<int> rank, p;
void link(int x, int y) {
if (rank[x] > rank[y]) {
p[y] = x;
} else {
p[x] = y;
if (rank[x] == rank[y])
rank[y]++;
}
}
public:
DisjointSet(int size) {
... | #include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
class DisjointSet {
private:
vector<int> rank, p;
void link(int x, int y) {
if (rank[x] > rank[y]) {
p[y] = x;
} else {
p[x] = y;
if (rank[x] == rank[y])
rank[y]++;
}
}
public:
DisjointSet(int size) {
... | replace | 42 | 43 | 42 | 43 | 0 | |
p00929 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
const int maxN = 510, maxM = maxN * maxN;
#define FORU(i, l, r) for (int i = l; i <= r; ++i)
#defin... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
const int maxN = 510, maxM = maxN * maxN;
#define FORU(i, l, r) for (int i = l; i <= r; ++i)
#defin... | replace | 39 | 40 | 39 | 42 | TLE | |
p00930 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
struct T;
#define null ((T *)NULL)
typedef int ll;
struct T {
ll v;
ll m;
int c;
T *l, *r;
bool lz;
ll lazy;
T() {}
T(ll v) : v(v), m(v), c(1), l(null), r(null), lz(false), lazy(0) {}
};
int hogeS = 0;
#define SSS 2222222
T hoge[SSS];
inline T *New(int ... | #include <bits/stdc++.h>
using namespace std;
struct T;
#define null ((T *)NULL)
typedef int ll;
struct T {
ll v;
ll m;
int c;
T *l, *r;
bool lz;
ll lazy;
T() {}
T(ll v) : v(v), m(v), c(1), l(null), r(null), lz(false), lazy(0) {}
};
int hogeS = 0;
#define SSS 2222222
T hoge[SSS];
inline T *New(int ... | replace | 50 | 51 | 50 | 51 | -11 | |
p00930 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <map>
using namespace std;
#define MAX 1000100
#define N 3001000
int n, m, qidx;
char str[N];
int minval[MAX], flag[MAX], prefix[MAX];
map<int, int> ridxs;
inline void push_down(int left, int right, int idx) {
if (left == right) {
minval[idx] +=... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <map>
using namespace std;
#define MAX 2000100
#define N 600100
int n, m, qidx;
char str[N];
int minval[MAX], flag[MAX], prefix[MAX];
map<int, int> ridxs;
inline void push_down(int left, int right, int idx) {
if (left == right) {
minval[idx] += ... | replace | 5 | 7 | 5 | 7 | 0 | |
p00930 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> Pi;
struct SegmentTree {
const int INF = 1 << 30;
vector<int> small, add;
int sz;
SegmentTree(int n) {
sz = 1;
while (sz < n)
sz <<= 1;
small.assign(2 * sz - 1, 0);
add.assign(2 * sz - 1, 0);
}
inline void Merge(int... | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> Pi;
struct SegmentTree {
const int INF = 1 << 30;
vector<int> small, add;
int sz;
SegmentTree(int n) {
sz = 1;
while (sz < n)
sz <<= 1;
small.assign(2 * sz - 1, 0);
add.assign(2 * sz - 1, 0);
}
inline void Merge(int... | replace | 50 | 51 | 50 | 51 | 0 | |
p00930 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAX_N = 1 << 17;
const ll INF = 1LL << 50;
struct MinSegTree2 {
static const ll def = INF;
int n;
ll segMin[2 * MAX_N - 1], segAdd[2 * MAX_N - 1];
void init(int n_) {
n = 1;
while (n < n_)
n *= 2;
for (int i = 0; i... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAX_N = 1 << 19;
const ll INF = 1LL << 50;
struct MinSegTree2 {
static const ll def = INF;
int n;
ll segMin[2 * MAX_N - 1], segAdd[2 * MAX_N - 1];
void init(int n_) {
n = 1;
while (n < n_)
n *= 2;
for (int i = 0; i... | replace | 4 | 5 | 4 | 5 | 0 | |
p00930 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <set>
#define MAXN 300010
using namespace std;
struct SegTree {
int left, right, mid, val, add;
SegTree() {}
} tree[MAXN << 1];
char str[MAXN];
int n, q, prefix[MAXN];
inline int LC(int x) { return x << 1; }
in... | #include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <set>
#define MAXN 600010
using namespace std;
struct SegTree {
int left, right, mid, val, add;
SegTree() {}
} tree[MAXN << 1];
char str[MAXN];
int n, q, prefix[MAXN];
inline int LC(int x) { return x << 1; }
in... | replace | 6 | 7 | 6 | 7 | 0 | |
p00930 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
struct T;
#define null ((T *)NULL)
typedef long long ll;
struct T {
ll v;
ll s;
ll m;
int c;
T *l, *r;
bool lz;
ll lazy;
T() {}
T(ll v) : v(v), s(v), m(v), c(1), l(null), r(null), lz(false), lazy(0) {}
};
int hogeS = 0;
#define SSS 2222222
T hoge[SSS]... | #include <bits/stdc++.h>
using namespace std;
struct T;
#define null ((T *)NULL)
typedef long long ll;
struct T {
ll v;
ll s;
ll m;
int c;
T *l, *r;
bool lz;
ll lazy;
T() {}
T(ll v) : v(v), s(v), m(v), c(1), l(null), r(null), lz(false), lazy(0) {}
};
int hogeS = 0;
#define SSS 2222222
T hoge[SSS]... | replace | 130 | 131 | 130 | 131 | -11 | |
p00930 | C++ | Runtime Error | #include <iostream>
#include <set>
#include <string>
#include <vector>
#define inf 1000000000
using namespace std;
struct SegTree {
int size;
vector<int> seg, delay;
SegTree() {}
SegTree(int size) {
this->size = size;
seg.resize(1 << (size + 1));
delay.resize(1 << (size + 1));
}
void init() ... | #include <iostream>
#include <set>
#include <string>
#include <vector>
#define inf 1000000000
using namespace std;
struct SegTree {
int size;
vector<int> seg, delay;
SegTree() {}
SegTree(int size) {
this->size = size;
seg.resize(1 << (size + 1));
delay.resize(1 << (size + 1));
}
void init() ... | replace | 29 | 31 | 29 | 33 | 0 | |
p00935 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
bool vis[100005];
int n, x, a[1005];
int main() {
memset(vis, false, sizeof(vis));
scanf("%d", &n);
for (int i = 1; i <= n; i++)
scanf("%d", &a[i]);
for (int i = 1; i <= n; i++) {
x = 0;
for (int j = 0; j <= min(5, n - ... | #include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
bool vis[100005];
int n, x, a[1005];
int main() {
memset(vis, false, sizeof(vis));
scanf("%d", &n);
for (int i = 1; i <= n; i++)
scanf("%d", &a[i]);
for (int i = 1; i <= n; i++) {
x = 0;
for (int j = 0; j <= min(4, n - ... | replace | 15 | 16 | 15 | 16 | 0 | |
p00935 | C++ | Runtime Error | #include <algorithm>
#include <array>
#include <cassert>
#include <complex>
#include <ctype.h> // isdigit
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <tuple>
#include <vecto... | #include <algorithm>
#include <array>
#include <cassert>
#include <complex>
#include <ctype.h> // isdigit
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <tuple>
#include <vecto... | replace | 52 | 53 | 52 | 53 | 0 | |
p00935 | C++ | Memory Limit Exceeded | #include <algorithm>
#include <array>
#include <assert.h>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <unordered_map>
#include <unordered_s... | #include <algorithm>
#include <array>
#include <assert.h>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <unordered_map>
#include <unordered_s... | insert | 98 | 98 | 98 | 101 | MLE |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.