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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02371 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
struct edge {
int to, cost;
};
vector<edge> g[100000];
long long dist[100000];
void dfs1(int idx, int par) {
for (edge &e : g[idx]) {
if (e.to == par)
continue;
dfs1(e.to, idx);
dist[idx] = max(dist[idx], dist[e.to] + e.cost);
}
}
int dfs2(int i... | #include <bits/stdc++.h>
using namespace std;
struct edge {
int to, cost;
};
vector<edge> g[100000];
long long dist[100000];
void dfs1(int idx, int par) {
for (edge &e : g[idx]) {
if (e.to == par)
continue;
dfs1(e.to, idx);
dist[idx] = max(dist[idx], dist[e.to] + e.cost);
}
}
int dfs2(int i... | replace | 49 | 51 | 49 | 51 | 0 | |
p02371 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
struct edge {
int to;
int cost;
edge(int a, int b) : to(a), cost(b) {}
};
vector<vector<edge>> e;
int N;
pair<int, int> dfs(int p, int par = -1) {
if (e[p].size() == 1 && par >= 0)
return make_pair(0, p);
pair<int, int> res = make_pair(0, 1);
for (auto x... | #include <bits/stdc++.h>
using namespace std;
struct edge {
int to;
int cost;
edge(int a, int b) : to(a), cost(b) {}
};
vector<vector<edge>> e;
int N;
pair<int, int> dfs(int p, int par = -1) {
if (e[p].size() == 1 && par >= 0)
return make_pair(0, p);
pair<int, int> res = make_pair(0, 0);
for (auto x... | replace | 16 | 17 | 16 | 17 | 0 | |
p02372 | C++ | Runtime Error | // clang-format off
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define main signed main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)... | // clang-format off
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define main signed main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)... | replace | 78 | 79 | 78 | 82 | 0 | |
p02372 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include ... | #include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include ... | replace | 33 | 34 | 33 | 34 | TLE | |
p02372 | C++ | Runtime Error | #include <iostream>
#include <utility>
#include <vector>
using namespace std;
int V, E, s, t, w;
vector<vector<pair<int, int>>> v(10001);
int visited[10001] = {0};
int ans[10001] = {0}, d[10001] = {0};
void di(int n) {
visited[n] = 1;
for (int i = 0; i < v[n].size(); i++) {
if (visited[v[n][i].first] == 0) {
... | #include <iostream>
#include <utility>
#include <vector>
using namespace std;
int V, E, s, t, w;
vector<vector<pair<int, int>>> v(10001);
int visited[10001] = {0};
int ans[10001] = {0}, d[10001] = {0};
void di(int n) {
visited[n] = 1;
for (int i = 0; i < v[n].size(); i++) {
if (visited[v[n][i].first] == 0) {
... | replace | 37 | 38 | 37 | 38 | 0 | |
p02372 | C++ | Runtime Error | #include <bits/stdc++.h>
using Int = int64_t;
using UInt = uint64_t;
using C = std::complex<double>;
#define rep(i, n) for (Int i = 0; i < (Int)(n); ++i)
#define guard(x) \
if (not(x)) \
... | #include <bits/stdc++.h>
using Int = int64_t;
using UInt = uint64_t;
using C = std::complex<double>;
#define rep(i, n) for (Int i = 0; i < (Int)(n); ++i)
#define guard(x) \
if (not(x)) \
... | replace | 27 | 31 | 27 | 33 | -11 | |
p02372 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <queue>
#include <vector>
#define REP(i, n) for (int i = 0; i < (int)n; ++i)
#define FOR(i, c) \
for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define I... | #include <algorithm>
#include <cstdio>
#include <queue>
#include <vector>
#define REP(i, n) for (int i = 0; i < (int)n; ++i)
#define FOR(i, c) \
for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define I... | replace | 62 | 63 | 62 | 63 | 0 | |
p02373 | C++ | Memory Limit Exceeded | // Lowest Common Ancestor
// 最小共通先祖
// 二部探索を用いる方法
/*
int main(){
int n; cin >> n;
vector<int> a(n);
for(int i = 0; i < n; i++) cin >> a[i];
a = max(a, b);
a = max(max(a, b), max(c, d));
}*/
#include <bits/stdc++.h>
using namespace std;
#define MAX_V 100010
#define MAX_LOG_V 500
vector<int> G[MAX_V... | // Lowest Common Ancestor
// 最小共通先祖
// 二部探索を用いる方法
/*
int main(){
int n; cin >> n;
vector<int> a(n);
for(int i = 0; i < n; i++) cin >> a[i];
a = max(a, b);
a = max(max(a, b), max(c, d));
}*/
#include <bits/stdc++.h>
using namespace std;
#define MAX_V 100010
#define MAX_LOG_V 100
vector<int> G[MAX_V... | replace | 16 | 17 | 16 | 17 | MLE | |
p02373 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <vector>
#define REP(i, n) for (int i = 0; i < int(n); ++i)
#define FOR(i, a, b) for (int i = int(a); i < int(b); ++i)
#define EACH(i, c) \
for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#d... | #include <algorithm>
#include <iostream>
#include <vector>
#define REP(i, n) for (int i = 0; i < int(n); ++i)
#define FOR(i, a, b) for (int i = int(a); i < int(b); ++i)
#define EACH(i, c) \
for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#d... | replace | 22 | 24 | 22 | 24 | 0 | |
p02373 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <vector>
#define REP(i, n) for (int i = 0; i < int(n); ++i)
#define FOR(i, a, b) for (int i = int(a); i < int(b); ++i)
#define EACH(i, c) \
for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#d... | #include <algorithm>
#include <iostream>
#include <vector>
#define REP(i, n) for (int i = 0; i < int(n); ++i)
#define FOR(i, a, b) for (int i = int(a); i < int(b); ++i)
#define EACH(i, c) \
for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#d... | replace | 24 | 25 | 24 | 25 | 0 | |
p02373 | C++ | Runtime Error | #include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdlib>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include... | #include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdlib>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include... | insert | 271 | 271 | 271 | 273 | 0 | |
p02373 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
// BEGIN CUT HERE
struct LowestCommonAncestor {
const int MAX_LOG_V = 50;
vector<vector<int>> G, parent;
int root = 0, V;
vector<int> depth;
LowestCommonAncestor() {}
LowestCommonAncestor(int V) : V(V) { init(); }
void init() {
for ... | #include <bits/stdc++.h>
using namespace std;
#define int long long
// BEGIN CUT HERE
struct LowestCommonAncestor {
const int MAX_LOG_V = 50;
vector<vector<int>> G, parent;
int root = 0, V;
vector<int> depth;
LowestCommonAncestor() {}
LowestCommonAncestor(int V) : V(V) { init(); }
void init() {
for ... | insert | 75 | 75 | 75 | 76 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p02373 | C++ | Runtime Error | #include <cassert>
#include <cmath>
#include <cstdio>
#include <stack>
#include <vector>
#define repeat(i, n) for (int i = 0; (i) < int(n); ++(i))
#define repeat_reverse(i, n) for (int i = (n)-1; (i) >= 0; --(i))
using namespace std;
/**
* @brief lowest common ancestor with doubling
*/
struct lowest_common_ancestor ... | #include <cassert>
#include <cmath>
#include <cstdio>
#include <stack>
#include <vector>
#define repeat(i, n) for (int i = 0; (i) < int(n); ++(i))
#define repeat_reverse(i, n) for (int i = (n)-1; (i) >= 0; --(i))
using namespace std;
/**
* @brief lowest common ancestor with doubling
*/
struct lowest_common_ancestor ... | replace | 21 | 22 | 21 | 22 | 0 | |
p02373 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
int N; // Graph(Tree)の頂点数
vector<vector<int>> G; // Graph(Tree)の隣接リスト表現
vector<int> D; // 各頂点のrootからの距離
int LOG_N; // log2(N)の天井
vector<vector<int>> P; // P[k][v] : 頂点v... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
int N; // Graph(Tree)の頂点数
vector<vector<int>> G; // Graph(Tree)の隣接リスト表現
vector<int> D; // 各頂点のrootからの距離
int LOG_N; // log2(N)の天井
vector<vector<int>> P; // P[k][v] : 頂点v... | replace | 24 | 25 | 24 | 25 | 0 | |
p02373 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
//?????????
#pragma region MACRO
#define putans(x) \
std::cerr << "[ answer ]: "; \
cout << (x) << endl
#define dputans(x) ... | #include "bits/stdc++.h"
using namespace std;
//?????????
#pragma region MACRO
#define putans(x) \
std::cerr << "[ answer ]: "; \
cout << (x) << endl
#define dputans(x) ... | replace | 75 | 76 | 75 | 76 | 0 | |
p02373 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define GET_MACRO(_1, _2, _3, NAME, ...) NAME
#define _repl(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define _rep(i, n) _repl(i, 0, n)
#define rep(...) GET_MACRO(__VA_ARGS__, _repl, _rep)(__VA_ARGS__)
#define mp(a, b) make_pair((a), (b))
#define pb(a) push_back((a... | #include <bits/stdc++.h>
using namespace std;
#define GET_MACRO(_1, _2, _3, NAME, ...) NAME
#define _repl(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define _rep(i, n) _repl(i, 0, n)
#define rep(...) GET_MACRO(__VA_ARGS__, _repl, _rep)(__VA_ARGS__)
#define mp(a, b) make_pair((a), (b))
#define pb(a) push_back((a... | replace | 42 | 43 | 42 | 43 | 0 | |
p02373 | C++ | Memory Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef vector<vii> vvii;
typedef vector<int>::iterator vit;
const int MAXN = 100005;
const int LOGN = 50;
int idx[MAXN]; // i : index of node i in dfs path
ii ... | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef vector<vii> vvii;
typedef vector<int>::iterator vit;
const int MAXN = 100005;
const int LOGN = 20;
int idx[MAXN]; // i : index of node i in dfs path
ii ... | replace | 13 | 14 | 13 | 14 | MLE | |
p02373 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
const int MAXN = 100005;
int path[2 * MAXN], depth[2 * MAXN],
idx[MAXN]; // idx : the index of node in dfs path
int par[MAXN];
vi adjList[MAXN];
class SparseTable {
private:
int n, h;
vvi t;
int combine(int l, ... | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
const int MAXN = 100005;
int path[2 * MAXN], depth[2 * MAXN],
idx[MAXN]; // idx : the index of node in dfs path
int par[MAXN];
vi adjList[MAXN];
class SparseTable {
private:
int n, h;
vvi t;
int combine(int l, ... | replace | 29 | 30 | 29 | 30 | 0 | |
p02373 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <vector>
#define REP(i, n) for (int i = 0; i < int(n); ++i)
#define FOR(i, a, b) for (int i = int(a); i < int(b); ++i)
#define EACH(i, c) \
for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#d... | #include <algorithm>
#include <iostream>
#include <vector>
#define REP(i, n) for (int i = 0; i < int(n); ++i)
#define FOR(i, a, b) for (int i = int(a); i < int(b); ++i)
#define EACH(i, c) \
for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#d... | replace | 13 | 14 | 13 | 14 | 0 | |
p02373 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using Int = long long;
// BEGIN CUT HERE
struct HLDecomposition {
int n, pos;
vector<vector<int>> G;
vector<int> vid, head, sub, hvy, par, dep, inv, type, ps, pt;
HLDecomposition() {}
HLDecomposition(int sz)
: n(sz), pos(0), G(n), vid(n, -1), head(n), sub(n... | #include <bits/stdc++.h>
using namespace std;
using Int = long long;
// BEGIN CUT HERE
struct HLDecomposition {
int n, pos;
vector<vector<int>> G;
vector<int> vid, head, sub, hvy, par, dep, inv, type, ps, pt;
HLDecomposition() {}
HLDecomposition(int sz)
: n(sz), pos(0), G(n), vid(n, -1), head(n), sub(n... | replace | 80 | 81 | 80 | 81 | TLE | |
p02373 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <vector>
#define REP(i, n) for (int i = 0; i < int(n); ++i)
#define FOR(i, a, b) for (int i = int(a); i < int(b); ++i)
#define EACH(i, c) \
for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#d... | #include <algorithm>
#include <iostream>
#include <vector>
#define REP(i, n) for (int i = 0; i < int(n); ++i)
#define FOR(i, a, b) for (int i = int(a); i < int(b); ++i)
#define EACH(i, c) \
for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#d... | replace | 13 | 14 | 13 | 14 | 0 | |
p02373 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <vector>
#define REP(i, n) for (int i = 0; i < int(n); ++i)
#define FOR(i, a, b) for (int i = int(a); i < int(b); ++i)
#define EACH(i, c) \
for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#d... | #include <algorithm>
#include <iostream>
#include <vector>
#define REP(i, n) for (int i = 0; i < int(n); ++i)
#define FOR(i, a, b) for (int i = int(a); i < int(b); ++i)
#define EACH(i, c) \
for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#d... | replace | 17 | 18 | 17 | 18 | 0 | |
p02373 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long // <-----!!!!!!!!!!!!!!!!!!!
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define rrep2(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define al... | #include <bits/stdc++.h>
using namespace std;
#define int long long // <-----!!!!!!!!!!!!!!!!!!!
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define rrep2(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define al... | replace | 37 | 38 | 37 | 38 | 0 | 0 -1 0
1 0 1
4 1 2
5 1 2
6 5 3
7 5 3
2 0 1
3 0 1
|
p02373 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
const int MAX = 1e5;
pii table[17][MAX * 2 - 1];
int n;
vector<int> G[MAX];
int id[MAX];
int it = 0;
void dfs(int v, int d) {
id[v] = it;
table[0][it++] = {d, v};
for (auto to : G[v]) {
dfs(to, d + 1);
table[0][it++] = {d, v};
... | #include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
const int MAX = 1e5;
pii table[18][MAX * 2 - 1];
int n;
vector<int> G[MAX];
int id[MAX];
int it = 0;
void dfs(int v, int d) {
id[v] = it;
table[0][it++] = {d, v};
for (auto to : G[v]) {
dfs(to, d + 1);
table[0][it++] = {d, v};
... | replace | 5 | 6 | 5 | 6 | 0 | |
p02373 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
struct LowestCommonAncestor {
LowestCommonAncestor(size_t size)
: size(size), G(size), dep(size), par(MaxlgV, vector<int>(size)) {}
size_t size, MaxlgV = 30;
int root;
vector<vector<int>> G, par;
vector<int> dep;
void add_edge(int u, int v) {
G[u].p... | #include <bits/stdc++.h>
using namespace std;
struct LowestCommonAncestor {
LowestCommonAncestor(size_t size)
: size(size), G(size), dep(size), par(MaxlgV, vector<int>(size)) {}
size_t size, MaxlgV = 30;
int root;
vector<vector<int>> G, par;
vector<int> dep;
void add_edge(int u, int v) {
G[u].p... | delete | 15 | 17 | 15 | 15 | 0 | 0 <-> 1
0 <-> 2
0 <-> 3
1 <-> 4
1 <-> 5
5 <-> 6
5 <-> 7
|
p02373 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
template <typename T> class SparseTable {
int n;
vector<vector<T>> t;
T merge(const T &l, const T &r) { return min(l, r); }
public:
SparseTable(const vector<T> &b) {
n = b.size();
t.push_back(b);
for (int i = 2, j = 1; i <= ... | #include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
template <typename T> class SparseTable {
int n;
vector<vector<T>> t;
T merge(const T &l, const T &r) { return min(l, r); }
public:
SparseTable(const vector<T> &b) {
n = b.size();
t.push_back(b);
for (int i = 2, j = 1; i <= ... | replace | 22 | 23 | 22 | 23 | 0 | |
p02373 | C++ | Memory Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
struct LowestCommonAncestor {
LowestCommonAncestor(size_t size)
: size(size), MaxlgV(1 << (32 - __builtin_clz(size - 1))), G(size),
dep(size), par(MaxlgV, vector<int>(size)) {}
size_t size, MaxlgV;
int root;
vector<vector<int>> G, par;
vector<int> ... | #include <bits/stdc++.h>
using namespace std;
struct LowestCommonAncestor {
LowestCommonAncestor(size_t size)
: size(size), MaxlgV(32 - __builtin_clz(size - 1)), G(size), dep(size),
par(MaxlgV, vector<int>(size)) {}
size_t size, MaxlgV;
int root;
vector<vector<int>> G, par;
vector<int> dep;
... | replace | 5 | 7 | 5 | 7 | MLE | |
p02373 | C++ | Time Limit Exceeded | #include <algorithm>
#include <array>
#include <cstdio>
#include <functional>
#include <iostream>
#include <list>
#include <numeric>
#include <queue>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define _USE_MATH_DEFINES
#include <map>
#include <math.h>
#define SENTINEL 1... | #include <algorithm>
#include <array>
#include <cstdio>
#include <functional>
#include <iostream>
#include <list>
#include <numeric>
#include <queue>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define _USE_MATH_DEFINES
#include <map>
#include <math.h>
#define SENTINEL 1... | delete | 19 | 22 | 19 | 19 | TLE | |
p02373 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
struct LCA {
int N, logN; // logN-1 == floor(lg(N-1))
vector<vector<int>> G;
vector<int> depth;
// vから根の方向に2^k回登ったときのノード parent[k][v]
vector<vector<int>> parent;
LCA(int size) : N(size), G(size), depth(size) {
logN = 0;
... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
struct LCA {
int N, logN; // logN-1 == floor(lg(N-1))
vector<vector<int>> G;
vector<int> depth;
// vから根の方向に2^k回登ったときのノード parent[k][v]
vector<vector<int>> parent;
LCA(int size) : N(size), G(size), depth(size) {
logN = 1;
... | replace | 13 | 14 | 13 | 14 | 0 | |
p02373 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <stack>
#include <utility>
#include <vector>
using namespace std;
struct LCA {
int N, logN; // logN-1 == floor(lg(N-1))
vector<vector<int>> G;
vector<int> depth;
// vから根の方向に2^k回登ったときのノード parent[k][v]
vector<vector<int>> parent;
LCA(int size) : N(size), G(s... | #include <algorithm>
#include <iostream>
#include <stack>
#include <utility>
#include <vector>
using namespace std;
struct LCA {
int N, logN; // logN-1 == floor(lg(N-1))
vector<vector<int>> G;
vector<int> depth;
// vから根の方向に2^k回登ったときのノード parent[k][v]
vector<vector<int>> parent;
LCA(int size) : N(size), G(s... | insert | 18 | 18 | 18 | 19 | 0 | |
p02373 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
typedef pair<int, int> pii;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define MAX_V 10000
vector<int> G[MAX_V];
vector<int> depth, vs;
int id[MAX_V] = {};
template <class T> class segtree {
private:
v... | #include "bits/stdc++.h"
using namespace std;
typedef pair<int, int> pii;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define MAX_V 100000
vector<int> G[MAX_V];
vector<int> depth, vs;
int id[MAX_V] = {};
template <class T> class segtree {
private:
... | replace | 6 | 7 | 6 | 7 | 0 | |
p02373 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cassert>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const int B = 20;
int color[100010], par[100010], depth[100010];
int top[100010];
int goUp[100010];
bool vis[100010];
int n;
vector<vector<int>> g;
... | #include <algorithm>
#include <cassert>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const int B = 310;
int color[100010], par[100010], depth[100010];
int top[100010];
int goUp[100010];
bool vis[100010];
int n;
vector<vector<int>> g;
... | replace | 9 | 10 | 9 | 10 | TLE | |
p02373 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef... | #include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef... | replace | 193 | 194 | 193 | 194 | 0 | |
p02373 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
class LCA {
int n;
vector<int> dep;
vector<vector<int>> par;
Graph g;
const int LOGN_MAX = 100;
void setDep(int v, int d, Graph &tree) {
dep[v] = d;
for (int i = 0; i < tree[v].size(); i++)
setDep(tree[v][i], d +... | #include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
class LCA {
int n;
vector<int> dep;
vector<vector<int>> par;
Graph g;
const int LOGN_MAX = 100;
void setDep(int v, int d, Graph &tree) {
dep[v] = d;
for (int i = 0; i < tree[v].size(); i++)
setDep(tree[v][i], d +... | replace | 19 | 20 | 19 | 20 | 0 | |
p02373 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = (a); i < (int)(b); ++i)
using pii = pair<int, int>;
using vvi = vector<vector<int>>;
using vi = vector<int>;
#define sz(x) ((int)x.size())
struct UnionFind {
vi data;
int comp;
UnionFind() {}
UnionFind(int size) { init(size); }
... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = (a); i < (int)(b); ++i)
using pii = pair<int, int>;
using vvi = vector<vector<int>>;
using vi = vector<int>;
#define sz(x) ((int)x.size())
struct UnionFind {
vi data;
int comp;
UnionFind() {}
UnionFind(int size) { init(size); }
... | replace | 50 | 52 | 50 | 52 | -11 | |
p02373 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <climits>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#... | #include <algorithm>
#include <bitset>
#include <climits>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#... | replace | 67 | 68 | 67 | 68 | 0 | |
p02373 | C++ | Memory Limit Exceeded | #include <algorithm>
#include <bits/stdc++.h>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < ((int)(n)); i++)
#define reg(i, a, b) f... | #include <algorithm>
#include <bits/stdc++.h>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < ((int)(n)); i++)
#define reg(i, a, b) f... | insert | 61 | 61 | 61 | 62 | MLE | |
p02373 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < b; i++)
#define fore(i, a) for (auto &i : a)
#pragma GCC optimize("-O3")
using namespace std;
void _main();
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
_main();
}
//-------------------------------------------------------------------------... | #include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < b; i++)
#define fore(i, a) for (auto &i : a)
#pragma GCC optimize("-O3")
using namespace std;
void _main();
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
_main();
}
//-------------------------------------------------------------------------... | replace | 22 | 23 | 22 | 23 | 0 | |
p02373 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
template <typename Monoid> struct DisjointSparseTable {
using F = function<Monoid(Monoid, Monoid)>;
const F &f;
vector<vector<Monoid>> st;
DisjointSparseTable(const vector<Monoid> &v, const F &f) : f(f) {
int b = 0;
while ((1 << b) <= v.size())
++b... | #include <bits/stdc++.h>
using namespace std;
template <typename Monoid> struct DisjointSparseTable {
using F = function<Monoid(Monoid, Monoid)>;
const F &f;
vector<vector<Monoid>> st;
DisjointSparseTable(const vector<Monoid> &v, const F &f) : f(f) {
int b = 0;
while ((1 << b) <= v.size())
++b... | replace | 35 | 36 | 35 | 36 | 0 | |
p02373 | C++ | Memory Limit Exceeded | #include <bits/stdc++.h>
#define MAXV 1000000
#define MAXLV 20
using namespace std;
vector<int> e[MAXV];
int n, root = 0;
int parent[MAXLV][MAXV];
int depth[MAXV];
void dfs(int v, int p, int d) {
parent[0][v] = p;
depth[v] = d;
for (int i = 0; i < e[v].size(); i++) {
if (e[v][i] != p)
dfs(e[v][i], v,... | #include <bits/stdc++.h>
#define MAXV 100010
#define MAXLV 20
using namespace std;
vector<int> e[MAXV];
int n, root = 0;
int parent[MAXLV][MAXV];
int depth[MAXV];
void dfs(int v, int p, int d) {
parent[0][v] = p;
depth[v] = d;
for (int i = 0; i < e[v].size(); i++) {
if (e[v][i] != p)
dfs(e[v][i], v, ... | replace | 1 | 2 | 1 | 2 | MLE | |
p02374 | C++ | Runtime Error | #include <cmath>
#include <cstdio>
#include <vector>
using namespace std;
void dfs(vector<vector<int>> &childLists, vector<vector<int>> &edgeIds,
vector<int> &weights, const int &v) {
for (int i = 0; i < childLists[v].size(); i++) {
int u = childLists[v][i];
weights.push_back(0);
edgeIds[u].push... | #include <cmath>
#include <cstdio>
#include <vector>
using namespace std;
void dfs(vector<vector<int>> &childLists, vector<vector<int>> &edgeIds,
vector<int> &weights, const int &v) {
for (int i = 0; i < childLists[v].size(); i++) {
int u = childLists[v][i];
weights.push_back(0);
edgeIds[u].push... | replace | 72 | 73 | 72 | 74 | 0 | |
p02376 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
const int maxN = 3e2 + 100;
int n, m, st, fn;
int cap[maxN][maxN], excess[maxN], height[maxN];
vector<int> g[maxN];
set<pair<int, int>> candidates;
void input() {
cin >> n >> m;
// cin>>st>>fn;
st = 1;
fn = n;
for (int i = 1; i <= m; i++) {
int k1, k2, val;
... | #include <bits/stdc++.h>
using namespace std;
const int maxN = 3e2 + 100;
int n, m, st, fn;
int cap[maxN][maxN], excess[maxN], height[maxN];
vector<int> g[maxN];
set<pair<int, int>> candidates;
void input() {
cin >> n >> m;
// cin>>st>>fn;
st = 1;
fn = n;
for (int i = 1; i <= m; i++) {
int k1, k2, val;
... | insert | 52 | 52 | 52 | 54 | TLE | |
p02376 | C++ | Runtime Error | #include <bits/stdc++.h>
#define INF 1000000000
#define MAX_V 100
#define MAX_E 1000
using namespace std;
struct edge {
int to, cap, rev;
edge(int to_, int cap_, int rev_) : to(to_), cap(cap_), rev(rev_){};
};
int V, E;
vector<edge> G[MAX_V];
int level[MAX_V];
int iter[MAX_V];
void AddEdge(int from, int to, int c... | #include <bits/stdc++.h>
#define INF 1000000000
#define MAX_V 100
#define MAX_E 1000
using namespace std;
struct edge {
int to, cap, rev;
edge(int to_, int cap_, int rev_) : to(to_), cap(cap_), rev(rev_){};
};
int V, E;
vector<edge> G[MAX_V];
int level[MAX_V];
int iter[MAX_V];
void AddEdge(int from, int to, int c... | replace | 30 | 31 | 30 | 31 | 0 | |
p02376 | C++ | Runtime Error | #define _CRT_SECURE_NO_WARNINGS
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define range(i, a, b) for (int i = a; i < (int)(b); i++)
#define rep(i, b) range(i, 0, b)
typedef int Capacity;
struct Edge {
int src, dst;
Capacity cap;
Edge(int src_, int dst_, int cap_) : src(src_), dst(ds... | #define _CRT_SECURE_NO_WARNINGS
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define range(i, a, b) for (int i = a; i < (int)(b); i++)
#define rep(i, b) range(i, 0, b)
typedef int Capacity;
struct Edge {
int src, dst;
Capacity cap;
Edge(int src_, int dst_, int cap_) : src(src_), dst(ds... | replace | 35 | 37 | 35 | 41 | 0 | |
p02376 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <vector>
#define REP(i, n) for (int i = 0; i < (n); i++)
using namespace std;
const int INF = 1e9;
struct edge {
int to, cap, rev;
edge(int to, int cap, int rev) : to(to), cap(cap), rev(rev) {}
};
int v, e;
vector<vector<edge>> G; //??°???????????£??\???????????¨... | #include <algorithm>
#include <iostream>
#include <vector>
#define REP(i, n) for (int i = 0; i < (n); i++)
using namespace std;
const int INF = 1e9;
struct edge {
int to, cap, rev;
edge(int to, int cap, int rev) : to(to), cap(cap), rev(rev) {}
};
int v, e;
vector<vector<edge>> G; //??°???????????£??\???????????¨... | replace | 49 | 50 | 49 | 50 | 0 | |
p02376 | C++ | Runtime Error | /* Дан неориентированный связный граф.
* Требуется найти вес минимального остовного дерева в этом графе с помощью
* алгоритма Борувки.*/
// T(N, M) = O(|E|log|V|)
// M(N, M) = O(|V| + |E|)
#include <bits/stdc++.h>
using namespace std;
const int INF = 2000000000; // константа, отвечающая за "бесконечность".
typedef u... | /* Дан неориентированный связный граф.
* Требуется найти вес минимального остовного дерева в этом графе с помощью
* алгоритма Борувки.*/
// T(N, M) = O(|E|log|V|)
// M(N, M) = O(|V| + |E|)
#include <bits/stdc++.h>
using namespace std;
const int INF = 2000000000; // константа, отвечающая за "бесконечность".
typedef u... | replace | 57 | 58 | 57 | 58 | -11 | |
p02376 | C++ | Runtime Error | // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define forever for (;;)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecisio... | // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define forever for (;;)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecisio... | replace | 81 | 82 | 81 | 82 | -11 | |
p02376 | C++ | Time Limit Exceeded |
#include <cinttypes>
#include <iostream>
#include <limits>
#include <memory>
#include <vector>
const std::size_t InfiniteSize = std::numeric_limits<std::size_t>::max();
template <typename T> class Network {
protected:
virtual void setSource(std::size_t source) = 0;
virtual void setTarget(std::size_t target) = 0;... |
#include <cinttypes>
#include <iostream>
#include <limits>
#include <memory>
#include <vector>
const std::size_t InfiniteSize = std::numeric_limits<std::size_t>::max();
template <typename T> class Network {
protected:
virtual void setSource(std::size_t source) = 0;
virtual void setTarget(std::size_t target) = 0;... | replace | 526 | 527 | 526 | 527 | TLE | |
p02376 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < ((int)b); ++i)
#define RFOR(i, a) for (int i = (a); i >= 0; --i)
#define FOE(i, a) for (auto i : a)
#define ALL(c) (c).begin(), (c).end()
#define RALL(c) (c).rbegin(), (c).rend()
#define DUMP(x) cerr << #x << " = " << (x) << endl;
#define SUM(x) std::... | #include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < ((int)b); ++i)
#define RFOR(i, a) for (int i = (a); i >= 0; --i)
#define FOE(i, a) for (auto i : a)
#define ALL(c) (c).begin(), (c).end()
#define RALL(c) (c).rbegin(), (c).rend()
#define DUMP(x) cerr << #x << " = " << (x) << endl;
#define SUM(x) std::... | replace | 119 | 120 | 119 | 120 | TLE | |
p02376 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
using ll = long long;
using ld = long double;
#define int ll
#define INF 1e9
#define EPS 0.0000000001
#define rep... | #include <bits/stdc++.h>
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
using ll = long long;
using ld = long double;
#define int ll
#define INF 1e9
#define EPS 0.0000000001
#define rep... | insert | 102 | 102 | 102 | 103 | TLE | |
p02376 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef pair<int, int> pii;
const int INF = 0x3fffffff;
class Flow {
public:
int N;
vector<vector<int>> F, C, edge;
Flow(int n, int e)
: F(n, vector<int>(n)), C(n, vector<int>(... | #include <algorithm>
#include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef pair<int, int> pii;
const int INF = 0x3fffffff;
class Flow {
public:
int N;
vector<vector<int>> F, C, edge;
Flow(int n, int e)
: F(n, vector<int>(n)), C(n, vector<int>(... | replace | 16 | 17 | 16 | 17 | 0 | |
p02376 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef pair<int, int> pii;
const int INF = 0x3fffffff;
class Flow {
public:
int N, en;
vector<int> C, F;
vector<vector<pii>> edge;
Flow(int n, int e) : C(e + 1), F(e + 1), N(n), e... | #include <algorithm>
#include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef pair<int, int> pii;
const int INF = 0x3fffffff;
class Flow {
public:
int N, en;
vector<int> C, F;
vector<vector<pii>> edge;
Flow(int n, int e) : C(e + 1), F(e + 1), N(n), e... | replace | 23 | 24 | 23 | 24 | TLE | |
p02376 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#pragma warning(disable : 4996)
#ifdef _MSC_VER
#define __builtin_popcount __popcnt
#endif
#define int long long
using namespace std;
using ll = long long;
using ld = long double;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
inline void my_io() {
std::ios::sync_with_stdio(false);
... | #include <bits/stdc++.h>
#pragma warning(disable : 4996)
#ifdef _MSC_VER
#define __builtin_popcount __popcnt
#endif
#define int long long
using namespace std;
using ll = long long;
using ld = long double;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
inline void my_io() {
std::ios::sync_with_stdio(false);
... | replace | 51 | 52 | 51 | 52 | TLE | |
p02376 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
#define INF (1 << 29)
#define max_n 10000
using namespace std;
struct edge {
int to, cap, rev;
};
struct LinkCutTree {
vector<int> left, right, parent, val, mini, minId, lazy;
vector<edge *> edges;
LinkCutTree(int n, int v)
:... | #include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
#define INF (1 << 29)
#define max_n 10000
using namespace std;
struct edge {
int to, cap, rev;
};
struct LinkCutTree {
vector<int> left, right, parent, val, mini, minId, lazy;
vector<edge *> edges;
LinkCutTree(int n, int v)
:... | replace | 61 | 64 | 61 | 65 | TLE | |
p02376 | C++ | Runtime Error | #include <algorithm>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <queue>
#include <string>
#include <vector>
// УБРАТЬ!
using namespace std;
// Net class:
template <class Edge> class Net {
private:
typedef Edge *EdgePointer;
typedef pair<EdgePointer, EdgePo... | #include <algorithm>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <queue>
#include <string>
#include <vector>
// УБРАТЬ!
using namespace std;
// Net class:
template <class Edge> class Net {
private:
typedef Edge *EdgePointer;
typedef pair<EdgePointer, EdgePo... | replace | 738 | 742 | 738 | 742 | -11 | |
p02376 | C++ | Time Limit Exceeded | #include <cstdio>
#include <vector>
struct Edge {
Edge(int from_, int to_, int capacity_, int rev_)
: from(from_), to(to_), capacity(capacity_), rev(rev_) {}
int from;
int to;
int capacity;
int rev;
};
std::vector<Edge> edges[128];
void addEdge(int from, int to, int capacity) {
int e1 = edges[from].... | #include <cstdio>
#include <vector>
struct Edge {
Edge(int from_, int to_, int capacity_, int rev_)
: from(from_), to(to_), capacity(capacity_), rev(rev_) {}
int from;
int to;
int capacity;
int rev;
};
std::vector<Edge> edges[128];
void addEdge(int from, int to, int capacity) {
int e1 = edges[from].... | replace | 43 | 44 | 43 | 44 | TLE | |
p02376 | C++ | Runtime Error | #include <algorithm>
#include <list>
#include <stdio.h>
#include <vector>
using namespace std;
typedef vector<int> VInt;
typedef vector<VInt> VVInt;
typedef list<int> LInt;
typedef vector<LInt> VLInt;
typedef LInt::iterator LIter;
typedef vector<LIter> VLIter;
// Input: the network
int n, src, dest;
VVInt c;
// Out... | #include <algorithm>
#include <list>
#include <stdio.h>
#include <vector>
using namespace std;
typedef vector<int> VInt;
typedef vector<VInt> VVInt;
typedef list<int> LInt;
typedef vector<LInt> VLInt;
typedef LInt::iterator LIter;
typedef vector<LIter> VLIter;
// Input: the network
int n, src, dest;
VVInt c;
// Out... | replace | 112 | 113 | 112 | 113 | -11 | |
p02377 | C++ | Runtime Error | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
// #include "MyMath.h"
// #include "MyDisjointset.h"
#include <algorithm>
#include <functional>
#include <iostream>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <string.h>
#include <vector>
using namespace std;
typedef pair<int, int> P;
typedef... | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
// #include "MyMath.h"
// #include "MyDisjointset.h"
#include <algorithm>
#include <functional>
#include <iostream>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <string.h>
#include <vector>
using namespace std;
typedef pair<int, int> P;
typedef... | replace | 29 | 31 | 29 | 31 | 0 | |
p02377 | C++ | Memory Limit Exceeded | #include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#define repd(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) r... | #include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#define repd(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) r... | replace | 51 | 52 | 51 | 52 | MLE | |
p02377 | C++ | Runtime Error | #include <cmath>
#include <cstddef>
#include <iostream>
#include <limits>
#include <queue>
#include <stdexcept>
#include <type_traits>
#include <utility>
#include <vector>
namespace loquat {
using vertex_t = size_t;
}
namespace loquat {
namespace edge_param {
struct to_ {
vertex_t to;
explicit to_(vertex_t t = 0) :... | #include <cmath>
#include <cstddef>
#include <iostream>
#include <limits>
#include <queue>
#include <stdexcept>
#include <type_traits>
#include <utility>
#include <vector>
namespace loquat {
using vertex_t = size_t;
}
namespace loquat {
namespace edge_param {
struct to_ {
vertex_t to;
explicit to_(vertex_t t = 0) :... | replace | 337 | 339 | 337 | 344 | 0 | |
p02378 | C++ | Runtime Error | #include <cstdio>
#include <cstring>
#include <vector>
using namespace std;
static const int MAX_V = 100;
static const int MAX_K = 1000;
int V;
vector<int> G[MAX_V];
int match[MAX_V];
bool used[MAX_V];
void add_edge(int u, int v) {
G[u].push_back(v);
G[v].push_back(u);
}
bool dfs(int v) {
used[v] = true;
for... | #include <cstdio>
#include <cstring>
#include <vector>
using namespace std;
static const int MAX_V = 100;
static const int MAX_K = 1000;
int V;
vector<int> G[MAX_V * 2];
int match[MAX_V * 2];
bool used[MAX_V * 2];
void add_edge(int u, int v) {
G[u].push_back(v);
G[v].push_back(u);
}
bool dfs(int v) {
used[v] =... | replace | 8 | 11 | 8 | 11 | 0 | |
p02378 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <s... | #include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <s... | replace | 33 | 34 | 33 | 34 | 0 | |
p02378 | C++ | Runtime Error | // include
//------------------------------------------
#include <algorithm>
#include <bitset>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#inc... | // include
//------------------------------------------
#include <algorithm>
#include <bitset>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#inc... | replace | 613 | 614 | 613 | 614 | 0 | |
p02378 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
const int N = 2e2 + 10, M = 1e4 + 10;
int x, y, n, m, ans, s, t, mark[M], vis[N], adj[N][N];
bool dfs(int v) {
vis[v] = 1;
if (v == t)
return 1;
for (int i = 0; i < n; i++) {
if (adj[v][i] == -1)
continue;
if (!vis[i]... | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
const int N = 2e2 + 10, M = 1e4 + 10;
int x, y, n, m, ans, s, t, mark[M], vis[N], adj[N][N];
bool dfs(int v) {
vis[v] = 1;
if (v == t)
return 1;
for (int i = 0; i < n; i++) {
if (adj[v][i] == -1)
continue;
if (!vis[i]... | insert | 32 | 32 | 32 | 35 | TLE | |
p02378 | C++ | Runtime Error | #include <algorithm>
#include <cstring>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
const int MAX = 100;
const int MAX_cap = 10000;
class edge {
public:
int to, cap, rev;
edge() {}
edge(int to, int cap, int rev) : to(to), cap(cap), rev(rev) {}
};
vector<edge> G[MAX];
bool used[... | #include <algorithm>
#include <cstring>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
const int MAX = 200;
const int MAX_cap = 10000;
class edge {
public:
int to, cap, rev;
edge() {}
edge(int to, int cap, int rev) : to(to), cap(cap), rev(rev) {}
};
vector<edge> G[MAX];
bool used[... | replace | 8 | 9 | 8 | 9 | 0 | |
p02378 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <string.h>
#include <vector>
#define MAX_V 100
#define INF 1000
using namespace std;
int V, M; // 頂点,辺の数
vector<int> G[MAX_V]; // グラフの隣接リスト表現
int match[MAX_V]; // マッチングのペア
bool used[MAX_V]; // DFSですでに調べたかのフラグ
// uとvを結ぶ辺をグラフに追加する
void add_edge(int u... | #include <algorithm>
#include <iostream>
#include <string.h>
#include <vector>
#define MAX_V 100000
#define INF 100000000
using namespace std;
int V, M; // 頂点,辺の数
vector<int> G[MAX_V]; // グラフの隣接リスト表現
int match[MAX_V]; // マッチングのペア
bool used[MAX_V]; // DFSですでに調べたかのフラグ
// uとvを結ぶ辺をグラフに追加する
void add_ed... | replace | 4 | 6 | 4 | 6 | 0 | |
p02378 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; ++i)
#define FOR(i, a, b) ... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; ++i)
#define FOR(i, a, b) ... | replace | 79 | 80 | 79 | 81 | TLE | |
p02378 | C++ | Runtime Error | #include <bits/stdc++.h>
#define range(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, b) for (int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x) cerr << #x << " = " << (x) << endl;
#define debug(x) \
cerr << #x << " = "... | #include <bits/stdc++.h>
#define range(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, b) for (int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x) cerr << #x << " = " << (x) << endl;
#define debug(x) \
cerr << #x << " = "... | replace | 11 | 14 | 11 | 14 | 0 | |
p02378 | C++ | Runtime Error | #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
#define... | #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
#define... | replace | 36 | 37 | 36 | 37 | 0 | |
p02378 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <queue>
#include <vector>
using namespace std;
const int maxv = 100 + 10;
int N, M, E;
vector<int> g[maxv];
int vis[maxv];
int match[maxv];
void add_edge(int from, int to) {
g[fro... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <queue>
#include <vector>
using namespace std;
const int maxv = 2 * (100 + 10);
int N, M, E;
vector<int> g[maxv];
int vis[maxv];
int match[maxv];
void add_edge(int from, int to) {
... | replace | 10 | 11 | 10 | 11 | 0 | |
p02378 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using LL = long long;
using VL = vector<LL>;
using VVL = vector<VL>;
using PLL = pair<LL, LL>;
using VS = vector<string>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) (a).rbegin(), (a).rend... | #include <bits/stdc++.h>
using namespace std;
using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using LL = long long;
using VL = vector<LL>;
using VVL = vector<VL>;
using PLL = pair<LL, LL>;
using VS = vector<string>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) (a).rbegin(), (a).rend... | replace | 83 | 84 | 83 | 84 | TLE | |
p02378 | C++ | Runtime Error | #include <cstring>
#include <iostream>
#include <vector>
using namespace std;
// ------ Variable ------ //
#define MAX_V 100
int V;
vector<int> G[MAX_V];
int match[MAX_V];
bool used[MAX_V];
// ------ Bipartite_Matching ------ //
bool search(int v) {
used[v] = true;
for (int i = 0; i < G[v].size(); i++) {
... | #include <cstring>
#include <iostream>
#include <vector>
using namespace std;
// ------ Variable ------ //
#define MAX_V 200
int V;
vector<int> G[MAX_V];
int match[MAX_V];
bool used[MAX_V];
// ------ Bipartite_Matching ------ //
bool search(int v) {
used[v] = true;
for (int i = 0; i < G[v].size(); i++) {
... | replace | 8 | 9 | 8 | 9 | 0 | |
p02378 | C++ | Runtime Error | // this program solves bipartite matching using
// maximum flow algorithm
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
const int N = 220;
const int M = 20010;
struct Edge {
int to, cap, next;
} es[M];
int S, T; // source, sink
int SIZE = 0; // number of edges
... | // this program solves bipartite matching using
// maximum flow algorithm
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
const int N = 220;
const int M = 22000;
struct Edge {
int to, cap, next;
} es[M];
int S, T; // source, sink
int SIZE = 0; // number of edges
... | replace | 9 | 10 | 9 | 10 | 0 | |
p02378 | C++ | Runtime Error | #include <cstring>
#include <iostream>
#include <vector>
using namespace std;
vector<int> list[100000];
int N, M, E;
int match[100000];
bool used[100000];
int x, y;
bool DFS(int V) {
used[V] = true;
for (int i = 0; i < list[V].size(); i++) {
int u = list[V][i];
int w = match[u];
if (w < 0 || !used[u] &... | #include <cstring>
#include <iostream>
#include <vector>
using namespace std;
vector<int> list[100000];
int N, M, E;
int match[100000];
bool used[100000];
int x, y;
bool DFS(int V) {
used[V] = true;
for (int i = 0; i < list[V].size(); i++) {
int u = list[V][i];
int w = match[u];
if (w < 0 || !used[w] &... | replace | 15 | 16 | 15 | 16 | -11 | |
p02379 | Python | Runtime Error | import math
x1, y1, x2, y2 = map(int, input().split())
print(f"{math.sqrt((x2-x1)**2+(y2-y1)**2):.8f}")
| import math
x1, y1, x2, y2 = map(float, input().split())
print(f"{math.sqrt((x2-x1)**2+(y2-y1)**2):.8f}")
| replace | 2 | 3 | 2 | 3 | 0 | |
p02379 | Python | Runtime Error | x1, y1, x2, y2 = map(int, input().split())
print("%.8f" % (((x2 - x1) ** 2 + (y2 - y1) ** 2)) ** 0.5)
| x1, y1, x2, y2 = map(float, input().split())
print("%.8f" % (((x2 - x1) ** 2 + (y2 - y1) ** 2)) ** 0.5)
| replace | 0 | 1 | 0 | 1 | 0 | |
p02379 | C++ | Time Limit Exceeded | #include <stdio.h>
#ifndef DEBUG
#define fprintf (void)
#endif
double absval(double x);
int main(void) {
double x1, y1, x2, y2;
double b = 0;
int n;
scanf("%lf", &x1);
scanf("%lf", &y1);
scanf("%lf", &x2);
scanf("%lf", &y2);
double dx = absval(x1 - x2);
double dy = absval(y1 - y2);
double x = d... | #include <stdio.h>
#ifndef DEBUG
#define fprintf (void)
#endif
double absval(double x);
int main(void) {
double x1, y1, x2, y2;
double b = 0;
int n;
scanf("%lf", &x1);
scanf("%lf", &y1);
scanf("%lf", &x2);
scanf("%lf", &y2);
double dx = absval(x1 - x2);
double dy = absval(y1 - y2);
double x = d... | replace | 28 | 29 | 28 | 29 | TLE | |
p02379 | Python | Runtime Error | # -*- coding: utf-8 -*-
import math
x1, y1, x2, y2 = map(int, input().split())
dis = math.sqrt((x1 + x2) * (x1 + x2) + (y1 + y2) * (y1 + y2))
print(dis)
| # -*- coding: utf-8 -*-
import math
x1, y1, x2, y2 = map(float, input().split())
dis = math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2))
print(dis)
| replace | 4 | 6 | 4 | 6 | 0 | |
p02381 | Python | Runtime Error | from statistics import pstdev
while True:
data_count = int(input())
if data_count == 0:
break
print(pstdev(sum(int(x) for x in input().split())))
| from statistics import pstdev
while True:
data_count = int(input())
if data_count == 0:
break
print(pstdev(int(x) for x in input().split()))
| replace | 6 | 7 | 6 | 7 | TypeError: 'int' object is not iterable | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02381/Python/s197979549.py", line 6, in <module>
print(pstdev(sum(int(x) for x in input().split())))
File "/usr/lib/python3.10/statistics.py", line 847, in pstdev
var = pvariance(data, mu)
File "/usr/li... |
p02381 | C++ | Runtime Error | #include <cmath>
#include <cstdio>
#include <iostream>
using namespace std;
typedef long long ll;
int main() {
int n;
int score[100];
double stdev;
double a;
while (true) {
double sum1 = 0, sum2 = 0, ave = 0;
cin >> n;
if (n == 0) {
break;
} else {
for (int i = 0; i < n; ++i) ... | #include <cmath>
#include <cstdio>
#include <iostream>
using namespace std;
typedef long long ll;
int main() {
int n;
int score[1000];
double stdev;
double a;
while (true) {
double sum1 = 0, sum2 = 0, ave = 0;
cin >> n;
if (n == 0) {
break;
} else {
for (int i = 0; i < n; ++i)... | replace | 9 | 10 | 9 | 10 | 0 | |
p02381 | C++ | Time Limit Exceeded | #include <cmath>
#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
int n, s[99];
double ave, hensa[99], sum = 0;
cin >> n;
while (n != 0) {
for (int i = 0; n > i; i++) {
cin >> s[i];
sum += s[i];
}
ave = sum / n;
sum = 0;
for (int i = 0; n > i; i++) {
... | #include <cmath>
#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
int n;
while (cin >> n, n != 0) {
double ave, hensa[99], sum = 0, s[999];
for (int i = 0; n > i; i++) {
cin >> s[i];
sum += s[i];
}
ave = sum / n;
sum = 0;
for (int i = 0; n > i; i++) {
... | replace | 6 | 10 | 6 | 9 | TLE | |
p02381 | C++ | Runtime Error | #include <cmath>
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
int n, s[100];
while (cin >> n, n) {
for (int i = 0; i < n; i++) {
cin >> s[i];
}
int sum = 0;
for (int i = 0; i < n; i++) {
sum += s[i];
}
double m = 1.0 * sum / n;
double t = 0;
... | #include <cmath>
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
int n, s[1000];
while (cin >> n, n) {
for (int i = 0; i < n; i++) {
cin >> s[i];
}
int sum = 0;
for (int i = 0; i < n; i++) {
sum += s[i];
}
double m = 1.0 * sum / n;
double t = 0;
... | replace | 6 | 7 | 6 | 7 | 0 | |
p02381 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
double b, s[100], n;
long x;
while (1) {
cin >> n;
if (n == 0)
break;
x = 0;
for (int i = 0; i < n; i++) {
cin >> s[i];
x += s[i];
}
double m = x / n;
b = 0;
for (int i = 0; i < n; i++) {
b += (s[i]... | #include <bits/stdc++.h>
using namespace std;
int main() {
double b, s[1000], n, x;
while (1) {
cin >> n;
if (n == 0)
break;
x = 0;
for (int i = 0; i < n; i++) {
cin >> s[i];
x += s[i];
}
double m = x / n;
b = 0;
for (int i = 0; i < n; i++) {
b += (s[i] - m) ... | replace | 4 | 6 | 4 | 5 | 0 | |
p02381 | C++ | Runtime Error | #include <iostream>
using namespace std;
#include <cmath>
int main() {
double m, n, a, s[100];
for (int j = 0; j < 100; j++) {
cin >> n;
if (n == 0)
break;
m = 0;
a = 0;
for (int i = 0; i < n; i++) {
cin >> s[i];
m += s[i];
}
m /= n;
for (int i = 0; i < n; i++) {
... | #include <iostream>
using namespace std;
#include <cmath>
int main() {
double m, n, a, s[1000];
for (int j = 0; j < 100; j++) {
cin >> n;
if (n == 0)
break;
m = 0;
a = 0;
for (int i = 0; i < n; i++) {
cin >> s[i];
m += s[i];
}
m /= n;
for (int i = 0; i < n; i++) {
... | replace | 5 | 6 | 5 | 6 | 0 | |
p02381 | C++ | Time Limit Exceeded | #include <iomanip>
#include <iostream>
#include <math.h>
using namespace std;
int main(void) {
int n;
int *score;
double ave, S;
while (true) {
cin >> n;
score = new int[n];
S = ave = 0.0;
for (int i = 0; i < n; i++) {
cin >> score[i];
ave += score[i];
}
ave /= n;
fo... | #include <iomanip>
#include <iostream>
#include <math.h>
using namespace std;
int main(void) {
int n;
int *score;
double ave, S;
while (true) {
cin >> n;
if (n == 0)
break;
score = new int[n];
S = ave = 0.0;
for (int i = 0; i < n; i++) {
cin >> score[i];
ave += score[i... | insert | 12 | 12 | 12 | 15 | TLE | |
p02381 | C++ | Runtime Error | #include <cmath>
#include <iostream>
#include <string>
using namespace std;
int main() {
int n;
float m, tmp;
int s[100] = {};
while (true) {
cin >> n;
if (n == 0)
break;
m = 0;
for (int i = 0; i < n; i++) {
cin >> s[i];
m += s[i];
}
m /= n;
tmp = 0;
for (int i... | #include <cmath>
#include <iostream>
#include <string>
using namespace std;
int main() {
int n;
float m, tmp;
int s[1000] = {};
while (true) {
cin >> n;
if (n == 0)
break;
m = 0;
for (int i = 0; i < n; i++) {
cin >> s[i];
m += s[i];
}
m /= n;
tmp = 0;
for (int ... | replace | 8 | 9 | 8 | 9 | 0 | |
p02381 | C++ | Runtime Error | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <queue>
#include <string>
#include <utility>
#include <vector>
#define INF 2147483647
using namespace std;
int main() {
... | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <queue>
#include <string>
#include <utility>
#include <vector>
#define INF 2147483647
using namespace std;
int main() {
... | replace | 18 | 19 | 18 | 19 | 0 | |
p02381 | C++ | Runtime Error | #include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <string>
using namespace std;
int main() {
int n, s[100];
double m, a2;
while (1) {
scanf("%d\n", &n);
if (n == 0)
return 0;
m = 0;
a2 = 0;
for (int i = 0; i < n;... | #include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <string>
using namespace std;
int main() {
int n, s[1000];
double m, a2;
while (1) {
scanf("%d\n", &n);
if (n == 0)
return 0;
m = 0;
a2 = 0;
for (int i = 0; i < n... | replace | 12 | 13 | 12 | 13 | 0 | |
p02381 | C++ | Runtime Error | #include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;
int main() {
while (true) {
int n;
cin >> n;
if (n == 0)
break;
double s[100], a = 0, m = 0;
for (int i = 0; i < n; i++) {
cin >> s[i];
m += s[i];
}
m /= n;
for (int i = 0; i < n; i++)
... | #include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;
int main() {
while (true) {
int n;
cin >> n;
if (n == 0)
break;
double s[1000], a = 0, m = 0;
for (int i = 0; i < n; i++) {
cin >> s[i];
m += s[i];
}
m /= n;
for (int i = 0; i < n; i++)
... | replace | 11 | 12 | 11 | 12 | 0 | |
p02381 | C++ | Runtime Error | #include <iostream>
#include <math.h>
#include <stdio.h>
#include <vector>
using namespace std;
int main() {
vector<int> v(100, 0);
int i, n, sum;
double a = 0;
while (cin >> n, n != 0) {
for (i = 0; i < n; i++) {
cin >> v[i];
sum += v[i];
}
double m = (double)sum / (double)n;
fo... | #include <iostream>
#include <math.h>
#include <stdio.h>
#include <vector>
using namespace std;
int main() {
vector<int> v(1024, 0);
int i, n, sum;
double a = 0;
while (cin >> n, n != 0) {
for (i = 0; i < n; i++) {
cin >> v[i];
sum += v[i];
}
double m = (double)sum / (double)n;
f... | replace | 7 | 8 | 7 | 8 | 0 | |
p02381 | C++ | Time Limit Exceeded | #include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;
int main() {
int n;
long double ave; //??????
long double sum1 = 0; //????¨????
long double sum2 = 0;
int s[100] = {0}; //??????
long double a; //?????£
while (1) {
cin >> n;
if (n == 0)
break;
for (int... | #include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;
int main() {
int n;
long double ave; //??????
long double sum1 = 0; //????¨????
long double sum2 = 0;
int s[1000] = {0}; //??????
long double a; //?????£
while (1) {
cin >> n;
if (n == 0)
break;
for (i... | replace | 9 | 11 | 9 | 11 | TLE | |
p02381 | C++ | Runtime Error | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>
const int inf = 0x7fffffff;
typedef long long int ll;
using namespace std;
const int N ... | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>
const int inf = 0x7fffffff;
typedef long long int ll;
using namespace std;
const int N ... | replace | 16 | 17 | 16 | 17 | 0 | |
p02381 | C++ | Runtime Error | #include <cmath>
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
int n;
double s[100], a, m;
while (1) {
cin >> n;
if (n == 0)
break;
double all = 0, z = 0;
for (int i = 0; i < n; i++) {
cin >> s[i];
all += s[i];
}
m = all / n;
for (int ... | #include <cmath>
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
int n;
double s[1000], a, m;
while (1) {
cin >> n;
if (n == 0)
break;
double all = 0, z = 0;
for (int i = 0; i < n; i++) {
cin >> s[i];
all += s[i];
}
m = all / n;
for (int... | replace | 7 | 8 | 7 | 8 | 0 | |
p02381 | C++ | Time Limit Exceeded | #include <iomanip>
#include <iostream>
#include <math.h>
using namespace std;
int main() {
int n, s[100], i, j;
double a, m;
while (1) {
cin >> n;
if (!n)
break;
m = a = 0;
for (i = 0; i < n; i++) {
cin >> s[i];
m += s[i];
}
m /= n;
for (i = 0; i < n; i++) {
a ... | #include <iomanip>
#include <iostream>
#include <math.h>
using namespace std;
int main() {
int n, s[1000], i, j;
double a, m;
while (1) {
cin >> n;
if (!n)
break;
m = a = 0;
for (i = 0; i < n; i++) {
cin >> s[i];
m += s[i];
}
m /= n;
for (i = 0; i < n; i++) {
a... | replace | 6 | 7 | 6 | 7 | TLE | |
p02381 | C++ | Time Limit Exceeded | #include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;
int main() {
int n, s[110];
double ave, sum, alpha;
while (1) {
ave = 0;
sum = 0;
alpha = 0;
cin >> n;
if (n == 0)
break;
for (int i = 0; i < n; i++) {
cin >> s[i];
sum += s[i];
}
ave = ... | #include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;
int main() {
int n, s[1010];
double ave, sum, alpha;
while (1) {
ave = 0;
sum = 0;
alpha = 0;
cin >> n;
if (n == 0)
break;
for (int i = 0; i < n; i++) {
cin >> s[i];
sum += s[i];
}
ave =... | replace | 6 | 7 | 6 | 7 | TLE | |
p02381 | C++ | Runtime Error | #include <iostream>
#include <math.h>
#include <stdio.h>
using namespace std;
int main() {
int n;
double s[105];
while (cin >> n && n != 0) {
double sum = 0;
for (int i = 0; i < n; i++) {
cin >> s[i];
sum += s[i];
}
double avg = sum / n;
sum = 0;
for (int i = 0; i < n; i++) {
... | #include <iostream>
#include <math.h>
#include <stdio.h>
using namespace std;
int main() {
int n;
double s[1005];
while (cin >> n && n != 0) {
double sum = 0;
for (int i = 0; i < n; i++) {
cin >> s[i];
sum += s[i];
}
double avg = sum / n;
sum = 0;
for (int i = 0; i < n; i++) {... | replace | 7 | 8 | 7 | 8 | 0 | |
p02381 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
while (n) {
int s[n];
double sum = 0;
for (int i = 0; i < n; i++) {
cin >> s[i];
sum += s[i];
}
double ave = sum / n;
sum = 0.0;
for (int i = 0; i < n; i++)
sum += (s[i] - ave) * (s[i] - ave);... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
while (n) {
int s[n];
double sum = 0;
for (int i = 0; i < n; i++) {
cin >> s[i];
sum += s[i];
}
double ave = sum / n;
sum = 0.0;
for (int i = 0; i < n; i++)
sum += (s[i] - ave) * (s[i] - ave);... | insert | 17 | 17 | 17 | 18 | TLE | |
p02381 | C++ | Runtime Error | #include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;
int main(void) {
int n, s[101], i;
double m, a2, a;
cin >> n;
while (n != 0) {
m = 0;
a2 = 0;
for (i = 0; i < n; i++) {
cin >> s[i];
m += s[i];
}
m = m / n;
for (i = 0; i < n; i++) {
a2 += (s[... | #include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;
int main(void) {
long int n, s[1001], i;
double m, a2, a;
cin >> n;
while (n != 0) {
m = 0;
a2 = 0;
for (i = 0; i < n; i++) {
cin >> s[i];
m += s[i];
}
m = m / n;
for (i = 0; i < n; i++) {
a2 ... | replace | 5 | 6 | 5 | 6 | 0 | |
p02381 | C++ | Runtime Error | #include <math.h>
#include <stdio.h>
#include <string.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
int main() {
int n;
while (1) {
scanf("%d", &n);
if (n == 0)
break;
double s[101] = {0}, ave = 0, a = 0;
rep(i, 0, n) {
scanf("%lf", &s[i]);
ave += s[i];
}
ave /= (dou... | #include <math.h>
#include <stdio.h>
#include <string.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
int main() {
int n;
while (1) {
scanf("%d", &n);
if (n == 0)
break;
double s[1001] = {0}, ave = 0, a = 0;
rep(i, 0, n) {
scanf("%lf", &s[i]);
ave += s[i];
}
ave /= (do... | replace | 11 | 12 | 11 | 12 | 0 | |
p02381 | C++ | Time Limit Exceeded | #include <cmath>
#include <iostream>
#include <stdio.h>
using namespace std;
int main(void) {
// Here your code !
int n, s[100];
double m, A;
while (1) {
cin >> n;
if (n == 0)
break;
m = 0;
A = 0;
for (int i = 0; i < n; i++) {
cin >> s[i];
m = m + s[i];
}
m = m / ... | #include <cmath>
#include <iostream>
#include <stdio.h>
using namespace std;
int main(void) {
// Here your code !
int n, s[1000];
double m, A;
while (1) {
cin >> n;
if (n == 0)
break;
m = 0;
A = 0;
for (int i = 0; i < n; i++) {
cin >> s[i];
m = m + s[i];
}
m = m /... | replace | 7 | 8 | 7 | 8 | TLE |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.