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 |
|---|---|---|---|---|---|---|
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
#pragma optimize("unroll-loops,no-stack-protector")
using namespace std;
namespace io {
struct eof {
eof() {}
};
const int L = (1 << 21) | 5;
char ibuf[L], *iS, *iT, obuf[L], *oS = obuf, *oT = obuf + L - 1, c, qu[55];
int f, qr;
inline void flush() { fwrite(obuf, 1, oS - obuf, stdout), oS = o... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int MX = 200005;
int n, m, u, v, a[MX], b[MX], ex[MX], x[MX];
vector<int> adj[MX], in[MX];
void dfs(int u) {
if (b[u] != -1) return;
for (int v : adj[u]) dfs(v);
for (int v : adj[u]) ex[b[v]] = u;
b[u] = 0;
while (ex[b[u]] == u) b[u]++;
in[b[u]].push_back(... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
vector<vector<int> > adj(200001);
int c[200001], mex[200001], h[200001], b[200001];
void DFS(int i) {
for (int j : adj[i]) {
if (mex[j] >= 0) {
continue;
}
DFS(j);
}
for (int j : adj[i]) {
c[mex[j]] = i;
}
int &k = mex[i];
for (k = 0; c[k] ... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct ahowwogaw {
int v, next;
} _[1000005];
int head[1000005], tot = 1, zyl[200005], yihuo[1000005], a[1000005];
bool qwer[1000005];
int fyr(int iakioi) {
if (zyl[iakioi] >= 0) {
return zyl[iakioi];
}
int i, ykb = 0, t;
for (i = head[iakioi]; i; i = _[i].nex... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 200010, M = 200010;
int n, m;
int e, to[M], nxt[M], hd[N], deg[N];
int tag[N], sg[N], val[N], sum[N];
vector<int> vec[N];
void add(int x, int y) {
to[++e] = y;
nxt[e] = hd[x];
hd[x] = e;
}
void topo() {
queue<int> q;
for (int i = 1; i <= n; i++)
... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
using ll = long long;
int const nmax = 200000;
int v[1 + nmax];
std::vector<int> g[1 + nmax];
int mex(std::vector<int> aux) {
std::sort(aux.begin(), aux.end());
aux.erase(std::unique(aux.begin(), aux.end()), aux.end());
for (int i = 0; i < aux.size(); i++)
if (aux[i] != i) return i;
... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int MAX = (int)2e5 + 5;
int n, m;
vector<int> v[MAX];
int h[MAX];
set<int> s[MAX];
set<int> t[MAX];
int dep[MAX];
int xors[MAX];
vector<pair<int, int> > mxx[MAX];
int bio[MAX];
int p[1000];
void dfs(int cx) {
if (bio[cx]) return;
bio[cx] = 1;
for (int i = (0), _... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
const int N = 200005;
using namespace std;
long long n, m, num[N], sy[N], ds[N], bj[N], sum[N];
vector<long long> to[N], pre[N];
queue<long long> que;
int main() {
long long i, j, t, p, q;
scanf("%d%d", &n, &m);
for (i = 1; i <= n; i++) scanf("%lld", &num[i]);
for (i = 1; i <= m; i++) {... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
#pragma warning(disable : 4996)
const int N = 2e5 + 5;
long long h[N], s[N];
int w[N];
vector<int> g[N];
bool used[N];
void dfs(int node) {
if (used[node]) return;
used[node] = 1;
vector<int> t;
for (int to : g[node]) {
dfs(to);
t.push_back(w[to]);
}
sor... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
int n, m, h[N], nxt[N], adj[N], rd[N], u, v, t, id[N], mx, q[N], top1, top2;
long long a[N], val[N];
bool vs[N];
inline void add() { nxt[++t] = h[u], h[u] = t, adj[t] = v; }
int main() {
scanf("%d%d", &n, &m);
register int i;
for (i = 1; i <= n;... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int N = 200200;
vector<int> g[N];
int ord[N];
int ordSz;
bool used[N];
int n, m;
int a[N];
int b[N];
int c[N];
bool mex[N];
void dfs(int v) {
used[v] = 1;
for (int u : g[v]) {
if (used[u]) co... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
struct city {
int estart;
long long int tax;
bool visited;
int mex;
} v[200003];
struct edge {
int enext, to;
} e[200003];
int n, m;
void dfs(int i) {
v[i].visited = true;
std::vector<int> temp;
for (int j = v[i].estart; j != -1; j = e[j].enext) {
int to = e[j].to;
if (!... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct node {
int to, nxt;
} edge[200100];
int val[200100], maxn, cnt, head[200100], n, m;
long long h[200100], X[710];
void addedge(int x, int y) {
edge[++cnt].to = y;
edge[cnt].nxt = head[x];
head[x] = cnt;
}
void dfs(int x) {
if (val[x] != -1) return;
bool vi... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
using VI = vector<int>;
int n, m;
const int NN = 200011;
int h[NN];
VI adj[NN];
map<int, int> g;
int tot[NN];
inline int get(int u) {
if (g.count(u)) return g[u];
map<int, int> vst;
for (int v : adj[u]) {
vst[get(v)] = 1;
}
for (int i = 0;; i++)
if (vst.co... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10, mod = 1e9 + 7;
const long long inf = 1e18;
int a[maxn];
bool mark[maxn];
vector<int> v[maxn], vec;
vector<int> vv[maxn];
int p[maxn], xr[maxn], C;
void dfs(int u) {
mark[u] = 1;
for (int y : v[u]) {
if (!mark[y]) dfs(y);
}
vec.push_bac... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int inf = 2e9;
const long double eps = 0.00000000001;
int n, m;
vector<int> E[300000];
int tab[300000];
int vis[300000];
int levelId[300000];
int levelXor[300000];
void dfs(int a) {
vis[a] = true;
vector<int> L;
for (int v : E[a]) {
if (!vis[v]) {
dfs(... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int n, m;
vector<int> edges[N];
bool vis[N];
int mex[N];
int getMex(int u) {
if (~mex[u]) return mex[u];
vector<bool> vis(edges[u].size() + 1, false);
for (int v : edges[u]) {
vis[min(getMex(v), (int)edges[u].size())] = true;
}
mex[u] = 0... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
const long long INF = 1e18;
const int inf = 1e9;
const int MAXN = 3e5 + 200;
const long double eps = 1e-16;
const long double pi = acos(-1.0);
using namespace std;
int dx[] = {0, 1, 1, 1, -1, -1, -1};
int dy[] = {1, -1, 0, 1, -1, 0, 1, -1};
int n, m;
long long a[MAXN], H[MAXN];
int M[MAXN];
vec... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int n, m, h[200012], cnt = 0, a[200012], f[200012], b[200012], c[200012];
bool vis[200012];
struct Edge {
int to, next;
} e[200012];
inline void AddEdge(int x, int y) {
e[++cnt] = (Edge){y, h[x]};
h[x] = cnt;
}
void dfs(int x) {
if (vis[x]) return;
vis[x] = 1;
i... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int gi() {
int x = 0, o = 1;
char ch = getchar();
while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
if (ch == '-') o = -1, ch = getchar();
while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
return x * o;
}
vec... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
int h[200010], SG[200010], sum[200010];
int fir[200010], nxt[200010], dis[200010], id;
void link(int a, int b) { nxt[++id] = fir[a], fir[a] = id, dis[id] = b; }
int que[200010], hd = 1, tl = 1, in[200010];
int c[200010];
int main() {
int n, m, a, b;
scanf("%d%d", &n, &m);
for (int i = 1; ... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct edge {
int to, nxxt;
} e[200005 << 1];
queue<int> q;
vector<int> v[200005];
bool vis[200005];
int head[200005], cnt = 1, n, m, a[200005], id[200005], b[200005], tot,
rd[200005], tb[200005], xr[200005], mx;
inline void ins(int u, int v) {
e[cnt] ... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
struct fastio {
char s[100000];
int it, len;
fastio() { it = len = 0; }
inline char get() {
if (it < len) return s[it++];
it = 0;
len = fread(s, 1, 100000, stdin);
if (len == 0)
return EOF;
else
return s[it++]... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int c = 200002;
queue<int> q;
vector<int> sz[c], s[c], f[c];
long long n, m, be[c], me[c], t[c], xo[c], maxi;
int main() {
ios_base::sync_with_stdio(false);
cin >> n >> m;
for (int i = 1; i <= n; i++) cin >> t[i], f[i].push_back(c);
for (int i = 1; i <= m; i++... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int NN = 200011;
vector<int> adj[NN];
int n, m;
int h[NN];
int xo[NN];
int g[NN];
int ans[NN];
int vst[NN];
int runs = 1;
int calc(int u) {
if (~g[u]) return g[u];
for (int v : adj[u]) calc(v);
runs++;
for (int v : adj[u]) vst[g[v]] = runs;
for (int i = 0;; ... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int n, m, SG[200005], Mx, h[200005], sum[200005];
bool vis[200005];
int fir[200005], nxt[200005], to[200005], tot;
inline void line(int x, int y) {
nxt[++tot] = fir[x];
fir[x] = tot;
to[tot] = y;
}
void dfs(int u) {
for (int i = fir[u]; i; i = nxt[i])
if (!SG[to... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
using std::cerr;
using std::endl;
inline int read() {
int x = 0, f = 1;
char ch = getchar();
while (!isdigit(ch)) {
if (ch == '-') f = -1;
ch = getchar();
}
while (isdigit(ch)) {
x = x * 10 + ch - '0';
ch = getchar();
}
return x * f;
}
const int MAXN = 200005;
int ... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &x) {
x = 0;
char c = getchar();
bool flag = false;
while (!isdigit(c)) {
if (c == '-') flag = true;
c = getchar();
}
while (isdigit(c)) {
x = (x << 1) + (x << 3) + (c ^ 48);
c = getchar();
}
if (flag)... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int c = 200002;
queue<int> q;
vector<int> sz[c], s[c], f[c];
long long n, m, be[c], me[c], t[c], xo[c], maxi;
int main() {
cin >> n >> m;
for (int i = 1; i <= n; i++) cin >> t[i], f[i].push_back(c);
for (int i = 1; i <= m; i++) {
int a, b;
cin >> a >> b;... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const long long N = 200005;
long long ver[N << 1], nxt[N << 1], head[N], deg[N], tot;
long long h[N], st[N], vis[N << 1], id[N], t[N << 1], Max, top, n, m;
queue<long long> q;
inline long long read() {
long long x = 0, ff = 1;
char ch = getchar();
while (ch < '0' || c... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct Graph {
vector<int> toposort() const {
auto deg = vector<int>(size(), 0);
auto que = vector<int>();
for (auto v = 0; v < size(); ++v)
for (auto u : edges[v]) ++deg[u];
for (auto v = 0; v < size(); ++v)
if (deg[v] == 0) que.push_back(v);
... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int head[200005], ver[200005], nxt[200005], cnt;
void add(int a, int b) { ver[++cnt] = b, nxt[cnt] = head[a], head[a] = cnt; }
vector<int> e[200005], has[200005];
int n, m, cd[200005];
long long a[200005], sg[200005];
int pos[200005], mex[200005], mx;
bool vis[200005];
queu... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const int M = 2e5 + 5;
int n, m;
long long h[N];
long long ans[N];
struct Edge {
int num;
int next;
} edge[M];
int tot, last[N];
int du[N];
int sg[N];
bool used[N];
queue<int> L;
int node[N], cnt;
int mem[N];
void Add(int i, int j) {
tot++;
ed... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5;
int n, m, h[maxn + 3], xo[maxn + 3], deg[maxn + 3], sg[maxn + 3], vis[maxn + 3],
res[maxn + 3];
vector<int> G[maxn + 3], H[maxn + 3];
int main() {
scanf("%d %d", &n, &m);
for (int i = (1); i <= int(n); i++) scanf("%d", &h[i]);
for (int i = (1... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 200500;
vector<int> side[maxn];
int n, m, val[maxn];
long long h[maxn], x[maxn], mx;
void dfs(int u) {
if (val[u] != -1) return;
bool vis[705] = {0};
for (int i = 0; i < side[u].size(); i++) {
int v = side[u][i];
dfs(v);
vis[val[v]] = 1;
... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 100;
int n, m, h[N], lev[N], Xor[N], cnt[N], deg[N];
vector<int> nxt[N], rnxt[N], vec[N];
set<int> s;
queue<int> q;
int main() {
cin >> n >> m;
for (int i = 1; i <= n; ++i) cin >> h[i];
for (int i = 1; i <= m; ++i) {
int x, y;
cin >> x >> y... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #pragma GCC optimize ("Ofast")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize ("-ffloat-store")
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
template<typename T>
using ordered_set = tree<T, null_type, less... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
inline int read() {
int x = 0, f = 1;
char ch = getchar();
while (ch < '0' || ch > '9') {
if (ch == '-') f = -1;
ch = getchar();
}
while (ch >= '0' && ch <= '9') {
x = x * 10 + ch - '0';
ch = getchar();
}
return x * f;
}
const int N = 200010;
i... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pci pair <c... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
using namespace std;
const long long N = 2e5 + 100;
long long long long M[N];
vector<long long> g[N];
long long long long vis[N];
long long long long po = 1;
long long long long h[N];
long long long long mex(long long long ... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int he[200010], ver[2 * 200010], nxt[2 * 200010], tot, in[200010];
void add(int x, int y) {
ver[++tot] = y;
nxt[tot] = he[x];
he[x] = tot;
}
int que[200010], cnt;
long long w[200010];
vector<int> v[200010];
long long ans[200010];
int s[200010];
bool vis[200010];
int m... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int read() {
bool f = 1;
int x = 0;
char c = getchar();
while (c < '0' || c > '9') {
if (c == '-') f = 0;
c = getchar();
}
while (c >= '0' && c <= '9') {
x = (x << 3) + (x << 1) - 48 + c;
c = getchar();
}
return f ? x : x * -1;
}
char cr[200]... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
inline int read() {
int x = 0, f = 1;
char ch = getchar();
while (ch < '0' || ch > '9') {
if (ch == '-') f = -1;
ch = getchar();
}
while (ch >= '0' && ch <= '9') {
x = x * 10 + ch - '0';
ch = getchar();
}
return x * f;
}
const int N = 200010;
i... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 2;
vector<int> adj[N], in[N], idx[N];
int mex[N], val[N], h[N], deg[N];
bool used[N];
queue<int> lis;
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, m, i, j, k, l, max1;
cin >> n >> m;
for (i = 1; i <= n; i++) {
cin >> h[i];
... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
#pragma optimize("unroll-loops,no-stack-protector")
using namespace std;
namespace io {
struct eof {
eof() {}
};
const int L = (1 << 21) | 5;
char ibuf[L], *iS, *iT, obuf[L], *oS = obuf, *oT = obuf + L - 1, c, qu[55];
int f, qr;
inline void flush() { fwrite(obuf, 1, oS - obuf, stdout), oS = o... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int NN = 200011;
vector<int> adj[NN];
int n, m;
int h[NN];
int xo[NN];
int g[NN];
int ans[NN];
int vst[NN];
int runs = 1;
int calc(int u) {
if (~g[u]) return g[u];
for (int v : adj[u]) calc(v);
runs++;
for (int v : adj[u]) vst[g[v]] = runs;
for (int i = 0;; ... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 4e5 + 7;
int n, m, xor1, xor2;
int a[MAXN];
int d[MAXN], dis[MAXN], type[MAXN];
vector<int> edge1[MAXN], edge2[MAXN];
queue<int> Q;
int qf;
void bfs() {
for (int i = 1; i <= n; i++)
if (d[i] == 0) Q.push(i), dis[i] = 1;
while (Q.size()) {
qf = Q... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
inline long long gi() {
long long x = 0, f = 1;
char ch = getchar();
while (!isdigit(ch)) f ^= ch == '-', ch = getchar();
while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
return f ? x : -x;
}
int h[200010], SG[200010], sum[200010], fst[200010];
int fir[200010], nxt[200010], ... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
using VI = vector<int>;
int n, m;
const int NN = 200011;
int h[NN];
VI adj[NN];
map<int, int> g;
int tot[NN];
inline int get(int u) {
if (g.count(u)) return g[u];
map<int, int> vst;
for (int v : adj[u]) {
vst[get(v)] = 1;
}
for (int i = 0;; i++)
if (vst.co... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::endl;
using std::memset;
using std::min;
using std::priority_queue;
using std::vector;
const int MAX_N = 79, MAX_BLK = 17;
struct State {
int loc, mask;
State(int loc, int mask) : loc(loc), mask(mask) {}
};
struct Info {
State s;
int d;
Info... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 200010;
struct edge {
int to, nxt;
};
edge G[maxn];
int head[maxn], cnt;
int h[maxn], deg[maxn];
queue<int> Q;
int a[maxn];
bool vis[maxn];
int bel[maxn];
int nim[maxn];
int main() {
int n, m;
scanf("%d %d", &n, &m);
for (int i = 1; i <= n; i++) sca... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int n, m, a[200009], h[200009], q[200009], d[200009], s[200009], sg[200009],
bo[200009];
vector<int> e[200009];
bool vis[200009];
int read() {
int x = 0;
char ch = getchar();
bool flag = 0;
while (ch < '0' || ch > '9') {
if (ch == '-') flag = 1;
ch = get... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const long long N = 200005;
long long ver[N << 1], nxt[N << 1], head[N], deg[N], tot;
long long h[N], st[N], vis[N << 1], id[N], t[N << 1], Max, top, n, m;
queue<long long> q;
inline long long read() {
long long x = 0, ff = 1;
char ch = getchar();
while (ch < '0' || c... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
inline int read() {
int x = 0, f = 1;
char ch = getchar();
while (ch < '0' || ch > '9') {
if (ch == '-') f = -1;
ch = getchar();
}
while (ch >= '0' && ch <= '9') {
x = x * 10 + ch - '0';
ch = getchar();
}
return x * f;
}
const int N = 200010;
i... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int inf = 2e9;
const long double eps = 0.00000000001;
int n, m;
vector<int> E[300000];
int tab[300000];
int vis[300000];
int levelId[300000];
int levelXor[300000];
void dfs(int a) {
vis[a] = true;
vector<int> L;
for (int v : E[a]) {
if (!vis[v]) {
dfs(... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 200010;
struct edge {
int to, nxt;
};
edge G[maxn];
int head[maxn], cnt;
int h[maxn], deg[maxn];
queue<int> Q;
int a[maxn];
bool vis[maxn];
int bel[maxn];
int nim[maxn];
int main() {
int n, m;
scanf("%d %d", &n, &m);
for (int i = 1; i <= n; i++) sca... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
template <class n, class second>
ostream &operator<<(ostream &p, pair<n, second> x) {
return p << "<" << x.first << ", " << x.second << ">";
}
template <class n>
auto operator<<(ostream &p, n y) ->
typename enable_if<!is_same<n, string>::value,
... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
namespace io {
int F() {
int F = 1, n = 0;
char ch;
while ((ch = getchar()) != '-' && (ch < '0' || ch > '9'))
;
ch == '-' ? F = 0 : n = ch - '0';
while ((ch = getchar()) >= '0' && ch <= '9') n = n * 10 + ch - '0';
return F ? n : -n;
}
long long G() {
long long F = 1, n = 0;
... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
#pragma warning(disable : 4996)
const int N = 2e5 + 5;
long long h[N], s[N];
int w[N];
vector<int> g[N];
bool used[N];
void dfs(int node) {
if (used[node]) return;
used[node] = 1;
vector<int> t;
for (int to : g[node]) {
dfs(to);
t.push_back(w[to]);
}
sor... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int h[200000];
vector<int> adjList[200000];
int nim[200000];
int doDFS(int u) {
if (nim[u] != -1) return 0;
int i, j = 0;
vector<int> s;
for (i = 0; i < adjList[u].size(); i++) {
int v = adjList[u][i];
doDFS(v), s.push_back(nim[v]);
}
sort(s.begin(), s.e... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
const int MAXN = 200010;
int head[MAXN], nxt[MAXN], to[MAXN], ind[MAXN], tot;
void adde(int b, int e) {
nxt[++tot] = head[b];
to[head[b] = tot] = e;
++ind[e];
}
int A[MAXN], mx[MAXN];
std::set<int> S;
int n, m;
std::queue<int> q;
int bfn[MAXN], idx;
int B[MAXN];
int main() {
std::ios_ba... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include<bits/stdc++.h>
#define Rint register int
using namespace std;
const int N = 200003;
template<typename T>
inline void read(T &x){
int ch = getchar(); x = 0;
for(;ch < '0' || ch > '9';ch = getchar());
for(;ch >= '0' && ch <= '9';ch = getchar()) x = x * 10 + ch - '0';
}
int n, m, h[N], sg[N], head[N],... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
long long h[200005], s[200005];
int n, m, a, b, ru[200006], mex[200005], fu[200005], ma;
vector<int> x[200005];
int dfs(int now) {
for (int i = 0; i < x[now].size(); i++) dfs(x[now][i]);
for (int i = 0; i < x[now].size(); i++) fu[mex[x[now][i]]] = now;
for (int i = 0;... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
inline int gi() {
char c = getchar();
while (c < '0' || c > '9') c = getchar();
int sum = 0;
while ('0' <= c && c <= '9') sum = sum * 10 + c - 48, c = getchar();
return sum;
}
int n, m, val[maxn], Id[maxn], sum[maxn], vis[maxn];
vector<in... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int head[200005], ver[200005], nxt[200005], cnt;
void add(int a, int b) { ver[++cnt] = b, nxt[cnt] = head[a], head[a] = cnt; }
vector<int> e[200005], has[200005];
int n, m, cd[200005];
long long a[200005], sg[200005];
int pos[200005], mex[200005], mx;
bool vis[200005];
queu... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
const int N = 200005;
int n, m, cnt, last[N], a[N], deg[N], sg[N], h[N], sum[N];
bool vis[N];
struct edge {
int to, next;
} e[N];
void addedge(int u, int v) {
e[++cnt].to = v;
e[cnt].next = last[u];
last[u] = cnt;
}
void get_sg() {
int tot = 0;
for (int i = 1; i <= n; i++)
if (!... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
long long fz[5000010], d[5000010], h[5000010];
vector<int> g[5000010];
void dfs(int u) {
if (d[u]) return;
d[u] = 1;
vector<int> px;
px.clear();
for (auto v : g[u]) {
dfs(v);
px.push_back(d[v]);
}
for (auto x : px) {
if (x != d[u]) break;
d[u]+... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
template <class T>
bool chkmin(T &x, T y) {
return y < x ? (x = y, true) : false;
}
template <class T>
bool chkmax(T &x, T y) {
return y > x ? (x = y, true) : false;
}
struct __init {
__init() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.precision(16);
... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #pragma GCC optimize ("Ofast")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize ("-ffloat-store")
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
template<typename T>
using ordered_set = tree<T, null_type, less... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using ll = long long;
int const nmax = 200000;
int v[1 + nmax];
std::vector<int> g[1 + nmax];
int mex(std::vector<int> aux) {
std::sort(aux.begin(), aux.end());
aux.erase(std::unique(aux.begin(), aux.end()), aux.end());
for (int i = 0; i < aux.size(); i++)
if (aux[i] != i) return i;
... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int maxN = 2e5 + 10;
int n, m, clk;
int h[maxN + 1], vis[maxN + 1];
int p[maxN + 1], sum[maxN + 1];
vector<int> G[maxN + 1];
inline int read() {
int num = 0, f = 1;
char ch = getchar();
while (!isdigit(ch)) {
if (ch == '-') f = -1;
ch = getchar();
}
... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int inf = 1e9 + 10;
const ll inf_ll = 1e18 + 10;
const int N = 2e5 + 5;
int h[N], f[N], l[N], v[N];
vector<int> adj[N];
void dfs(int i) {
v[i] = 1;
for (auto& j : adj[i]) {
if (!v[j]) dfs(j);
(l[i] = max(l[i], l[j] + 1));
}
f[l[i]... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
template <class T>
bool chkmin(T &x, T y) {
return y < x ? (x = y, true) : false;
}
template <class T>
bool chkmax(T &x, T y) {
return y > x ? (x = y, true) : false;
}
struct __init {
__init() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.precision(16);
... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | java | import java.io.*;
import java.util.*;
import java.math.*;
import java.lang.*;
import static java.lang.Math.*;
public class Main implements Runnable {
static class InputReader {
private InputStream stream;
private byte[] buf = new byte[1024];
private int curChar;
private int numCh... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
inline char gc() {
static char buf[100000], *p1 = buf, *p2 = buf;
return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
? EOF
: *p1++;
}
inline long long read() {
long long x = 0;
char ch = getchar();
bool positive... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
inline int read() {
int x = 0, f = 1;
char ch = getchar();
for (; !isdigit(ch); ch = getchar()) {
if (ch == '-') f = -1;
}
for (; isdigit(ch); ch = getchar()) {
x = x * 10 + ch - 48;
}
return x * f;
}
const int mxN = 2e5;
struct Edge {
int v, nxt;
} ... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 200010;
struct Edge {
int to, next;
} edge[N];
int head[N], num;
void add_edge(int a, int b) { edge[++num] = (Edge){b, head[a]}, head[a] = num; }
int sg[N];
vector<int> t[N];
int dfs(int x) {
if (sg[x] != -1) return sg[x];
for (int i = head[x]; i; i = ed... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
vector<int> G[maxn];
int sg[maxn], deg[maxn], Xor[maxn], topo[maxn], mem[maxn], cnt;
long long h[maxn], XOR[maxn];
int main() {
int n, m;
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; ++i) scanf("%lld", &h[i]);
for (int i = 0; i < m; ++i) ... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 200010;
struct Edge {
int to, next;
} edge[N];
int head[N], num;
void add_edge(int a, int b) { edge[++num] = (Edge){b, head[a]}, head[a] = num; }
int sg[N];
int dfs(int x) {
if (sg[x] != -1) return sg[x];
vector<int> tmp, tmp0;
for (int i = head[x]; i;... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int level[200005];
int h[200005];
int val[200005];
bool vis[200005];
bool num[200005];
vector<int> E[200005];
void dfs(int x) {
if (vis[x]) return;
vis[x] = true;
if (E[x].size() == 0) level[x] = 0;
int sz = E[x].size();
for (int v : E[x]) {
if (!vis[v]) {
... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
template <typename T>
void maxtt(T& t1, T t2) {
t1 = max(t1, t2);
}
template <typename T>
void mintt(T& t1, T t2) {
t1 = min(t1, t2);
}
bool debug = 0;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string direc = "URDL";
long long ln, lk, lm;
void etp(b... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int read() {
char c = getchar();
int x = 0;
while (c < '0' || c > '9') c = getchar();
while (c >= '0' && c <= '9') x = x * 10 + c - 48, c = getchar();
return x;
}
int n, m;
const int _ = 2e5 + 7;
int val[_], v[_];
vector<int> E[_];
int deg[_];
int st[_], top;
int ... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
using i64 = long long;
int n, m, h[223456], xors[223456], sg[223456], tag[223456];
int u, v, t, deg[223456], q[223456];
vector<int> e[223456];
int main() {
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; i++) {
scanf("%d", &h[i]);
}
for (int i = 0; i < m; i++) {
... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int n, m, h[200205];
int info[200205], Prev[200205], to[200205], cnt_e;
void Node(int u, int v) {
Prev[++cnt_e] = info[u], info[u] = cnt_e, to[cnt_e] = v;
}
int in[200205], Q[200205], L, R, SG[200205], S[200205];
int vis[200205], tim, Mx;
int main() {
scanf("%d%d", &n, ... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | /*
real time: 2021.7.2
hh:2021.5.8
gugu: 2 months
*/
#include<bits/stdc++.h>
#define R register
#define N 1000201
#define ll long long
int du[N],n,m;
int home[N],next[N],to[N],cnt;
ll a[N],X[N],qwq[N];
int zu[N],va[N],q[N],l,r;
inline void add(int a,int b){
next[++cnt]=home[a],home[a]=cnt,to[cnt]=b,++du[b];
}
in... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int level[200005];
int h[200005];
int val[200005];
bool vis[200005];
bool num[200005];
vector<int> E[200005];
void dfs(int x) {
if (vis[x]) return;
vis[x] = true;
if (E[x].size() == 0) level[x] = 0;
int sz = E[x].size();
for (int v : E[x]) {
if (!vis[v]) {
... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #pragma optimize("unroll-loops,no-stack-protector")
#include<bits/stdc++.h>
#define pb emplace_back
#define fi first
#define se second
#define debug(...) fprintf(stderr,__VA_ARGS__)
#define ALL(a) a.begin(),a.end()
#define lowbit(x) ((x)&-(x))
using namespace std;
typedef unsigned long long u64;
typedef unsigned int u3... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int read();
int n, m;
vector<int> e[200005];
int deg[200005];
void add(int f, int t) { e[f].push_back(t), ++deg[t]; }
queue<int> q;
int h[200005], sg[200005], mx, sum[200005];
vector<int> nx[200005];
void work() {
for (int i = 1; i <= n; ++i)
if (!deg[i]) q.push(i);
... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
template <typename tp>
inline void read(tp &x) {
x = 0;
char c = getchar();
int f = 0;
for (; c < '0' || c > '9'; f |= c == '-', c = getchar())
;
for (; c >= '0' && c <= '9'; x = (x << 3) + (x << 1) + c - '0', c = getchar())
;
if (f) x = -x;
}
const int ... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
const int N = 200007;
int a[N], deg[N], pos[N], vis[N], sg[N], s[N];
std::queue<int> q;
std::vector<int> e[N];
int read() {
int x = 0, c = getchar();
while (isspace(c)) c = getchar();
while (isdigit(c)) (x *= 10) += c & 15, c = getchar();
return x;
}
int main() {
int n = read(), m = r... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | java | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.stream.IntStream;
import java.io.OutputStream;
import java.util.Arrays;
import java.io.IOException;
import java.lang.reflect.Field;
import java.util.OptionalInt;
import java.nio.charset.StandardCharsets;
import java.ut... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
template <class n, class second>
ostream &operator<<(ostream &p, pair<n, second> x) {
return p << "<" << x.first << ", " << x.second << ">";
}
template <class n>
auto operator<<(ostream &p, n y) ->
typename enable_if<!is_same<n, string>::value,
... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | java | import java.io.*;
import java.util.*;
import java.math.*;
import java.lang.*;
import static java.lang.Math.*;
public class Main implements Runnable {
static class InputReader {
private InputStream stream;
private byte[] buf = new byte[1024];
private int curChar;
private int numCh... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
using LL = long long;
const int MAXN = 200010;
vector<int> x[MAXN], y[MAXN];
int v[MAXN], out[MAXN], sg[MAXN];
int xr[MAXN];
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, m;
cin >> n >> m;
for (int i = 0; i < n; ++i) cin >> v[i];
for (int i = 0; i... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
vector<int> V[maxn], H[maxn];
int n, m;
long long a[maxn];
int SG[maxn];
int h[maxn];
int maxx = 0;
int dfs(int u) {
if (SG[u] != -1) return SG[u];
vector<int> tmp;
for (auto v : V[u]) {
tmp.push_back(dfs(v));
}
sort(tmp.begin(), tmp.... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int h[212345];
vector<vector<int> > graph;
vector<int> mex;
vector<int> xors;
int get_mex(int v) {
if (mex[v] != -1) return mex[v];
vector<bool> seen(graph[v].size(), false);
for (auto u : graph[v]) {
int val = get_mex(u);
if (val < seen.size()) seen[val] = tr... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define mp make_pair
#define all(a) begin(a),end(a)
#define FOR(x,val,to) for(int x=(val);x<int((to));++x)
#define FORE(x,val,to) for(auto x=(val);x<=(to);++x)
#define FORR(x,arr) for(auto &x: arr... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
vector<int> V[maxn], H[maxn];
int n, m;
long long a[maxn];
int SG[maxn];
int h[maxn];
int maxx = 0;
int dfs(int u) {
if (SG[u] != -1) return SG[u];
vector<int> tmp;
for (auto v : V[u]) {
tmp.push_back(dfs(v));
}
sort(tmp.begin(), tmp.... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
std::vector<std::vector<int>> ad;
std::vector<int> fm;
std::vector<bool> tmp;
int f(int x) {
if (fm[x] >= 0) return fm[x];
for (int y : ad[x]) f(y);
for (int y : ad[x]) tmp[fm[y]] = true;
fm[x] = int(std::find(begin(tmp), end(tmp), false) - begin(tmp));
for (int y : ad[x]) {
tmp[f... |
1149_E. Election Promises | In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes.
There are n cities in Byteland, co... | {
"input": [
"6 4\n2 2 5 5 6 6\n1 3\n2 4\n3 5\n4 6\n",
"3 3\n314 159 265\n1 2\n1 3\n3 2\n",
"4 2\n2 1 1 5\n1 2\n3 4\n",
"4 2\n1 5 1 5\n1 2\n3 4\n"
],
"output": [
"LOSE\n",
"WIN\n0 0 0 \n",
"WIN\n1 5 1 5 \n",
"LOSE\n"
]
} | {
"input": [
"2 1\n1000000000 1000000000\n2 1\n",
"3 2\n123 345 567\n1 2\n3 2\n",
"3 0\n4 1 4\n",
"3 2\n1 0 1\n3 2\n2 1\n",
"3 0\n1 2 3\n",
"3 2\n1 1 1\n1 2\n2 3\n",
"2 0\n1000000000 1000000000\n",
"2 0\n123456789 987654321\n",
"3 2\n123 345 123\n1 2\n3 2\n",
"1 0\n271828182\n"... | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007LL;
long long large = 2000000000000000000LL;
vector<int> dp;
vector<vector<int> > adj;
int f(int u) {
if (dp[u] != -1) return dp[u];
vector<int> ch;
for (int j = 0; j < (int)adj[u].size(); j++) {
int v = adj[u][j];
ch.push_back(f(v));... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.