QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#302402 | #7975. coneyisland | hos_lyric# | 32 | 51ms | 18296kb | C++14 | 11.9kb | 2024-01-10 20:35:06 | 2024-07-04 03:17:22 |
Judging History
answer
#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
using Int = long long;
template <class T1, class T2> ostream &operator<<(ostream &os, const pair<T1, T2> &a) { return os << "(" << a.first << ", " << a.second << ")"; };
template <class T> ostream &operator<<(ostream &os, const vector<T> &as) { const int sz = as.size(); os << "["; for (int i = 0; i < sz; ++i) { if (i >= 256) { os << ", ..."; break; } if (i > 0) { os << ", "; } os << as[i]; } return os << "]"; }
template <class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cerr << *i << " "; cerr << endl; }
template <class T> bool chmin(T &t, const T &f) { if (t > f) { t = f; return true; } return false; }
template <class T> bool chmax(T &t, const T &f) { if (t < f) { t = f; return true; } return false; }
#define COLOR(s) ("\x1b[" s "m")
template <class Flow> struct MaxFlow {
// Watch out when using types other than int and long long.
static constexpr Flow FLOW_EPS = 1e-10L;
static constexpr Flow FLOW_INF = std::numeric_limits<Flow>::max();
int n, m;
vector<int> ptr, nxt, zu;
vector<Flow> capa;
explicit MaxFlow(int n_) : n(n_), m(0), ptr(n_, -1) {}
void ae(int u, int v, Flow w0, Flow w1 = 0) {
assert(0 <= u); assert(u < n);
assert(0 <= v); assert(v < n);
assert(0 <= w0);
assert(0 <= w1);
nxt.push_back(ptr[u]); zu.push_back(v); capa.push_back(w0); ptr[u] = m++;
nxt.push_back(ptr[v]); zu.push_back(u); capa.push_back(w1); ptr[v] = m++;
}
vector<int> see, lev, que;
Flow augment(int u, int t, Flow limFlow) {
if (u == t) return limFlow;
for (int &i = see[u]; ~i; i = nxt[i]) if (capa[i] > FLOW_EPS) {
const int v = zu[i];
if (lev[u] < lev[v]) {
const Flow f = augment(v, t, min(limFlow, capa[i]));
if (f > FLOW_EPS) { capa[i] -= f; capa[i ^ 1] += f; return f; }
}
}
return 0;
}
bool bfs(int s, int t) {
for (int u = 0; u < n; ++u) { see[u] = ptr[u]; lev[u] = -1; }
auto head = que.begin(), tail = que.begin();
for (lev[*tail++ = s] = 0; head != tail; ) {
const int u = *head++;
for (int i = ptr[u]; ~i; i = nxt[i]) if (capa[i] > FLOW_EPS) {
const int v = zu[i];
if (!~lev[v]) {
lev[*tail++ = v] = lev[u] + 1;
if (v == t) return true;
}
}
}
return false;
}
Flow run(int s, int t, Flow limFlow = FLOW_INF) {
see.resize(n); lev.resize(n); que.resize(n);
Flow flow = 0;
for (; flow + FLOW_EPS < limFlow && bfs(s, t); ) {
for (Flow f; (f = augment(s, t, limFlow - flow)) > FLOW_EPS; flow += f) {}
}
return flow;
}
};
////////////////////////////////////////////////////////////////////////////////
namespace bm {
constexpr int LIM_N0 = 200'010;
constexpr int LIM_N1 = 200'010;
constexpr int LIM_M = 400'010;
int n0, n1, m, as[LIM_M], bs[LIM_M];
int to[LIM_N0], fr[LIM_N1], tof;
int pt[LIM_N0 + 2], zu[LIM_M], used[LIM_N0], lev[LIM_N0], que[LIM_N0], *qb, *qe;
void init(int n0_, int n1_) {
n0 = n0_; n1 = n1_; m = 0;
}
int ae(int u, int v) {
as[m] = u; bs[m] = v; return m++;
}
int augment(int u) {
used[u] = tof;
for (int j = pt[u]; j < pt[u + 1]; ++j) {
const int v = zu[j];
const int w = fr[v];
if (!~w || (used[w] != tof && lev[u] < lev[w] && augment(w))) {
to[u] = v; fr[v] = u; return 1;
}
}
return 0;
}
int run() {
memset(pt, 0, (n0 + 2) * sizeof(int));
for (int i = 0; i < m; ++i) ++pt[as[i] + 2];
for (int u = 2; u <= n0; ++u) pt[u + 1] += pt[u];
for (int i = 0; i < m; ++i) zu[pt[as[i] + 1]++] = bs[i];
memset(to, ~0, n0 * sizeof(int));
memset(fr, ~0, n1 * sizeof(int));
memset(used, ~0, n0 * sizeof(int));
for (tof = 0; ; ) {
qb = qe = que; memset(lev, ~0, n0 * sizeof(int));
for (int u = 0; u < n0; ++u) if (!~to[u]) lev[*qe++ = u] = 0;
for (; qb != qe; ) {
const int u = *qb++;
for (int j = pt[u]; j < pt[u + 1]; ++j) {
const int w = fr[zu[j]];
if (~w && !~lev[w]) lev[*qe++ = w] = lev[u] + 1;
}
}
int f = 0;
for (int u = 0; u < n0; ++u) if (!~to[u]) f += augment(u);
if (!f) return tof;
tof += f;
}
}
// s: true, t: false (s: reachable from unmatched left)
// vertex cover: (0: false, 0: true)
// independent set: (0: true, 1: false)
bool side0[LIM_N0], side1[LIM_N1];
void dfs(int u) {
if (!side0[u]) {
side0[u] = true;
for (int j = pt[u]; j < pt[u + 1]; ++j) {
const int v = zu[j];
if (!side1[v]) {
side1[v] = true;
const int w = fr[v];
if (~w) dfs(w);
}
}
}
}
void minCut() {
memset(side0, 0, n0 * sizeof(bool));
memset(side1, 0, n1 * sizeof(bool));
for (int u = 0; u < n0; ++u) if (!~to[u]) dfs(u);
}
} // namespace bm
namespace enu_tree {
constexpr int MAX_N = 16;
using Id = pair<int, int>;
// (largest subtree, remaining tree)
vector<pair<Id, Id>> T[MAX_N + 1];
inline int TLen(int n) {
return T[n].size();
}
// tie-break (n/2) + (n/2)
inline bool isCentroid(int n, int x) {
return (T[n][x].first <= T[n][x].second);
}
// |non-root subtree| <= limDn
void build(int limDn = MAX_N - 1) {
for (int n = 0; n <= MAX_N; ++n) T[n].clear();
T[1].emplace_back(Id(0, 0), Id(0, 0));
for (int dn = 1; dn < MAX_N && dn <= limDn; ++dn) for (int dx = 0; dx < TLen(dn); ++dx) {
for (int n = 1; n + dn <= MAX_N; ++n) for (int x = 0; x < TLen(n); ++x) {
T[n + dn].emplace_back(Id(dn, dx), Id(n, x));
}
}
}
void getParDfs(int n, int x, int p, int &id, vector<int> &par) {
const int u = id++;
par[u] = p;
for (int nn = n, xx = x; nn > 1; ) {
const auto &t = T[nn][xx];
getParDfs(t.first.first, t.first.second, u, id, par);
nn = t.second.first;
xx = t.second.second;
}
}
vector<int> getPar(int n, int x) {
assert(1 <= n); assert(n <= MAX_N);
assert(0 <= x); assert(x < TLen(n));
int id = 0;
vector<int> par(n, -1);
getParDfs(n, x, -1, id, par);
return par;
}
vector<int> getPar(const Id &id) {
return getPar(id.first, id.second);
}
} // enu_tree
////////////////////////////////////////////////////////////////////////////////
void exper() {
using namespace enu_tree;
build(MAX_N / 2);
constexpr int maxK = MAX_N;
for (int n = 2; n <= MAX_N; n += 2) {
vector<int> freq(maxK + 1, 0);
for (int x = 0; x < TLen(n); ++x) if (isCentroid(n, x)) {
const auto par = getPar(n, x);
vector<int> cols(n, 0);
for (int u = 1; u < n; ++u) cols[u] = cols[par[u]] ^ 1;
int ns[2] = {};
vector<int> ids(n);
for (int u = 0; u < n; ++u) ids[u] = ns[cols[u]]++;
if (ns[0] == n/2 && ns[1] == n/2) {
int lo = 0, hi = n/2;
for (; lo + 1 < hi; ) {
const int mid = (lo + hi) / 2;
MaxFlow<int> mf((n << 1) + 2);
const int src = n << 1, snk = n << 1 | 1;
for (int u = 0; u < n; ++u) {
mf.ae(u << 1, u << 1 | 1, mid);
if (cols[u]) {
mf.ae(u << 1 | 1, snk, 1);
} else {
mf.ae(src, u << 1, 1);
}
}
for (int u = 1; u < n; ++u) {
mf.ae(par[u] << 1 | 1, u << 1, n/2);
mf.ae(u << 1 | 1, par[u] << 1, n/2);
}
const int f = mf.run(src, snk);
((f >= n/2) ? hi : lo) = mid;
}
const int kk = 2 * hi - 1;
for (int k = 1; k <= maxK; k += 2) {
bm::init(k * (n/2), k * (n/2));
for (int i = 0; i < k; ++i) {
for (int u = 1; u < n; ++u) {
if ((i & 1) ^ cols[u]) {
bm::ae(i * (n/2) + ids[par[u]], i * (n/2) + ids[u]);
} else {
bm::ae(i * (n/2) + ids[u], i * (n/2) + ids[par[u]]);
}
}
}
for (int i = 0; i < k - 1; ++i) {
for (int u = 0; u < n; ++u) {
if ((i & 1) ^ cols[u]) {
bm::ae((i + 1) * (n/2) + ids[u], i * (n/2) + ids[u]);
} else {
bm::ae(i * (n/2) + ids[u], (i + 1) * (n/2) + ids[u]);
}
}
}
const int res = bm::run();
if (res == k * (n/2)) {
++freq[k];
if (k >= 5) {
cout << par << ": " << k << endl;
}
if (k != kk) {
cerr << "FAIL: " << par << ": " << k << " " << kk << endl;
}
assert(k == kk);
goto found;
}
}
++freq[0];
cerr << par << ": " << 0 << endl;
found:{}
}
}
cerr << n << ": " << freq << endl;
}
}
constexpr int INF = 1001001001;
int N, M, Q;
vector<int> A, B;
vector<int> O, U, V, K;
vector<vector<int>> graph;
vector<int> rs;
int cnt[2];
void dfs(int r, int u, int p, int side) {
rs[u] = r;
++cnt[side];
for (const int v : graph[u]) if (p != v) {
dfs(r, v, u, side ^ 1);
}
}
// [u][IN(u)'s side][OUT(u)'s side] -> min cut
int dp[200'010][2][2];
void solve(int u, int p, int side, int k) {
for (int x = 0; x < 2; ++x) for (int y = 0; y < 2; ++y) {
dp[u][x][y] = 0
+ ((side == 0 && x == 1) ? 1 : 0)
+ ((x == 0 && y == 1) ? k : 0)
+ ((y == 0 && side == 1) ? 1 : 0)
;
}
for (const int v : graph[u]) if (p != v) {
solve(v, u, side ^ 1, k);
for (int x = 0; x < 2; ++x) for (int y = 0; y < 2; ++y) {
int mn = INF;
for (int xx = 0; xx < 2; ++xx) for (int yy = 0; yy < 2; ++yy) {
if (y == 0 && xx == 1) continue;
if (yy == 0 && x == 1) continue;
chmin(mn, dp[v][xx][yy]);
}
dp[u][x][y] += mn;
}
}
}
namespace subA {
vector<int> run() {
cerr<<"[subA::run]"<<endl;
graph.assign(N, {});
for (int i = 0; i < M; ++i) {
graph[A[i]].push_back(B[i]);
graph[B[i]].push_back(A[i]);
}
rs.assign(N, -1);
vector<int> needs(N, INF);
for (int r = 0; r < N; ++r) if (!~rs[r]) {
cnt[0] = cnt[1] = 0;
dfs(r, r, -1, 0);
if (cnt[0] == cnt[1]) {
int lo = 0, hi = cnt[0];
for (; lo + 1 < hi; ) {
const int mid = (lo + hi) / 2;
solve(r, -1, 0, mid);
int mn = INF;
for (int x = 0; x < 2; ++x) for (int y = 0; y < 2; ++y) {
chmin(mn, dp[r][x][y]);
}
((mn >= cnt[0]) ? hi : lo) = mid;
}
needs[r] = hi;
}
}
vector<int> anss;
for (int q = 0; q < Q; ++q) {
assert(O[q] == 3);
int ans;
if (K[q] % 2 != 0) {
ans = ((K[q] + 1) / 2 >= needs[rs[U[q]]]) ? 1 : 0;
} else {
ans = 1;
}
anss.push_back(ans);
}
return anss;
}
} // subA
int main() {
// exper();
for (; ~scanf("%d%d%d", &N, &M, &Q); ) {
A.resize(M);
B.resize(M);
for (int i = 0; i < M; ++i) {
scanf("%d%d", &A[i], &B[i]);
--A[i];
--B[i];
}
O.assign(Q, -1);
U.assign(Q, -1);
V.assign(Q, -1);
K.assign(Q, -1);
for (int q = 0; q < Q; ++q) {
scanf("%d", &O[q]);
if (O[q] == 1 || O[q] == 2) {
scanf("%d%d", &U[q], &V[q]);
--U[q];
--V[q];
} else if (O[q] == 3) {
scanf("%d%d", &U[q], &K[q]);
--U[q];
} else {
assert(false);
}
}
vector<int> anss;
if (O == vector<int>(Q, 3)) {
anss = subA::run();
} else {
assert(false);
}
for (const int ans : anss) {
puts(ans ? "Bob" : "Alice");
}
}
return 0;
}
詳細信息
Subtask #1:
score: 4
Accepted
Test #1:
score: 4
Accepted
time: 0ms
memory: 5820kb
input:
100 82 2000 6 28 55 86 74 84 41 1 41 33 32 10 94 62 11 16 46 51 73 8 61 24 41 19 46 25 45 38 1 75 29 48 41 76 87 6 79 72 61 23 41 88 29 53 99 5 46 12 47 83 95 30 59 32 51 45 86 21 53 98 100 80 6 100 92 17 39 18 15 93 4 26 18 20 86 77 4 7 75 11 97 39 58 31 49 58 41 3 46 40 72 56 4 41 87 36 57 50 10 8...
output:
Alice Alice Alice Alice Alice Alice Alice Alice Alice Bob Alice Alice Alice Alice Alice Alice Alice Alice Alice Bob Bob Alice Alice Bob Bob Alice Alice Bob Alice Alice Bob Alice Alice Alice Bob Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alic...
result:
ok 2000 tokens
Test #2:
score: 0
Accepted
time: 1ms
memory: 6152kb
input:
100 79 2000 46 8 100 92 56 70 46 95 23 99 63 74 42 3 58 78 27 36 89 4 33 25 53 22 41 59 66 1 9 32 77 76 100 38 60 85 69 5 58 43 72 49 10 17 26 48 99 30 95 19 44 89 60 88 69 61 45 53 75 14 62 81 13 33 89 26 42 16 43 13 99 31 7 18 62 65 91 80 85 28 28 42 20 24 94 35 70 55 37 15 35 21 3 12 45 83 63 57 ...
output:
Alice Alice Alice Bob Alice Bob Alice Bob Bob Alice Alice Alice Alice Alice Bob Alice Alice Alice Bob Alice Alice Alice Bob Alice Alice Bob Bob Alice Alice Alice Alice Alice Alice Bob Bob Alice Bob Bob Alice Alice Alice Alice Bob Bob Bob Alice Alice Bob Bob Bob Alice Bob Bob Bob Bob Alice Alice Bob ...
result:
ok 2000 tokens
Test #3:
score: 0
Accepted
time: 0ms
memory: 5848kb
input:
100 85 2000 25 99 84 90 80 84 93 50 20 70 72 14 19 73 37 54 79 1 20 13 63 2 50 52 81 66 80 68 10 7 85 51 1 49 96 69 75 25 68 27 25 65 77 79 78 91 19 29 84 5 22 11 14 4 53 18 40 12 37 47 46 34 92 36 75 96 5 76 19 57 9 64 56 16 6 21 31 86 49 98 93 3 13 59 100 23 39 10 8 67 55 28 56 53 75 81 72 61 37 4...
output:
Bob Bob Alice Bob Bob Alice Alice Alice Bob Alice Alice Alice Bob Bob Bob Alice Alice Bob Alice Alice Alice Bob Bob Alice Alice Alice Bob Bob Alice Bob Bob Alice Alice Alice Bob Alice Alice Alice Bob Alice Alice Bob Alice Alice Bob Alice Bob Bob Alice Alice Alice Bob Bob Bob Bob Alice Alice Alice Al...
result:
ok 2000 tokens
Test #4:
score: 0
Accepted
time: 1ms
memory: 6140kb
input:
100 89 2000 52 88 50 78 18 35 58 7 3 5 85 92 75 96 72 100 57 82 35 95 56 4 9 44 56 25 46 18 79 15 46 28 56 68 74 47 73 16 76 73 32 11 7 49 75 26 36 45 57 31 89 21 97 74 2 38 51 70 6 12 66 53 92 72 64 83 93 55 95 56 61 20 59 13 98 43 38 48 75 61 75 67 91 84 79 32 75 1 79 86 14 34 60 17 54 24 32 27 79...
output:
Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Bob Bob Bob Bob Alice Alice Alice Alice Bob Bob Bob Alice Alice Alice Alice Bob Bob Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Bob Alice Alice Alice Alice Alice Al...
result:
ok 2000 tokens
Test #5:
score: 0
Accepted
time: 1ms
memory: 5792kb
input:
100 85 2000 76 47 18 17 73 13 100 81 18 16 91 51 35 98 80 89 4 19 89 74 71 75 46 10 16 53 54 3 43 61 47 30 90 87 45 56 91 23 34 28 91 70 100 29 94 96 55 4 81 64 54 76 95 62 31 90 9 5 87 27 12 86 81 34 59 94 8 44 29 36 21 40 40 50 36 65 77 43 69 97 86 57 74 15 64 92 100 35 52 4 17 25 5 10 71 78 100 2...
output:
Bob Bob Alice Bob Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Bob Alice Alice Bob Alice Alice Alice Alice Alice Alice Alice Alice Bob Alice Alice Alice Bob Bob Bob Alice Alice Alice Alice Alice Alice Alice Alice Alice Bob Bob Bob Alice Bob Alice Alice Bob Bob Alice Bob Bob Bob ...
result:
ok 2000 tokens
Test #6:
score: 0
Accepted
time: 1ms
memory: 6148kb
input:
100 86 2000 69 32 48 45 45 19 93 95 75 1 61 36 15 34 71 42 34 81 63 30 24 71 58 94 8 63 46 37 76 65 7 24 61 13 94 64 2 11 1 9 90 23 61 98 53 87 22 91 94 67 58 53 62 90 52 92 10 89 20 15 22 58 39 51 74 68 65 83 61 48 82 59 33 7 31 16 89 5 46 84 52 20 56 75 14 74 95 12 31 73 26 43 91 57 28 10 85 88 8 ...
output:
Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Bob Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Bob Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alic...
result:
ok 2000 tokens
Test #7:
score: 0
Accepted
time: 0ms
memory: 6144kb
input:
100 88 2000 76 54 50 48 42 25 22 15 21 76 4 6 16 55 100 19 40 77 3 85 36 64 7 65 88 39 36 28 94 10 77 34 21 7 87 22 61 17 94 47 47 26 89 92 91 66 59 67 90 5 41 44 90 49 72 40 91 1 36 38 94 36 75 71 51 2 90 46 1 95 44 31 47 60 64 75 70 58 18 76 40 84 19 3 73 29 61 91 72 16 3 81 23 56 51 4 50 30 33 43...
output:
Alice Alice Alice Alice Alice Alice Alice Bob Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Bob Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alic...
result:
ok 2000 tokens
Test #8:
score: 0
Accepted
time: 0ms
memory: 5852kb
input:
100 90 2000 81 80 49 24 93 46 69 23 35 20 12 74 36 1 100 84 61 34 27 46 61 97 55 92 72 12 35 10 37 65 70 37 39 81 67 83 61 2 23 72 2 9 22 41 32 14 38 11 13 27 37 69 14 49 26 19 44 42 47 76 70 90 5 98 96 99 100 79 70 50 35 29 45 16 19 31 15 54 59 67 49 85 74 33 65 26 56 96 48 88 28 51 36 52 5 100 28 ...
output:
Alice Alice Bob Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Alice Al...
result:
ok 2000 tokens
Test #9:
score: 0
Accepted
time: 1ms
memory: 5852kb
input:
100 84 2000 41 95 99 6 72 97 82 4 36 1 32 68 17 81 75 70 59 42 75 77 5 21 72 11 7 83 3 29 84 65 3 58 64 28 17 74 54 63 61 22 47 88 64 2 10 9 16 43 38 96 35 25 12 50 39 27 25 56 90 66 84 86 84 37 22 16 79 41 47 15 48 90 87 33 39 55 64 19 36 52 36 23 31 99 73 3 97 94 59 32 60 47 11 80 100 93 84 98 5 3...
output:
Alice Alice Bob Alice Bob Bob Alice Alice Alice Alice Alice Bob Bob Bob Alice Bob Alice Alice Alice Alice Alice Alice Bob Bob Bob Alice Alice Bob Alice Alice Bob Alice Alice Alice Alice Alice Bob Alice Bob Alice Bob Alice Bob Bob Bob Alice Alice Alice Alice Bob Alice Alice Bob Bob Alice Bob Alice Al...
result:
ok 2000 tokens
Test #10:
score: 0
Accepted
time: 0ms
memory: 5796kb
input:
100 86 2000 61 88 21 12 76 5 68 90 6 76 63 30 71 56 32 59 95 2 93 100 13 51 12 92 76 23 42 16 3 78 41 83 21 81 42 58 30 71 74 66 50 60 29 79 96 29 18 36 68 89 96 34 67 17 20 54 31 61 16 84 44 41 8 22 99 87 9 4 40 20 9 26 83 91 23 37 55 93 39 35 5 75 54 73 95 31 37 85 100 38 26 28 72 43 62 7 99 45 23...
output:
Alice Alice Bob Bob Bob Alice Alice Alice Alice Bob Bob Bob Alice Alice Bob Alice Bob Bob Alice Alice Bob Alice Alice Bob Bob Alice Bob Bob Bob Alice Bob Bob Bob Bob Alice Alice Bob Bob Alice Bob Alice Alice Bob Alice Bob Bob Bob Bob Bob Bob Alice Bob Alice Bob Bob Bob Bob Bob Bob Bob Bob Bob Alice ...
result:
ok 2000 tokens
Subtask #2:
score: 13
Accepted
Test #11:
score: 13
Accepted
time: 1ms
memory: 5860kb
input:
200 171 2000 29 151 55 127 16 192 79 166 138 145 198 45 19 130 37 172 136 37 197 183 136 116 171 112 132 21 118 47 55 75 150 41 47 74 7 97 143 106 129 197 39 124 160 63 134 182 30 173 64 66 119 59 47 104 172 111 69 90 28 167 61 171 70 148 23 17 93 143 93 89 79 108 60 44 33 50 81 92 30 40 115 120 112...
output:
Alice Bob Alice Bob Alice Bob Alice Bob Bob Alice Bob Alice Bob Alice Bob Bob Bob Bob Alice Bob Alice Bob Bob Alice Bob Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Alice Bob Alice Bob Alice Alice Bob Alice Bob Alice Bob Alice Bob ...
result:
ok 2000 tokens
Test #12:
score: 0
Accepted
time: 1ms
memory: 5812kb
input:
200 181 2000 56 26 121 183 92 77 12 107 190 176 6 57 167 113 127 115 161 193 29 111 38 78 112 141 96 44 57 84 30 31 16 179 30 86 169 181 52 148 8 57 46 160 17 34 61 140 72 86 128 76 82 50 21 103 101 98 46 52 9 200 148 68 100 70 26 86 67 72 165 112 112 177 52 75 88 24 182 97 164 118 75 21 198 131 92 ...
output:
Bob Alice Bob Alice Alice Bob Alice Bob Alice Alice Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Alice Bob Alice Bob Alice Alice Bob Alic...
result:
ok 2000 tokens
Test #13:
score: 0
Accepted
time: 1ms
memory: 5848kb
input:
200 184 2000 127 186 21 189 145 124 63 26 185 196 135 190 44 147 70 77 17 25 180 194 42 14 138 166 137 170 44 32 132 83 151 49 59 34 198 141 88 13 156 132 73 2 84 110 134 122 6 182 137 185 127 69 70 109 164 23 17 41 53 120 13 129 184 197 7 181 137 157 70 96 132 125 23 89 11 90 55 116 102 117 133 82 ...
output:
Alice Bob Alice Bob Alice Bob Alice Alice Bob Alice Bob Alice Alice Bob Alice Bob Alice Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Alice Alice Alice Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Bob Alice Bob Alice Alice Alice Bob Alice Bob Al...
result:
ok 2000 tokens
Test #14:
score: 0
Accepted
time: 1ms
memory: 5928kb
input:
200 168 2000 18 155 177 186 200 101 31 137 146 147 78 53 89 42 88 72 130 59 144 95 148 66 19 56 129 51 140 151 63 46 91 10 187 161 62 114 60 105 80 200 171 165 29 45 182 117 43 146 162 48 97 176 180 12 168 69 24 119 149 133 74 38 34 97 13 84 152 81 170 100 66 120 160 19 42 73 161 64 63 75 171 136 14...
output:
Alice Alice Alice Alice Alice Bob Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Alice Bob Alice Alice Bob Alice Alice Alice Alice Alice Bob Bob Bob Alice Bob Alice Alice Bob Alice Alice Bob Alice Bob Alice Bob Alice Alice Alice Alice Bob Alice Alice Alice Bob Alice Bob Alice Alice Alice Alice Bo...
result:
ok 2000 tokens
Test #15:
score: 0
Accepted
time: 1ms
memory: 5788kb
input:
200 182 2000 67 189 134 137 118 86 190 133 48 74 199 72 102 143 98 88 164 40 97 58 16 46 199 19 14 67 125 79 32 44 33 156 177 73 57 26 43 106 24 174 135 54 158 179 59 138 199 139 147 2 148 184 17 53 117 120 83 162 6 123 123 43 97 129 111 170 133 3 113 104 114 196 128 113 133 127 114 78 115 38 99 84 ...
output:
Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Alice Bob Alice Bob Alice Bob Alice Alice Alice Alice Bob Alice Bob Alice Alice Bob Alice Bob Bob Alice Alice Alice Bob Bob Alice Bob Alice Bob Alice Alice Bob Alice Bob Alice Bob Alice Bob Bob Alice Alice Alice Bob Alice Alice Bob Bob Alice Bo...
result:
ok 2000 tokens
Test #16:
score: 0
Accepted
time: 0ms
memory: 5788kb
input:
200 174 2000 32 91 168 177 101 140 58 182 169 69 163 62 148 51 30 35 5 179 53 45 155 189 23 15 46 23 142 193 2 68 169 46 58 126 73 116 32 107 99 156 77 192 149 178 152 167 154 118 156 90 57 105 173 99 45 174 113 71 16 96 188 83 180 86 199 159 165 100 77 93 170 166 99 162 86 40 121 144 1 42 149 21 38...
output:
Bob Alice Bob Bob Alice Bob Bob Alice Bob Alice Bob Alice Alice Bob Alice Bob Alice Alice Bob Bob Bob Alice Bob Bob Bob Alice Bob Alice Bob Alice Bob Bob Alice Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Bob Bob Bob Bob Alice Bob Alice Alice Bob Bob Alice Bob Alice Bob Alic...
result:
ok 2000 tokens
Test #17:
score: 0
Accepted
time: 0ms
memory: 5804kb
input:
200 178 2000 119 64 26 93 56 84 118 172 161 183 156 111 3 75 10 106 62 65 16 153 20 120 10 63 70 81 163 58 192 121 8 20 7 28 61 86 3 99 195 8 142 143 57 48 91 41 159 49 157 102 113 140 46 5 132 67 103 193 188 1 175 52 128 141 2 197 200 110 200 109 200 152 7 79 153 129 119 158 189 21 103 196 56 88 11...
output:
Alice Bob Alice Alice Bob Alice Alice Bob Alice Bob Alice Bob Alice Bob Bob Bob Bob Alice Alice Alice Bob Alice Bob Alice Alice Bob Bob Bob Alice Alice Bob Alice Bob Alice Alice Bob Alice Bob Alice Alice Alice Bob Alice Alice Bob Bob Alice Alice Bob Alice Bob Alice Alice Bob Alice Alice Bob Alice Bo...
result:
ok 2000 tokens
Test #18:
score: 0
Accepted
time: 1ms
memory: 6164kb
input:
200 175 2000 7 180 10 1 178 182 127 13 25 112 9 83 145 61 145 91 156 87 179 38 109 129 25 81 4 100 43 135 190 184 62 159 144 6 98 188 15 52 92 113 174 152 25 139 135 80 126 125 24 67 113 176 120 145 8 51 28 187 20 84 62 108 12 190 120 86 92 88 92 78 24 48 23 126 30 168 19 87 9 102 199 76 28 89 165 1...
output:
Alice Alice Bob Alice Bob Alice Bob Alice Bob Alice Alice Bob Bob Alice Bob Alice Alice Bob Alice Alice Bob Bob Bob Bob Alice Alice Alice Bob Alice Bob Alice Bob Bob Alice Alice Bob Alice Bob Bob Alice Bob Alice Bob Alice Bob Bob Alice Bob Alice Bob Bob Alice Bob Bob Alice Bob Alice Bob Bob Alice Bo...
result:
ok 2000 tokens
Test #19:
score: 0
Accepted
time: 1ms
memory: 5844kb
input:
200 182 2000 150 133 62 22 41 119 127 113 105 7 137 102 25 157 91 134 172 196 48 2 12 27 30 142 62 125 45 90 174 166 173 39 70 10 62 141 144 190 125 137 37 81 30 168 105 160 185 72 59 37 72 35 23 78 160 80 122 95 167 66 36 159 151 67 50 198 158 122 109 11 200 68 69 76 28 159 184 170 103 100 31 197 3...
output:
Alice Alice Alice Bob Alice Bob Alice Alice Alice Bob Alice Bob Alice Alice Alice Alice Alice Alice Alice Bob Bob Alice Bob Alice Bob Bob Alice Alice Alice Bob Alice Alice Bob Alice Bob Alice Bob Alice Bob Alice Alice Alice Bob Alice Alice Bob Alice Bob Alice Bob Alice Bob Bob Alice Bob Alice Bob Al...
result:
ok 2000 tokens
Test #20:
score: 0
Accepted
time: 1ms
memory: 5844kb
input:
200 169 2000 1 12 165 124 134 65 128 83 87 10 164 81 42 180 175 17 88 51 139 156 194 178 180 168 94 181 2 123 153 189 166 27 150 90 192 54 131 109 121 39 75 187 195 50 139 188 95 46 185 132 136 82 150 169 21 7 95 117 23 145 13 56 120 121 150 64 102 153 195 20 98 105 153 174 174 120 181 141 48 107 15...
output:
Alice Alice Bob Alice Alice Alice Alice Bob Bob Alice Bob Alice Alice Alice Alice Bob Alice Alice Alice Alice Alice Bob Alice Bob Alice Alice Alice Alice Alice Alice Alice Alice Alice Bob Alice Bob Alice Alice Alice Bob Alice Bob Alice Alice Alice Alice Bob Alice Alice Alice Bob Alice Bob Alice Bob ...
result:
ok 2000 tokens
Subtask #3:
score: 0
Runtime Error
Test #21:
score: 0
Runtime Error
input:
2000 1890 2000 1212 557 338 550 270 153 1622 738 1793 1582 269 24 1631 1087 884 650 993 737 1193 676 1107 1858 1927 1456 1928 985 332 888 893 212 1393 1530 1635 7 1300 1955 437 260 283 1616 912 544 1806 106 431 656 980 182 173 1786 714 342 884 1595 1658 150 117 725 642 1931 1608 1213 972 726 193 927...
output:
result:
Subtask #4:
score: 0
Runtime Error
Test #31:
score: 0
Runtime Error
input:
50000 49880 20000 48314 21512 22153 12169 41488 42607 40229 41306 46264 28965 25173 26971 10383 46046 12460 40491 39907 3938 38678 10601 44612 9518 47459 40583 41078 31510 28311 20714 48314 14317 39657 18800 48314 13702 3127 22586 44612 19422 34192 11134 27163 4980 18592 29422 32962 18856 46707 2976...
output:
result:
Subtask #5:
score: 0
Runtime Error
Test #41:
score: 0
Runtime Error
input:
50000 49880 20000 25303 14342 14869 40179 21130 16220 24316 1709 17034 34229 30864 5296 3377 39615 7965 4758 45366 46099 20621 30122 11921 21129 23336 3391 49502 33595 38205 24561 16625 17058 4643 31243 43549 4838 14799 15012 43454 49265 12739 34594 43197 15991 28223 34847 45479 23973 41255 13540 20...
output:
result:
Subtask #6:
score: 15
Accepted
Test #51:
score: 15
Accepted
time: 51ms
memory: 17304kb
input:
100000 99938 100000 26438 1998 89535 89756 70297 55360 82670 83756 93993 77139 94699 21163 45884 56882 5737 53295 62873 34215 1522 27236 30627 53486 81399 26563 9209 24434 23031 5002 94699 4551 98173 19852 52146 13350 63659 39283 63680 24484 67720 35030 53166 13805 61178 2860 4599 9418 69603 20505 8...
output:
Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Alice Alice Alice Alice Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Alice Alice Bob Alice Bob Alice Alice Bob Alice Bob Alice Bob Alice Alice Bob Alice Bob Alice Alice Bob Alice Alice Alice Alice Bob Alice Bob Bob Alice Bo...
result:
ok 100000 tokens
Test #52:
score: 0
Accepted
time: 46ms
memory: 17276kb
input:
100000 99930 100000 46463 67167 28739 14235 31925 73395 65 61496 18263 83405 25134 48758 45635 3718 8446 78201 73307 64474 79847 52355 90661 53650 49849 90177 6184 6892 30759 18069 99195 7414 36454 17130 90341 40330 19539 64870 39058 98612 52655 58514 41485 78706 4564 69357 27499 75970 18263 59173 5...
output:
Alice Alice Bob Alice Alice Bob Alice Alice Alice Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Alice Bob Alice Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Alice Alice Bob Alice Bob Alice Alice Alice Alice Al...
result:
ok 100000 tokens
Test #53:
score: 0
Accepted
time: 46ms
memory: 16824kb
input:
100000 99932 100000 86678 979 49492 12069 82679 23228 76172 78664 7814 16156 82723 49158 35937 36933 53236 25549 36446 2079 48239 95606 99609 4559 57487 96941 60474 8 12142 32537 10445 20539 42880 66933 45398 41242 7273 7035 6817 10050 2704 87941 57400 75449 20417 63808 19725 97395 75706 31092 49723...
output:
Alice Bob Alice Alice Alice Bob Alice Alice Bob Alice Bob Alice Bob Alice Bob Alice Alice Alice Bob Alice Alice Alice Alice Bob Alice Alice Alice Bob Alice Alice Alice Alice Alice Alice Alice Bob Alice Alice Alice Alice Alice Alice Alice Bob Alice Bob Alice Alice Bob Bob Alice Alice Alice Bob Alice ...
result:
ok 100000 tokens
Test #54:
score: 0
Accepted
time: 45ms
memory: 17996kb
input:
100000 99940 100000 9361 26198 76066 59443 78978 79494 58550 9303 97671 2984 67842 10829 29343 75262 21529 32840 19178 71488 1025 18763 37622 75787 92169 35006 97932 81201 19530 7406 50879 70200 96385 15276 47035 72341 74228 56130 30140 49341 32289 84788 74897 98804 23505 39010 75225 67866 88252 534...
output:
Alice Alice Bob Alice Bob Alice Alice Bob Alice Alice Bob Alice Bob Bob Alice Bob Alice Alice Bob Alice Alice Bob Alice Bob Alice Alice Alice Alice Bob Alice Bob Alice Bob Alice Bob Alice Alice Bob Alice Bob Alice Bob Alice Bob Alice Alice Alice Alice Bob Alice Alice Bob Alice Bob Alice Alice Bob Al...
result:
ok 100000 tokens
Test #55:
score: 0
Accepted
time: 41ms
memory: 18196kb
input:
100000 99930 100000 57693 79945 98737 35424 72230 86789 10334 86134 79769 54057 84461 18049 49865 20108 72775 85361 22243 50713 54452 26291 87115 27209 98667 21511 19896 37659 14393 49391 88178 57785 43479 12547 35379 2123 64176 52589 58679 19061 3382 15100 21206 46335 64832 93033 15169 79221 12492 ...
output:
Alice Alice Bob Alice Bob Alice Bob Alice Alice Alice Alice Bob Alice Alice Alice Alice Bob Alice Bob Alice Bob Alice Bob Alice Alice Bob Alice Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Alice Alice Alice Alice Bob Alice Alice Bob Alice Bob Alice Bob Alice Alice Bob Alice Bob ...
result:
ok 100000 tokens
Test #56:
score: 0
Accepted
time: 50ms
memory: 16708kb
input:
100000 99926 100000 54458 5150 44306 82889 76338 74926 41724 27403 94448 73986 30958 58083 69919 95942 36730 1706 97937 59615 30364 57040 65291 78994 3867 89459 38712 77958 52826 93439 98214 27542 46337 47937 7636 14547 5287 33505 42581 37756 13120 92917 28059 37541 98633 53712 83408 7733 39067 6922...
output:
Alice Alice Alice Alice Alice Alice Bob Alice Bob Alice Alice Alice Alice Alice Alice Alice Bob Alice Bob Alice Bob Alice Alice Bob Alice Bob Alice Bob Alice Bob Alice Alice Bob Alice Alice Alice Alice Alice Alice Alice Bob Alice Bob Alice Bob Alice Bob Alice Alice Bob Bob Alice Bob Alice Bob Alice ...
result:
ok 100000 tokens
Test #57:
score: 0
Accepted
time: 39ms
memory: 17936kb
input:
100000 99914 100000 4421 46905 20478 23423 27353 33739 63303 60626 83647 72982 2173 1690 628 2827 73141 15032 21311 16453 16904 70043 75527 66919 35176 42063 28666 29206 87552 74771 83426 25196 31292 25151 27353 55514 91294 68307 54469 37381 65022 43865 39267 42488 41029 13239 39945 66370 32481 7488...
output:
Alice Alice Alice Alice Alice Alice Alice Bob Alice Bob Alice Alice Bob Bob Alice Bob Alice Bob Alice Alice Bob Alice Bob Bob Alice Alice Alice Alice Alice Alice Bob Alice Alice Bob Alice Alice Alice Alice Alice Alice Alice Bob Alice Bob Alice Bob Alice Bob Alice Alice Alice Bob Alice Alice Alice Bo...
result:
ok 100000 tokens
Test #58:
score: 0
Accepted
time: 42ms
memory: 16352kb
input:
100000 99926 100000 92844 57222 85554 18541 42915 31815 48987 77454 87126 82437 3725 67563 5607 39360 30809 24968 72776 26530 77710 96295 48695 80072 5607 63254 5706 35242 20170 52027 67768 59407 47631 52486 11629 67061 54821 12751 8183 75251 64829 61720 61061 29049 44654 20337 42658 26858 12821 301...
output:
Bob Alice Bob Alice Alice Alice Bob Alice Bob Alice Alice Alice Alice Bob Alice Alice Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Alice Alice Bob Alice Alice Alice Bob Alice Bob Alice Alice Alice Alice Alice Alice Bob Alice Alice Bob Alice Alice Alice Alice Alice Alice Alice Al...
result:
ok 100000 tokens
Test #59:
score: 0
Accepted
time: 51ms
memory: 17012kb
input:
100000 99928 100000 12192 32089 91043 18172 21040 8849 95188 11538 78263 4748 49992 34758 9136 55044 5739 111 85798 17948 34249 17731 44757 5678 43324 23918 22730 88810 96885 63096 70024 60420 41327 55155 9193 93972 82369 34891 14290 55719 91043 44963 61915 4711 74198 35295 12499 52871 23433 70272 8...
output:
Alice Bob Alice Alice Alice Bob Alice Alice Bob Bob Alice Bob Alice Bob Alice Bob Alice Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Alice Bob Alice Bob Alice Alice Bob Alice Bob Alice Bob Bob Alice Alice Bob Alice Bob Alice Alice Bob Alice Alice Alice Alice Alice Bob Alice Alic...
result:
ok 100000 tokens
Test #60:
score: 0
Accepted
time: 45ms
memory: 18296kb
input:
100000 99932 100000 50045 21495 45712 47301 66587 55689 82810 20981 30339 94391 15303 49964 9041 82066 68900 45242 60475 11430 50944 46750 31268 74368 36842 56551 81447 68238 93675 17381 45166 32268 28674 69184 61597 77006 91887 25229 44571 95613 57107 5256 77285 82773 9041 57196 35637 88597 87924 2...
output:
Alice Bob Alice Alice Bob Alice Alice Alice Alice Bob Alice Bob Alice Bob Bob Alice Alice Alice Bob Alice Alice Alice Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Bob Alice Alice Alice Bob Alice Alice Alice Bob Alice Bob Alice Alice Alice Alice Bob Alice Bob Alice Bob Alice Alic...
result:
ok 100000 tokens
Subtask #7:
score: 0
Runtime Error
Test #61:
score: 0
Runtime Error
input:
100000 99880 100000 87456 56758 21039 93866 26684 26928 36261 38646 93837 81169 36296 6353 88166 12770 96349 79152 60764 55084 67648 76473 67261 81697 1338 12473 36261 24850 64931 59526 7612 4920 37210 86707 11909 71904 28413 92888 50434 86391 84363 85522 56085 64977 94695 65626 87341 83127 38204 33...
output:
result:
Subtask #8:
score: 0
Runtime Error
Test #71:
score: 0
Runtime Error
input:
100000 99880 100000 80697 25247 76841 47922 66709 88229 73265 29962 13180 20319 7033 54171 48021 24356 98808 61348 35961 92937 54442 42820 81432 64668 98653 18142 55715 49600 60985 28959 65046 4093 69598 22205 8119 66290 77738 20602 43567 62376 99070 22510 58039 57749 6112 67601 90321 78734 26200 73...
output:
result:
Subtask #9:
score: 0
Runtime Error
Test #81:
score: 0
Runtime Error
input:
200000 199880 200000 168914 47550 82712 187984 39807 122144 130242 14456 23948 60014 117395 33782 5841 143360 187633 129471 131245 172304 158977 106660 170354 46978 112953 163046 115136 149721 73220 13076 159876 149376 150989 54960 165232 30782 88995 101519 68939 49297 182393 32854 11939 160679 8819...
output:
result:
Subtask #10:
score: 0
Runtime Error
Test #91:
score: 0
Runtime Error
input:
200000 199880 200000 134083 139042 140377 118787 54058 177797 152488 166148 198441 48360 42832 50127 155051 185186 51187 59442 118950 160003 32770 17126 149739 27962 198441 167736 178483 69498 112923 130588 149787 50817 96021 88669 59657 69190 194397 11071 79331 190502 188682 55200 173317 76026 1742...