Search is not available for this dataset
name stringlengths 2 88 | description stringlengths 31 8.62k | public_tests dict | private_tests dict | solution_type stringclasses 2
values | programming_language stringclasses 5
values | solution stringlengths 1 983k |
|---|---|---|---|---|---|---|
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
const int INF = 100000000;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
using namespace std;
struct FordFulkerson {
struct Edge {
int to, cap, rev;
Edge(int to = 0, int cap = 0, int rev = 0) : to(to), cap(cap), rev(rev) {}
};
int V;
vector<vector<Edge> > G;
vector<boo... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-8;
const int tx[] = {0, 1, 0, -1};
const int ty[] = {-1, 0, 1, 0};
struct Node {
int to;
int idx;
long long flow;
Node(int to, int idx, long long flow) : to(to), idx(idx), flow(flow) {}
};
class FordFulkerson {
private:
vector<Node>* ... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct node {
int u, v, c;
int next;
} edge[150 * 150];
int mat[150][150], vis[150][150];
int e, head[150], ans;
int n, m, inde, dfn[150], low[150];
int fa[150];
void unit(int f, int t, int c) {
edge[e].u = f;
edge[e].v = t;
edge[e].c = c;
edge[e].next = head[f]... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
template <class T>
void debug(T begin, T end) {
for (T i = begin; i != end; ++i) cerr << *i << " ";
cerr << endl;
}
inline bool valid(int x, int y, int W, int H) {
return (x >= 0 && y >= 0 && x < W && y < H);
}
const int INF = 100000000;
const double EPS = 1e-8;
const... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-8;
const int tx[] = {0, 1, 0, -1};
const int ty[] = {-1, 0, 1, 0};
struct Node {
int to;
int idx;
int flow;
Node(int to, int idx, int flow) : to(to), idx(idx), flow(flow) {}
};
class FordFulkerson {
private:
vector<Node>* _graph;
bo... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
const int INF = 100000000;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
using namespace std;
struct UnionFind {
int size_;
std::vector<int> par;
std::vector<int> rank;
UnionFind(int size_) : size_(size_) {
par.resize(size_);
rank.resize(size_);
for (int i = 0; i < s... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }
int bsr(int x) { return 31 - __builtin_clz(x); }
template <class E>
using Graph = vector<vector<E>>;
template <class D, D INF>
struct BidirectedCut {
D... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const long long MAX = LONG_LONG_MAX;
long long V, E;
bool used[101];
long long cnt;
struct Edge {
long long to, cost;
Edge() {}
Edge(long long _t, long long _c) : to(_t), cost(_c) {}
};
vector<Edge> G[101];
int f, t;
void check(long long x) {
if (used[x]) return;
... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int maxN = 110;
const int oo = 2147483647;
int n, m;
struct EE {
int v, ne, c;
} e[100010];
struct XX {
int a, b, c;
} x[10010];
int e_si, st, ed, N, head[maxN], cur[maxN], low[maxN], pre[maxN], pree[maxN],
d[maxN], gap[maxN];
void adde(int a, int b, int c1, i... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct Edge {
int from, to, cost;
Edge(int from, int to, int cost) : from(from), to(to), cost(cost) {}
};
int N, M;
vector<Edge> G[110], cycle;
int color[110];
void dfs(int v, vector<Edge> u) {
color[v] = 0;
for (int i = 0; i < (int)G[v].size(); i++) {
Edge &e =... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-8;
const int tx[] = {0, 1, 0, -1};
const int ty[] = {-1, 0, 1, 0};
struct Node {
int to;
int idx;
int flow;
Node(int to, int idx, int flow) : to(to), idx(idx), flow(flow) {}
};
class FordFulkerson {
private:
vector<Node>* _graph;
bo... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
const int INF = 100000000;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
using namespace std;
struct FordFulkerson {
struct Edge {
int to, cap, rev;
Edge(int to = 0, int cap = 0, int rev = 0) : to(to), cap(cap), rev(rev) {}
};
int V;
vector<vector<Edge> > G;
vector<boo... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct Edge {
int from, to, cost;
Edge(int from, int to, int cost) : from(from), to(to), cost(cost) {}
};
int N, M;
bool found;
vector<Edge> G[110], cycle;
int color[110];
void dfs(int v, vector<Edge> u) {
color[v] = 0;
for (int i = 0; i < (int)G[v].size(); i++) {
... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-8;
const int tx[] = {0, 1, 0, -1};
const int ty[] = {-1, 0, 1, 0};
struct Node {
int to;
int idx;
int flow;
Node(int to, int idx, int flow) : to(to), idx(idx), flow(flow) {}
};
class FordFulkerson {
private:
vector<Node>* _graph;
bo... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int maxint = -1u >> 1;
const int maxn = 100 + 10;
int g[maxn][maxn], n, m;
int a[maxn], v[maxn], w[maxn];
int minCut() {
int ans = (-1u) >> 1;
for (int i = 0; i < n; ++i) {
v[i] = i;
}
while (n > 1) {
int maxi = 1;
a[v[0]] = 1;
for (int i = 1; ... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-8;
const int tx[] = {0, 1, 0, -1};
const int ty[] = {-1, 0, 1, 0};
struct Node {
int to;
int idx;
int flow;
Node(int to, int idx, int flow) : to(to), idx(idx), flow(flow) {}
};
class FordFulkerson {
private:
vector<Node>* _graph;
bo... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 29;
template <class T>
struct AdjMatrix : public vector<vector<T> > {
AdjMatrix(int n, const vector<T> &v = vector<T>())
: vector<vector<T> >(n, v) {}
};
template <class T>
T augment(const AdjMatrix<T> &capa, int src, int snk, AdjMatrix<T> &flow... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
const int INF = 100000000;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
using namespace std;
struct FordFulkerson {
struct Edge {
int to, cap, rev;
Edge(int to = 0, int cap = 0, int rev = 0) : to(to), cap(cap), rev(rev) {}
};
int V;
vector<vector<Edge> > G;
vector<boo... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
template <class T>
void debug(T begin, T end) {
for (T i = begin; i != end; ++i) cerr << *i << " ";
cerr << endl;
}
inline bool valid(int x, int y, int W, int H) {
return (x >= 0 && y >= 0 && x < W && y < H);
}
const int INF = 100000000;
const double EPS = 1e-8;
const... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int s[1005];
int main(int argc, char** argv) {
int n, m, i;
while (scanf("%d %d", &n, &m), n + m) {
int a, b;
for (i = 0; i < m; i++) scanf("%d %d %d", a, b, &s[i]);
sort(s, s + m);
printf("%d\n", s[0]);
}
return 0;
}
|
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int i;
int n, m;
while (cin >> n >> m && n + m) {
int b[100];
for (i = 0; i < n; i++) b[i] = i;
priority_queue<pair<int, pair<int, int> > > c;
for (i = 0; i < m; i++) {
int p, q, r;
cin >> p >> q >> r;
c.push(make_pair(r,... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
while (true) {
long long n, m;
cin >> n >> m;
if (n == 0 && m == 0) break;
assert(n >= m);
long long sum = 0, mn = 1234567890123456789LL, mn1 = 1234567890123456789;
for (int i = 0; i < int(m); ++i) {
long long x, y, c;
cin ... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
long long par[100], rnk[100];
void init(long long N) {
for (long long i = 0; i < N; i++) {
par[i] = i;
rnk[i] = 0;
}
}
long long find(long long x) {
if (par[x] == x) {
return x;
}
return par[x] = find(par[x]);
}
void unite(long long x, long long y) {
... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-8;
const int tx[] = {0, 1, 0, -1};
const int ty[] = {-1, 0, 1, 0};
struct Node {
int to;
int idx;
int flow;
Node(int to, int idx, int flow) : to(to), idx(idx), flow(flow) {}
};
class FordFulkerson {
private:
vector<Node>* _graph;
bo... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct {
int to, next;
} edge[100005];
int head[10010], stack[10010], DFN[10010], Low[10010], Belong[100010];
int instack[10010], cnt, scnt, top, n, m, tot;
void Add(int x, int y) {
edge[tot].to = y;
edge[tot].next = head[x];
head[x] = tot++;
}
void Tarjan(int v) {
... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
template <class T>
void debug(T begin, T end) {
for (T i = begin; i != end; ++i) cerr << *i << " ";
cerr << endl;
}
inline bool valid(int x, int y, int W, int H) {
return (x >= 0 && y >= 0 && x < W && y < H);
}
const int INF = 100000000;
const double EPS = 1e-8;
const... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int maz[150][150];
int n, m;
int stoer_wagner(int n) {
bool vis[150];
int node[150], dis[150];
int maxj, prev;
int ans = 1 << 30;
memset(dis, 0, sizeof(dis));
for (int i = 0; i < n; i++) node[i] = i;
while (n > 1) {
prev = 0;
maxj = 1;
memset(vis, ... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 28;
struct Dinic {
struct edge {
int to, cap, rev;
edge() {}
edge(int to, int cap, int rev) : to(to), cap(cap), rev(rev) {}
};
int n;
vector<vector<edge> > G;
vector<map<int, int> > M;
vector<int> level, iter;
Dinic() {}
Dini... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python3 | while True:
n,m=map(int,input().split())
if (n|m)==0: break
d={}
for i in range(m):
u,v,w=map(int,input().split())
if u>v: u,v=v,u
d[(u,v)]=d.get((u,v),0)+w
print(min(d.values()) if len(d) else 0) |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
while (true) {
long long n, m;
cin >> n >> m;
if (n == 0 && m == 0) break;
assert(n >= m);
long long sum = 0, mn = 1234567890123456789LL, mn1 = 1234567890321456789LL;
vector<pair<long long, pair<int, long long> > > edge[n];
for (in... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct Edge {
int from, to, cost;
Edge(int from, int to, int cost) : from(from), to(to), cost(cost) {}
};
int N, M;
vector<Edge> G[110], cycle;
int color[110];
void dfs(int v, vector<Edge> u) {
color[v] = 0;
for (int i = 0; i < (int)G[v].size(); i++) {
Edge &e =... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int n, m;
int x[100], y[100], c[100];
bool use[100];
bool union_find(void) {
int i, j;
int tmp, tmp2;
int g[100];
for (i = 0; i < n; i++) g[i] = i;
for (i = 0; i < m; i++) {
if (g[x[i]] != g[y[i]] && !use[i]) {
tmp = g[x[i]];
for (j = 0; j < n; j++... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-8;
const int tx[] = {0, 1, 0, -1};
const int ty[] = {-1, 0, 1, 0};
struct Node {
int to;
int idx;
int flow;
Node(int to, int idx, int flow) : to(to), idx(idx), flow(flow) {}
};
class FordFulkerson {
private:
vector<Node>* _graph;
bo... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct Edge {
int from, to, cost;
Edge(int from, int to, int cost) : from(from), to(to), cost(cost) {}
};
int N, M;
vector<Edge> G[110], cycle;
int color[110];
void dfs(int v, vector<Edge> u) {
color[v] = 0;
for (int i = 0; i < (int)G[v].size(); i++) {
Edge &e =... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
int x[100], y[100], c[100];
int r[100], use[100], tmp1, tmp2;
int cost, total;
int i, j;
while (1) {
cin >> n >> m;
if (!n && !m) break;
total = 0;
for (i = 0; i < m; i++) {
cin >> x[i] >> y[i] >> c[i];
total +=... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
long long n, m;
long long mini;
long long f[100];
pair<long long, pair<long long, long long> > e[100];
long long I, J;
int main() {
long long sum, cnt, x, y;
while (cin >> n >> m && n && m) {
cnt = sum = 0;
for (int i = 0; i < m; i++) {
cin >> e[i].second.... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int maz[110][110];
int n, m;
int stoer_wagner(int n) {
bool vis[110];
int node[110], dis[110];
int maxj, prev;
int ans = 1 << 30;
memset(dis, 0, sizeof(dis));
for (int i = 0; i < n; i++) node[i] = i;
while (n > 1) {
prev = 0;
maxj = 1;
memset(vis, ... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <iostream>
#include <sstream>
#include <cstdlib>
#include <cmath>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cstdio>
#include <numeric>
#include <bitset>
#include <stack>
using namespace std;
typedef struct
{
int to... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
while (true) {
long long n, m;
cin >> n >> m;
if (n == 0 && m == 0) break;
assert(n >= m);
long long sum = 0;
vector<pair<long long, long long> > edge[n];
for (int i = 0; i < int(m); ++i) {
long long x, y, c;
cin >> x >... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int n, m;
int ve[1200], nx[1200];
int st[1200];
long long re[1200], t[1200];
void add(int i, int a, int b, long long c) {
ve[i] = b;
re[i] = c;
nx[i] = st[a];
st[a] = i;
t[i] = 1;
}
bool visited[1200];
void dfs(int v) {
if (visited[v]) return;
visited[v] = 1;
... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
const long long inf = 1000000000000LL;
using namespace std;
struct edge {
int u, v, next, pre;
long long f;
} e[100000];
int num, rnum;
int n, m, N;
int source, sink;
int head[132], rhead[132], start[132];
int d[132], numb[132];
int p[132];
void Init() {
memset(head, -1, sizeof(head));
... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
inline bool minimize(T1& a, T2 b) {
return b < a && (a = b, 1);
}
template <class T1, class T2>
inline bool maximize(T1& a, T2 b) {
return a < b && (a = b, 1);
}
int const inf = 1 << 29;
struct unicycle_graph {
int N;
using graph_type =... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-8;
const int tx[] = {0, 1, 0, -1};
const int ty[] = {-1, 0, 1, 0};
struct Node {
int to;
int idx;
int flow;
Node(int to, int idx, int flow) : to(to), idx(idx), flow(flow) {}
};
class FordFulkerson {
private:
vector<Node>* _graph;
bo... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const long long INF = 1107110711071107;
vector<pair<long long, long long> > G[101];
long long min_bridge = INF;
long long ord[101], low[101];
bool vis[101];
void dfs(long long v, long long p, long long &k) {
vis[v] = true;
ord[v] = k++;
low[v] = ord[v];
for (long lo... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
inline bool minimize(T1& a, T2 b) {
return b < a && (a = b, 1);
}
template <class T1, class T2>
inline bool maximize(T1& a, T2 b) {
return a < b && (a = b, 1);
}
int const inf = 1 << 29;
struct unicycle_graph {
int N;
using graph_edge_t... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-8;
const int tx[] = {0, 1, 0, -1};
const int ty[] = {-1, 0, 1, 0};
struct Node {
int to;
int idx;
int flow;
Node(int to, int idx, int flow) : to(to), idx(idx), flow(flow) {}
};
class FordFulkerson {
private:
vector<Node>* _graph;
bo... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
inline bool minimize(T1& a, T2 b) {
return b < a && (a = b, 1);
}
template <class T1, class T2>
inline bool maximize(T1& a, T2 b) {
return a < b && (a = b, 1);
}
int const inf = 1 << 29;
struct unicycle_graph {
int N;
using graph_type =... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-8;
const int tx[] = {0, 1, 0, -1};
const int ty[] = {-1, 0, 1, 0};
struct Node {
int to;
int idx;
int flow;
Node(int to, int idx, int flow) : to(to), idx(idx), flow(flow) {}
};
class FordFulkerson {
private:
vector<Node>* _graph;
bo... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
using namespace std;
template <class T>
int popcount(T n);
template <>
int popcount(unsigned int n) {
return n ? __builtin_popcount(n) : 0;
}
template <>
int popcount(int n) {
return n ? __builtin_popcount(n) : 0;
}
template <>
int popcount(unsigned long long n) {
return n ? __builtin_pop... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const long long oo = 1LL << 60;
const long long B = 1LL << 31;
const long long W = 10000;
const int Max = 128;
const int MaxE = 500000;
struct box {
int to;
long long f;
box *s, *r;
} edge[MaxE], *hd[Max], *cur[Max], *cp;
box rem[MaxE];
int n, s, t, vH[Max], H[Max];
b... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-8;
const int tx[] = {0, 1, 0, -1};
const int ty[] = {-1, 0, 1, 0};
struct Node {
int to;
int idx;
int flow;
Node(int to, int idx, int flow) : to(to), idx(idx), flow(flow) {}
};
class FordFulkerson {
private:
vector<Node>* _graph;
bo... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }
int bsr(int x) { return 31 - __builtin_clz(x); }
template <class E>
using Graph = vector<vector<E>>;
template <class D, D INF>
struct BidirectedCut {
D... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const long long INF = 1107110711071107;
vector<pair<long long, long long> > G[101];
long long min_bridge = INF;
long long ord[101], low[101];
bool vis[101];
void dfs(long long v, long long p, long long &k) {
vis[v] = true;
ord[v] = k++;
low[v] = ord[v];
for (long lo... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct Edge {
int from, to, cost;
Edge(int from, int to, int cost) : from(from), to(to), cost(cost) {}
};
vector<Edge> G[110];
vector<Edge> used;
int N, color[110];
void dfs(int v, vector<Edge> vec) {
color[v] = 0;
for (int i = 0; i < (int)G[v].size(); i++) {
in... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include<iostream>
#include<algorithm>
#include<vector>
#include<climits>
#define MAX_N 100
using namespace std;
typedef pair<int,int> P;
typedef pair<int, P > PP;
int n,m;
int par[MAX_N];
int pa[MAX_N];
int rank[MAX_N];
int mini;
void init(int);
int find(int);
void unite(int x,int y);
bool same(int,int);
PP e[MAX_N]... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
while (true) {
long long n, m;
cin >> n >> m;
if (n == 0 && m == 0) break;
assert(n >= m);
long long sum = 0, mn = 1234567890123456789LL, mn1 = 1234567890123456789;
vector<pair<int, int> > edge[n];
for (int i = 0; i < int(m); ++i) ... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | // AOJ 1065 The House of Huge Family
// 2018.2.3 bal4u
#include <stdio.h>
#include <stdlib.h>
#define MAX 102
/* UNION-FIND library */
int id[MAX], size[MAX];
void init(int n) { int i; for (i = 0; i < n; i++) id[i] = i, size[i] = 1; }
int root(int i) { while (i != id[i]) id[i] = id[id[i]], i = id[i]; return i; }
int... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | /*
* sy.cpp
*
* Created on: 2012-10-7
* Author: Administrator
*/
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<queue>
using namespace std;
typedef long long ll;
#define zero(a) memset(a,0,sizeof(a))
const double pi = acos(-1.0);
const int... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <iostream>
#include <string>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <queue>
#include <stack>
#include <list>
#include <algorithm>
using namespace std;
#define typec __int64
#define V 111
//const typec inf = 0x3f3f3f3f;
const typec maxw = 111;
typec ... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-8;
const int tx[] = {0, 1, 0, -1};
const int ty[] = {-1, 0, 1, 0};
int main() {
int num_of_houses;
int num_of_paths;
while (~scanf("%d %d", &num_of_houses, &num_of_paths)) {
if (num_of_houses == 0 && num_of_paths == 0) break;
int b... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
int x[100], y[100], c[100];
int r[100], tmp1, tmp2;
int cost, total;
int i, j;
while (1) {
cin >> n >> m;
if (!n && !m) break;
total = 0;
for (i = 0; i < m; i++) {
cin >> x[i] >> y[i] >> c[i];
total += c[i];
... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-8;
const int tx[] = {0, 1, 0, -1};
const int ty[] = {-1, 0, 1, 0};
struct Node {
int to;
int idx;
int flow;
Node(int to, int idx, int flow) : to(to), idx(idx), flow(flow) {}
};
class FordFulkerson {
private:
vector<Node>* _graph;
bo... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 28;
struct Dinic {
struct edge {
int to, cap, rev;
edge() {}
edge(int to, int cap, int rev) : to(to), cap(cap), rev(rev) {}
};
int n;
vector<vector<edge> > G;
vector<map<int, int> > M;
vector<int> level, iter;
Dinic() {}
Dini... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
while (true) {
long long n, m;
cin >> n >> m;
if (n == 0 && m == 0) break;
assert(n >= m);
long long sum = 0, mn = 1234567890123456789LL, mn1 = 1234567890321456789LL;
vector<pair<long long, long long> > edge[n];
for (int i = 0; i <... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int mat[103][103], maty[103][103];
int n, m, ans, ansf;
void reset() { memcpy(mat, maty, sizeof(mat)); }
int max_flow(int n, int mat[][103], int source, int sink) {
int v[103], c[103], p[103], ret = 0, i, j;
for (;;) {
for (i = 0; i < n; i++) v[i] = c[i] = 0;
fo... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }
int bsr(int x) { return 31 - __builtin_clz(x); }
template <class E>
using Graph = vector<vector<E>>;
template <class D, D INF>
struct BidirectedCut {
D... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
while (true) {
long long n, m;
cin >> n >> m;
if (n == 0 && m == 0) break;
assert(n >= m);
long long sum = 0;
vector<pair<long long, long long> > edge[n];
for (int i = 0; i < int(m); ++i) {
long long x, y, c;
cin >> x >... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | /////èç¹å· ã1ï¼nãï¼
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
//ä½¿ç¨æ¶ï¼ nbs 置为 -1ï¼num 置为0ï¼
//s为æºç¹ï¼t为æ±ç¹
#define INF 2100000000
#define M 200////dian
#define N 100000///bian
int nbs[M+10];///ç¹çè¾¹é¾è¡¨
int nbsnext[M+10];////
int next[N],ev[N... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
inline bool minimize(T1& a, T2 b) {
return b < a && (a = b, 1);
}
template <class T1, class T2>
inline bool maximize(T1& a, T2 b) {
return a < b && (a = b, 1);
}
int const inf = 1 << 29;
struct unicycle_graph {
int N;
using graph_type =... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <iostream>
#include <sstream>
#include <cstdlib>
#include <cmath>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cstdio>
#include <numeric>
#include <bitset>
#include <stack>
using namespace std;
typedef struct
{
int to... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
inline bool minimize(T1& a, T2 b) {
return b < a && (a = b, 1);
}
template <class T1, class T2>
inline bool maximize(T1& a, T2 b) {
return a < b && (a = b, 1);
}
int const inf = 1 << 29;
struct unicycle_graph {
int N;
using graph_edge_t... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
const int INF = 100000000;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
using namespace std;
struct FordFulkerson {
struct Edge {
int to, cap, rev;
Edge(int to = 0, int cap = 0, int rev = 0) : to(to), cap(cap), rev(rev) {}
};
int V;
vector<vector<Edge> > G;
vector<boo... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include<iostream>
using namespace std;
int n,m;
int x[100],y[100],c[100];
bool use[100];
int par[100],rank[100];
int find(int x){
if(par[x] == x)return x;
else return par[x] = find(par[x]);
}
bool union2(void){
int i;
int a,b,c;
for(i=0;i<n;i++){
par[i] = i;
rank[i] = 0;
}
c = n;
for(i=... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
//The House of Huge Family
public class Main{
class E{
int s, t, id;
long c;
public E(int s, int t, long c, int id) {
this.s = s;
this.t = t;
this.c = c;
this.id = id;
}
}
int n, m;
List<E>[] adj;
boolean isCon(i... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 29;
template <class T>
struct AdjMatrix : public vector<vector<T> > {
AdjMatrix(int n, const vector<T> &v = vector<T>())
: vector<vector<T> >(n, v) {}
};
template <class T>
T augment(const AdjMatrix<T> &capa, int src, int snk, AdjMatrix<T> &flow... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
while (true) {
long long n, m;
cin >> n >> m;
if (n == 0 && m == 0) break;
assert(n >= m);
long long sum = 0, mn = 1234567890123456789LL, mn1 = 1234567890321456789LL;
vector<pair<long long, long long> > edge[n];
for (int i = 0; i <... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int par[100], rnk[100];
void init(int N) {
for (int i = 0; i < N; i++) {
par[i] = i;
rnk[i] = 0;
}
}
int find(int x) {
if (par[x] == x) {
return x;
}
return par[x] = find(par[x]);
}
void unite(int x, int y) {
x = find(x);
y = find(y);
if (x == y)... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct Edge {
int from, to, cost;
Edge(int from, int to, int cost) : from(from), to(to), cost(cost) {}
};
int N, M;
vector<Edge> G[110], cycle;
int color[110];
void dfs(int v, vector<Edge> u) {
color[v] = 0;
for (int i = 0; i < (int)G[v].size(); i++) {
Edge &e =... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
const int INF = 100000000;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
using namespace std;
struct FordFulkerson {
struct Edge {
int to, cap, rev;
Edge(int to = 0, int cap = 0, int rev = 0) : to(to), cap(cap), rev(rev) {}
};
int V;
vector<vector<Edge> > G;
vector<boo... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
const int INF = 100000000;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
using namespace std;
struct FordFulkerson {
struct Edge {
int to, cap, rev;
Edge(int to = 0, int cap = 0, int rev = 0) : to(to), cap(cap), rev(rev) {}
};
int V;
vector<vector<Edge> > G;
vector<boo... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include<iostream>
using namespace std;
int n,m;
int x[100],y[100],c[100];
bool use[100];
int par[100],rank[100];
int find(int x){
if(par[x] == x)return x;
else return par[x] = find(par[x]);
}
bool union2(void){
int i;
int a,b,c;
for(i=0;i<n;i++){
par[i] = i;
rank[i] = 0;
}
c = n;
for(i=... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct Edge {
int from, to, cost;
Edge(int from, int to, int cost) : from(from), to(to), cost(cost) {}
};
int N, M;
vector<Edge> G[110], cycle;
int color[110];
void dfs(int v, vector<Edge> u) {
color[v] = 0;
for (int i = 0; i < (int)G[v].size(); i++) {
Edge &e =... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const long long maxw = 2000000000;
long long g[111][111], w[111];
long long a[111], v[111], na[111];
long long Stoer_Wagner(int n) {
long long i, j, pv, zj;
long long best = maxw * n * n;
for (i = 0; i < n; i++) v[i] = i;
while (n > 1) {
for (a[v[0]] = 1, i = 1;... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | ### subroutines
def connected?(n, nbrs, edges)
used = n.times.map{false}
used[0] = true
q = [0]
while ! q.empty?
u = q.shift
for v in nbrs[u]
if ! edges[u][v].nil? && ! used[v]
used[v] = true
q << v
end
end
end
for usd in used
return false if ! usd
end
tru... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
class unionfind {
private:
int size_;
std::vector<int> parent;
std::vector<int> rank;
public:
unionfind()
: size_(0), parent(std::vector<int>()), rank(std::vector<int>()){};
unionfind(int size__)
: size_(size__),
parent(std::vector<int>(size_)),
rank(std... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 28;
struct Dinic {
struct edge {
int to, cap, rev;
edge() {}
edge(int to, int cap, int rev) : to(to), cap(cap), rev(rev) {}
};
int n;
vector<vector<edge> > G;
vector<map<int, int> > M;
vector<int> level, iter;
Dinic() {}
Dini... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 28;
struct Dinic {
struct edge {
int to, cap, rev;
edge() {}
edge(int to, int cap, int rev) : to(to), cap(cap), rev(rev) {}
};
int n;
vector<vector<edge> > G;
vector<map<int, int> > M;
vector<int> level, iter;
Dinic() {}
Dini... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-8;
const int tx[] = {0, 1, 0, -1};
const int ty[] = {-1, 0, 1, 0};
struct Node {
int to;
int idx;
int flow;
Node(int to, int idx, int flow) : to(to), idx(idx), flow(flow) {}
};
class FordFulkerson {
private:
vector<Node>* _graph;
bo... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
const int INF = 100000000;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
using namespace std;
struct UnionFind {
int size_;
std::vector<int> par;
std::vector<int> rank;
UnionFind(int size_) : size_(size_) {
par.resize(size_);
rank.resize(size_);
for (int i = 0; i < s... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
inline bool minimize(T1& a, T2 b) {
return b < a && (a = b, 1);
}
template <class T1, class T2>
inline bool maximize(T1& a, T2 b) {
return a < b && (a = b, 1);
}
int const inf = 1 << 29;
struct unicycle_graph {
int N;
using graph_type =... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include<iostream>
#include<algorithm>
#include<vector>
#include<climits>
#define MAX_N 100
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll, P > PP;
ll n,m;
ll par[MAX_N];
ll pa[MAX_N];
ll rank[MAX_N];
ll mini;
void init(ll);
ll find(ll);
void unite(ll,ll);
bool same(ll,ll);
PP e[MAX_... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-8;
const int tx[] = {0, 1, 0, -1};
const int ty[] = {-1, 0, 1, 0};
struct Node {
int to;
int idx;
long long flow;
Node(int to, int idx, long long flow) : to(to), idx(idx), flow(flow) {}
};
class FordFulkerson {
private:
vector<Node>* ... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include<algorithm>
using namespace std;
int main(){
int n,m;
int x[100],y[100],c[100];
int r[100],tmp1,tmp2;
int cost,total;
int i,j;
while(1){
cin >> n >> m;
if(!n && !m)break;
total = 0;
for(i=0;i<m;i++){
cin >> x[i] >> y[i] >> c[i];
total += c[i];
}
for(i=0;i<n;i++... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool checkmin(T &a, const T &b) {
return a > b ? a = b, 1 : 0;
}
template <typename T>
inline bool checkmax(T &a, const T &b) {
return a < b ? a = b, 1 : 0;
}
const int MAXN = 100 + 10;
struct edge {
int v, c, opp;
bool real, ban;
edge... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
int x[100], y[100], c[100];
int r[100], tmp1, tmp2;
int cost, total;
int i, j;
while (1) {
cin >> n >> m;
if (!n && !m) break;
total = 0;
for (i = 0; i < m; i++) {
cin >> x[i] >> y[i] >> c[i];
total += c[i];
... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include<iostream>
#include<algorithm>
using namespace std;
int n,m;
int x[100],y[100];
long long int c[100];
bool use[100];
int par[100],rank[100];
int find(int x){
if(par[x] == x)return x;
else return par[x] = find(par[x]);
}
bool union2(void){
int i;
int a,b,c;
for(i=0;i<n;i++){
par[i] = i;
ra... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
const int oo = 0x7fffffff;
int g[110][110], d[110];
bool used[110], vst[110];
int main() {
int min, n, m, max, tmp, pre, cur, a, b, w, cnt;
while (scanf("%d%d", &n, &m), n) {
min = oo, cnt = 0;
memset(g, 0, sizeof(g));
memset(used, 0, sizeof(used));
for (int i = 0; i < m; ++... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.util.Arrays;
import java.util.Scanner;
public class Main {
static Scanner sc = new Scanner(System.in);
static int N, M, E;
static int[] from;
static int[] cost;
static boolean disjoint() {
UnionFind uf = new UnionFind(N);
for (int i = 0; i < N; ++i) {
if (from[i] != -1) uf.union(i, from[i]);
... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
//The House of Huge Family
public class Main{
class E{
int s, t, c, id;
public E(int s, int t, int c, int id) {
this.s = s;
this.t = t;
this.c = c;
this.id = id;
}
}
int n, m;
List<E>[] adj;
boolean isCon(int f1, i... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-8;
const int tx[] = {0, 1, 0, -1};
const int ty[] = {-1, 0, 1, 0};
struct Node {
int to;
int idx;
int flow;
Node(int to, int idx, int flow) : to(to), idx(idx), flow(flow) {}
};
class FordFulkerson {
private:
vector<Node>* _graph;
bo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.