QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#302907 | #7977. 彩虹航线 | hos_lyric# | 72 | 596ms | 83828kb | C++14 | 7.5kb | 2024-01-11 15:08:55 | 2024-07-04 03:17:56 |
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")
#include <chrono>
#ifdef LOCAL
mt19937_64 rng(58);
#else
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
#endif
namespace bm {
constexpr int LIM_N0 = 210;
constexpr int LIM_N1 = 210;
constexpr int LIM_M = 40010;
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
int N, M, K;
vector<int> A, B;
vector<vector<int>> C;
vector<int> sub3() {
assert(K == 2);
vector<vector<int>> G(N + N);
for (int i = 0; i < M; ++i) {
G[A[i]].push_back(i);
G[N + B[i]].push_back(i);
}
vector<int> ans(M, -1);
vector<int> vis(N + N, 0);
for (int phase = 1; phase <= 2; ++phase) {
for (int r = 0; r < N + N; ++r) if (!vis[r] && (int)G[r].size() == phase) {
vector<int> us, is;
for (int bef = -1, u = r; !vis[u]; ) {
vis[u] = true;
us.push_back(u);
if (us.size() >= 2 && G[u].size() == 1) break;
for (const int i : G[u]) {
const int v = A[i] ^ (N + B[i]) ^ u;
if (bef != v) {
is.push_back(i);
bef = u;
u = v;
goto found;
}
}
assert(false);
found:{}
}
// cerr<<"us = "<<us<<", is = "<<is<<endl;
const int len = is.size();
for (int k0 = 0; k0 < 2; ++k0) {
vector<vector<int>> prv(len, vector<int>(2, -1));
prv[0][k0] = -2;
for (int j = 0; j < len - 1; ++j) {
for (int k = 0; k < 2; ++k) if (~prv[j][k]) {
for (int kk = 0; kk < 2; ++kk) if (C[is[j]][k] != C[is[j + 1]][kk]) {
prv[j + 1][kk] = k;
}
}
}
for (int k1 = 0; k1 < 2; ++k1) if (~prv[len - 1][k1]) {
if (us.size() == is.size() && C[is[len - 1]][k1] == C[is[0]][k0]) {
continue;
}
for (int j = len - 1, k = k1; j >= 0; --j) {
ans[is[j]] = C[is[j]][k];
k = prv[j][k];
}
goto solved;
}
}
solved:{}
}
}
return ans;
}
vector<int> uso() {
int limC = 0;
for (int i = 0; i < M; ++i) {
for (int k = 0; k < K; ++k) {
chmax(limC, C[i][k]);
}
}
++limC;
vector<vector<int>> iss(limC);
for (int i = 0; i < M; ++i) {
for (int k = 0; k < K; ++k) {
iss[C[i][k]].push_back(i);
}
}
for (; ; ) {
vector<int> cs(limC);
for (int c = 0; c < limC; ++c) cs[c] = c;
shuffle(cs.begin(), cs.end(), rng);
stable_sort(cs.begin(), cs.end(), [&](int c0, int c1) -> bool {
return (iss[c0].size() > iss[c1].size());
});
vector<int> ans(M, -1);
vector<int> idsA(N, -1), idsB(N, -1);
for (const int c : cs) {
vector<int> is;
for (const int i : iss[c]) if (!~ans[i]) {
is.push_back(i);
}
if (is.size()) {
shuffle(is.begin(), is.end(), rng);
vector<int> as, bs;
for (const int i : is) {
as.push_back(A[i]);
bs.push_back(B[i]);
}
sort(as.begin(), as.end());
sort(bs.begin(), bs.end());
as.erase(unique(as.begin(), as.end()), as.end());
bs.erase(unique(bs.begin(), bs.end()), bs.end());
shuffle(as.begin(), as.end(), rng);
shuffle(bs.begin(), bs.end(), rng);
const int asLen = as.size();
const int bsLen = bs.size();
for (int x = 0; x < asLen; ++x) idsA[as[x]] = x;
for (int y = 0; y < bsLen; ++y) idsB[bs[y]] = y;
bm::init(asLen, bsLen);
for (const int i : is) {
bm::ae(idsA[A[i]], idsB[B[i]]);
}
bm::run();
for (const int i : is) {
if (bm::to[idsA[A[i]]] == idsB[B[i]]) {
ans[i] = c;
}
}
}
}
bool ok = true;
for (int i = 0; i < M; ++i) {
ok = ok && (~ans[i]);
}
if (ok) {
return ans;
}
}
}
int main() {
for (; ~scanf("%d%d%d", &N, &M, &K); ) {
A.resize(M);
B.resize(M);
C.assign(M, vector<int>(K));
for (int i = 0; i < M; ++i) {
scanf("%d%d", &A[i], &B[i]);
--A[i];
--B[i];
for (int k = 0; k < K; ++k) {
scanf("%d", &C[i][k]);
}
}
vector<int> ans;
if (K == 2) {
ans = sub3();
} else {
ans = uso();
}
for (int i = 0; i < M; ++i) {
if (i) printf(" ");
printf("%d", ans[i]);
}
puts("");
}
return 0;
}
詳細信息
Subtask #1:
score: 1
Accepted
Test #1:
score: 1
Accepted
time: 1ms
memory: 3840kb
input:
150 150 1 144 5 1 141 54 1 26 120 1 148 68 1 136 62 1 114 1 1 33 136 1 85 100 1 97 124 1 84 66 1 107 81 1 82 135 1 112 44 1 20 89 1 50 32 1 52 94 1 89 88 1 3 57 1 130 23 1 140 150 1 96 37 1 122 38 1 41 63 1 99 85 1 13 95 1 142 47 1 95 4 1 69 17 1 27 119 1 73 93 1 108 43 1 54 18 1 37 76 1 67 114 1 40...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
result:
ok construction is correct.
Test #2:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
150 150 1 117 132 96 147 4 114 67 57 60 62 94 20 48 117 68 31 144 27 19 44 121 3 51 92 83 52 67 26 125 56 8 124 75 125 31 52 79 8 21 132 14 136 77 111 45 134 136 145 129 73 85 122 92 143 59 76 36 60 127 115 102 126 133 10 106 32 93 35 106 75 47 102 45 140 41 44 108 146 25 98 106 140 116 76 143 3 87 ...
output:
96 114 60 20 68 27 121 92 67 56 75 52 21 136 45 145 85 143 36 115 133 32 106 102 41 146 106 76 87 90 116 15 147 51 35 85 15 83 43 105 89 12 89 140 103 114 135 78 93 80 87 93 19 7 125 132 96 96 99 48 1 63 3 6 146 116 48 9 126 6 106 64 74 84 16 23 119 51 7 83 96 56 94 97 27 15 51 106 95 32 70 103 75 8...
result:
ok construction is correct.
Test #3:
score: 0
Accepted
time: 0ms
memory: 4100kb
input:
150 10 1 35 145 1 145 88 2 130 14 1 111 142 1 138 99 1 76 73 1 101 79 1 147 137 2 65 64 1 108 8 2
output:
1 2 1 1 1 1 1 2 1 2
result:
ok construction is correct.
Subtask #2:
score: 2
Accepted
Test #4:
score: 2
Accepted
time: 181ms
memory: 48332kb
input:
75 5625 150 11 6 680849 150419 731361 419631 223710 806977 837589 529911 568337 456216 515190 302854 672904 388629 548276 803173 770491 610684 550790 786097 253610 446581 705772 610053 637171 567249 365794 571846 431219 213414 466432 53255 748825 765338 761154 556712 159152 463622 706471 49434 59624...
output:
273492 589359 133317 352632 662071 341531 724388 459972 684378 200061 583789 413642 791321 195276 289550 273715 158055 219768 473001 712605 562694 691549 293935 365231 164046 417391 196962 737469 339927 812720 628868 93324 337475 90827 102359 27191 506861 646926 516499 788116 763852 508398 723551 70...
result:
ok construction is correct.
Test #5:
score: 0
Accepted
time: 62ms
memory: 12192kb
input:
75 5625 150 55 59 136 110 80 141 34 72 121 2 116 38 39 16 56 20 147 81 58 64 24 83 73 30 127 97 128 35 77 96 54 21 106 57 32 115 133 84 50 103 94 45 68 53 31 8 55 44 89 41 36 150 3 28 9 98 66 49 119 101 114 112 82 11 22 124 134 107 105 90 88 145 87 135 26 79 37 122 10 15 104 27 18 120 7 13 46 139 40...
output:
97 147 131 127 90 35 113 27 37 130 61 59 136 130 64 73 46 129 78 112 3 83 64 129 75 68 96 121 10 142 113 53 26 42 86 124 46 4 106 109 20 81 149 147 56 83 35 115 61 22 145 22 99 35 42 61 31 69 83 35 97 66 56 57 147 93 7 106 127 113 68 130 80 93 78 112 87 51 1 66 130 68 115 127 22 43 42 7 42 18 5 142 ...
result:
ok construction is correct.
Test #6:
score: 0
Accepted
time: 123ms
memory: 33480kb
input:
75 3750 150 1 29 15545 372923 77579 125076 509966 151564 332286 414939 296369 227609 9580 52174 99587 224186 2679 309545 38096 115252 281893 44718 259941 187595 500086 197842 267668 399469 254416 114691 268905 112134 257669 210411 135373 423915 537194 17707 204354 99757 234452 307155 82087 64190 309...
output:
53110 163048 433697 415006 35088 211280 44715 232302 101919 554227 81138 76454 376051 196815 489706 489706 197447 506579 384294 75004 43677 489718 490246 317380 369172 178241 321339 197779 105341 114871 84593 131644 115201 61390 418981 57467 437567 230244 95189 432617 306592 260359 78184 351786 2989...
result:
ok construction is correct.
Test #7:
score: 0
Accepted
time: 39ms
memory: 8544kb
input:
75 3750 150 43 71 86 127 132 6 139 123 83 37 85 103 52 102 4 148 111 34 110 66 42 130 150 149 53 45 137 129 2 5 87 79 146 47 9 98 96 54 17 126 81 115 7 105 117 119 101 144 74 23 44 19 84 97 50 13 22 94 78 63 134 40 142 76 109 95 12 138 112 72 136 24 77 31 32 118 124 135 68 104 16 1 93 106 128 51 20 ...
output:
80 47 40 130 130 100 97 41 67 122 39 130 141 107 35 80 84 121 15 122 33 6 66 93 100 85 124 67 136 94 6 17 60 5 28 107 107 60 107 141 33 93 47 29 85 97 98 17 105 39 108 46 4 5 94 85 62 28 124 84 60 80 2 38 122 125 60 44 35 60 121 44 17 47 53 39 62 6 94 44 46 62 44 127 89 105 11 103 38 19 6 100 6 17 1...
result:
ok construction is correct.
Subtask #3:
score: 11
Accepted
Test #8:
score: 11
Accepted
time: 0ms
memory: 3876kb
input:
150 300 2 81 6 1 2 64 88 1 2 5 76 2 1 22 9 2 1 32 142 1 2 97 32 2 1 18 87 1 2 146 100 2 1 56 139 1 2 61 109 2 1 124 105 2 1 126 145 1 2 16 19 1 2 16 138 2 1 131 111 2 1 145 111 2 1 59 59 2 1 89 43 1 2 2 38 1 2 63 149 2 1 46 48 1 2 140 131 1 2 86 10 2 1 116 40 1 2 123 38 2 1 75 109 2 1 131 142 1 2 9 ...
output:
1 1 1 1 1 2 1 1 2 1 2 2 2 1 1 2 2 1 1 1 2 2 2 1 2 2 2 2 1 2 2 1 1 1 1 1 2 2 1 2 2 1 2 2 2 1 2 1 1 1 1 2 2 2 2 2 1 2 1 1 1 2 1 2 2 1 2 1 1 2 2 2 2 1 1 1 2 1 2 1 1 2 1 2 1 2 2 2 1 2 2 1 2 1 1 2 2 2 2 2 1 2 1 2 1 2 1 2 1 1 1 1 1 2 1 2 2 1 2 1 2 2 1 1 2 1 2 1 2 2 1 1 1 1 1 1 2 2 1 2 1 1 1 1 1 2 1 2 2 1 ...
result:
ok construction is correct.
Test #9:
score: 0
Accepted
time: 0ms
memory: 4008kb
input:
150 300 2 60 122 3 1 114 17 2 1 21 19 3 1 134 75 3 1 64 81 2 1 52 33 1 3 45 27 1 2 148 91 2 1 110 100 1 2 100 74 2 3 53 130 3 2 59 19 3 1 149 108 3 1 19 92 1 3 85 66 3 2 80 89 3 2 16 4 2 3 39 90 2 3 53 102 3 1 20 21 3 1 21 112 1 3 76 98 1 2 7 130 3 1 140 129 2 3 139 100 3 1 127 77 1 3 136 113 3 2 54...
output:
3 1 3 1 1 3 2 1 2 2 2 1 1 3 2 2 3 2 1 3 1 2 1 3 1 3 2 2 2 3 1 2 2 1 3 3 1 1 1 2 2 1 3 3 3 2 1 1 1 3 1 2 1 3 3 2 3 2 2 2 3 2 1 3 3 2 2 3 1 2 2 3 2 1 1 1 3 1 3 3 3 3 1 3 1 3 1 3 1 1 2 3 2 1 3 3 2 1 3 3 1 3 1 1 2 2 2 2 2 2 2 2 1 3 2 1 2 2 3 2 2 1 2 1 1 2 2 2 1 1 2 2 3 2 3 2 1 3 3 3 1 3 3 2 2 3 2 2 3 1 ...
result:
ok construction is correct.
Test #10:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
150 300 2 27 132 4 3 36 120 3 4 100 77 2 3 139 62 2 1 106 59 2 3 33 69 2 3 111 14 4 2 90 140 1 2 38 63 2 4 76 49 1 4 49 26 4 2 50 100 2 4 116 7 3 4 143 127 3 4 43 105 3 1 65 72 3 4 94 111 1 2 70 72 1 2 49 107 3 2 92 27 4 2 42 119 4 1 42 46 2 1 88 143 4 3 79 99 2 3 3 84 4 1 85 13 4 2 38 67 1 3 43 31 ...
output:
3 4 3 1 3 2 4 2 4 1 4 4 4 3 1 4 2 2 2 2 4 2 4 3 1 2 3 2 3 4 4 1 2 4 4 4 3 3 1 3 1 2 3 1 4 1 2 2 2 1 1 2 3 4 4 4 4 3 1 3 2 4 1 2 4 1 2 3 3 1 4 2 1 1 2 2 1 2 2 4 4 4 2 2 2 3 3 3 1 4 3 1 4 4 2 3 1 3 2 1 1 3 4 2 3 2 3 2 4 3 3 1 1 4 1 3 1 2 3 1 1 2 4 2 2 3 2 2 4 4 2 2 1 4 4 2 4 4 1 3 1 4 3 1 4 2 4 3 1 4 ...
result:
ok construction is correct.
Test #11:
score: 0
Accepted
time: 0ms
memory: 3944kb
input:
150 300 2 87 61 2 16 114 49 13 10 25 34 13 18 19 62 2 6 44 60 10 14 132 71 20 18 40 51 13 17 67 25 13 18 125 40 19 14 82 53 19 8 66 118 19 3 38 136 6 12 150 135 14 7 75 53 10 1 54 33 4 8 69 19 8 5 129 72 13 17 149 74 14 10 136 117 1 18 13 80 4 18 107 11 13 18 41 14 3 10 15 90 3 11 104 43 6 18 52 80 ...
output:
16 10 18 6 14 18 17 18 14 19 3 12 7 1 8 5 17 10 18 18 18 10 11 18 6 17 17 17 18 2 17 16 19 19 13 8 11 3 11 7 20 10 3 20 4 5 4 12 6 20 7 1 7 13 4 11 19 6 12 2 8 5 20 1 14 1 4 14 1 7 19 14 17 10 2 2 10 11 2 4 6 14 20 3 20 15 3 20 12 6 17 18 8 16 13 5 6 18 7 9 4 3 1 3 10 11 3 17 2 13 6 13 6 1 10 12 1 7...
result:
ok construction is correct.
Test #12:
score: 0
Accepted
time: 0ms
memory: 3940kb
input:
150 300 2 46 114 441 328 119 80 69 102 9 78 444 336 8 47 230 59 60 140 548 248 147 131 36 399 68 86 447 183 97 13 461 318 31 93 536 570 35 41 237 149 53 77 156 95 123 119 562 202 94 26 519 23 129 128 438 80 74 139 454 108 92 68 559 399 140 61 11 178 106 137 15 575 140 15 22 289 65 50 263 546 9 45 31...
output:
328 102 336 59 248 399 183 318 570 149 95 202 23 80 108 399 178 575 289 546 171 523 85 207 371 505 367 230 237 552 547 454 287 229 297 110 260 168 473 90 326 137 118 358 29 51 332 566 527 299 15 453 296 328 154 327 184 467 427 154 453 463 458 526 466 496 253 232 570 106 165 168 323 34 533 155 410 59...
result:
ok construction is correct.
Test #13:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
150 150 2 138 25 1 2 71 40 2 1 146 116 1 2 110 122 2 1 59 36 1 2 147 145 2 1 80 88 2 1 38 13 1 2 137 6 1 2 57 84 2 1 25 84 2 1 125 75 2 1 73 128 1 2 94 69 2 1 27 18 1 2 89 119 1 2 8 131 1 2 62 3 1 2 32 67 2 1 77 77 2 1 78 6 1 2 142 70 2 1 61 16 2 1 21 129 2 1 2 126 1 2 136 128 1 2 141 35 2 1 65 78 1...
output:
1 1 2 1 1 1 2 2 1 1 2 2 1 2 2 1 1 1 2 2 2 2 2 2 2 2 2 2 2 1 1 2 2 1 2 1 1 1 1 2 2 1 2 1 1 2 2 2 1 1 2 1 1 2 1 2 2 1 2 1 2 2 1 1 2 2 2 2 2 1 2 1 2 2 1 1 1 1 2 1 1 1 2 2 2 2 1 2 2 1 2 1 1 1 2 2 1 1 1 1 1 1 1 1 2 2 2 1 1 1 1 1 2 1 2 1 2 2 2 1 2 2 1 2 1 2 1 1 2 2 1 1 2 1 1 1 1 1 1 1 1 1 2 1 1 2 2 2 2 1
result:
ok construction is correct.
Test #14:
score: 0
Accepted
time: 0ms
memory: 3904kb
input:
150 150 2 73 97 3 2 50 90 3 1 106 133 1 3 2 65 1 2 47 141 3 2 75 24 1 2 93 85 2 1 14 12 3 2 53 15 2 1 136 120 1 3 68 49 1 2 13 127 2 3 26 87 1 3 78 79 1 3 130 97 3 1 3 8 3 1 55 3 3 1 122 27 3 1 39 51 2 3 72 64 2 3 85 98 2 1 148 18 2 1 90 110 3 1 21 89 2 1 116 75 1 2 52 99 1 2 41 29 1 3 60 130 2 1 10...
output:
3 1 3 1 2 1 2 3 2 1 2 3 1 1 1 3 3 3 2 2 1 2 1 2 2 2 1 2 1 2 1 1 2 1 1 2 2 2 3 3 3 3 3 2 1 2 2 3 2 2 2 3 1 3 3 2 3 3 3 1 3 2 1 1 3 3 1 3 3 2 3 2 1 1 2 3 2 2 2 2 3 2 1 3 1 2 3 2 1 1 3 1 2 3 1 1 3 3 2 3 1 1 3 2 3 3 2 3 3 1 1 1 3 1 1 3 3 3 3 3 1 3 2 3 3 2 1 3 3 2 2 3 1 2 2 2 2 2 2 1 3 1 3 2 3 1 1 1 1 1
result:
ok construction is correct.
Test #15:
score: 0
Accepted
time: 0ms
memory: 4144kb
input:
150 150 2 134 2 3 4 139 116 2 4 100 69 1 4 45 66 4 2 24 64 2 3 93 43 4 2 137 144 1 3 40 105 1 4 134 108 2 4 98 40 3 1 20 144 3 1 11 51 3 2 101 89 1 3 46 53 1 2 39 23 1 3 109 40 2 3 30 7 2 3 142 6 1 3 38 112 4 2 108 28 1 2 111 32 1 4 28 49 4 2 89 14 2 4 65 143 4 3 43 8 1 2 92 56 4 2 106 53 2 4 117 14...
output:
4 4 1 4 2 2 1 1 2 1 3 3 1 2 1 2 3 1 2 2 1 4 2 4 2 4 4 2 2 4 1 2 1 4 4 3 4 2 3 2 1 3 2 2 3 4 1 2 4 1 3 3 3 2 3 2 3 4 2 2 1 3 1 4 3 1 4 1 2 3 3 1 1 2 1 3 1 2 2 2 3 2 2 1 4 3 3 1 3 1 3 3 4 4 3 4 1 4 1 4 1 3 4 4 1 1 4 2 1 2 3 2 4 1 1 4 1 3 2 4 3 2 1 2 4 2 4 2 2 3 4 2 3 3 1 3 2 2 3 2 3 3 3 1 4 4 1 2 1 4
result:
ok construction is correct.
Test #16:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
150 150 2 42 118 2 5 44 13 7 14 95 7 20 11 92 142 11 19 96 150 10 18 11 52 6 18 66 48 1 13 17 5 13 16 91 22 8 20 19 71 15 6 73 61 10 5 50 63 3 14 101 143 20 5 52 114 12 17 111 60 19 9 20 4 6 7 54 63 16 18 31 31 9 4 33 148 10 8 37 32 17 19 60 57 20 8 31 136 8 1 65 87 19 4 138 72 6 17 71 112 8 20 83 3...
output:
2 14 20 11 10 6 1 13 8 6 5 14 5 12 19 7 16 9 8 17 20 8 19 17 8 11 2 6 9 8 13 10 2 19 9 1 1 12 18 10 18 20 20 6 19 4 8 3 13 2 13 20 19 8 1 19 10 14 5 16 11 20 8 11 4 17 6 7 11 18 5 8 2 16 5 7 10 5 20 7 8 15 9 15 13 17 5 16 5 17 19 20 1 17 12 18 16 5 3 14 1 13 20 18 6 7 8 10 9 3 15 19 15 19 18 18 10 3...
result:
ok construction is correct.
Test #17:
score: 0
Accepted
time: 0ms
memory: 4088kb
input:
150 150 2 137 126 61 39 96 140 224 95 145 72 296 11 23 92 241 36 98 129 102 20 90 41 85 39 41 113 188 148 93 131 282 107 10 76 23 225 8 16 16 124 115 135 270 30 20 129 88 48 110 125 94 272 101 98 56 238 106 116 125 110 73 138 234 193 22 127 245 8 58 29 8 140 86 36 212 170 40 97 288 204 30 50 109 75 ...
output:
39 95 296 241 20 85 188 282 23 16 30 88 272 238 125 234 8 8 212 288 109 280 286 221 200 129 221 76 94 73 87 71 88 43 79 32 215 138 232 82 294 12 85 9 246 6 67 32 191 208 296 190 92 97 55 200 14 42 278 209 266 151 235 132 237 222 102 204 198 201 154 245 133 149 26 21 138 261 47 128 87 93 144 74 126 2...
result:
ok construction is correct.
Subtask #4:
score: 37
Accepted
Test #18:
score: 37
Accepted
time: 310ms
memory: 35672kb
input:
149 22201 150 106 24 20 90 56 109 85 33 76 25 97 77 134 75 15 24 88 16 93 126 43 94 116 120 28 130 21 140 70 111 71 32 29 41 132 39 84 62 27 92 55 117 129 125 127 104 74 114 14 145 36 121 22 69 68 133 59 65 58 148 131 40 54 118 110 3 61 105 4 112 142 122 73 37 1 113 45 87 57 89 103 98 100 63 146 106...
output:
94 134 52 6 15 12 115 50 118 23 22 137 33 12 72 123 131 99 42 23 90 41 30 77 92 22 121 68 76 89 36 44 51 14 55 145 55 111 50 31 2 119 136 67 85 90 118 98 87 11 78 55 145 45 138 117 114 113 41 89 81 6 32 47 17 132 30 111 123 76 57 80 33 132 113 60 30 86 145 148 35 15 1 106 49 7 126 86 105 135 130 19 ...
result:
ok construction is correct.
Test #19:
score: 0
Accepted
time: 302ms
memory: 35796kb
input:
149 22201 150 59 87 57 143 9 144 61 104 129 116 26 50 73 24 138 78 82 137 4 100 81 69 101 140 102 115 149 18 42 54 16 28 75 74 130 70 35 12 29 36 2 121 62 37 21 64 71 133 110 96 58 67 59 128 124 56 106 103 53 107 49 141 90 105 8 1 65 13 146 77 83 22 134 84 108 119 44 15 32 88 17 79 48 33 46 120 111 ...
output:
23 26 36 140 40 90 71 96 40 36 47 129 40 151 116 40 20 149 34 96 26 97 33 56 69 151 83 18 76 57 94 12 9 35 146 87 97 36 133 41 17 32 76 67 67 139 88 95 36 3 145 113 129 15 114 106 67 99 60 109 106 91 120 124 101 40 136 1 28 149 120 43 79 130 122 59 114 75 18 71 104 87 32 128 65 146 120 17 104 110 44...
result:
ok construction is correct.
Test #20:
score: 0
Accepted
time: 307ms
memory: 36008kb
input:
149 22201 150 85 67 67 47 152 75 90 126 113 128 46 30 36 85 21 97 79 16 61 39 120 99 153 105 76 107 56 116 118 119 122 94 9 127 12 15 68 104 80 7 100 146 125 95 53 112 74 143 81 27 1 52 40 71 29 88 139 69 13 11 92 132 45 42 38 151 3 60 24 91 2 25 86 133 41 10 33 135 82 57 110 6 114 140 138 62 87 64 ...
output:
128 43 31 71 42 121 33 31 27 25 39 77 84 35 35 35 22 20 33 57 90 51 57 89 14 73 101 13 44 87 140 68 35 113 24 113 148 134 1 9 10 91 36 125 26 110 139 58 1 25 144 120 104 8 125 127 75 111 86 76 28 46 68 75 23 29 92 17 19 88 131 132 11 15 28 3 125 15 116 49 74 109 48 68 2 27 146 63 111 14 136 1 99 63 ...
result:
ok construction is correct.
Test #21:
score: 0
Accepted
time: 300ms
memory: 37080kb
input:
149 22201 150 20 14 155 45 96 11 71 74 38 143 146 165 31 128 56 133 137 127 4 75 108 44 69 77 141 55 113 22 163 54 67 29 23 37 63 148 25 117 97 65 89 76 51 112 139 151 109 66 82 114 13 80 73 119 61 84 53 40 156 24 20 164 50 122 124 158 8 118 7 120 160 154 152 145 46 138 30 162 132 16 59 15 91 94 52 ...
output:
38 4 91 7 84 154 111 36 29 156 29 134 36 20 64 37 31 42 54 113 49 36 27 14 19 44 134 26 12 12 115 78 34 13 21 49 45 62 109 15 134 1 86 98 121 110 72 118 77 18 32 116 101 67 125 107 48 34 27 76 44 66 24 80 81 95 108 46 109 157 38 75 137 113 72 141 40 72 44 84 135 141 32 30 43 159 141 44 107 5 50 92 7...
result:
ok construction is correct.
Test #22:
score: 0
Accepted
time: 581ms
memory: 83192kb
input:
149 22201 150 64 32 323179 933179 87351 997262 611605 404909 732640 452641 642757 539724 945803 438567 594564 413639 542011 13240 428009 469975 976134 998911 916345 580907 215711 24916 933666 193524 159822 766638 161868 151754 502972 194801 55497 466348 151018 849178 317067 34382 293653 929582 83436...
output:
323179 839038 548746 594030 981148 79546 228715 935714 891291 192278 885592 375657 645679 379164 904065 89577 68781 395489 133839 60599 192099 749454 217164 57843 609649 706673 817167 507966 800075 288869 402960 491551 396136 415808 742198 173368 750883 693811 940630 131434 901799 760318 970106 2891...
result:
ok construction is correct.
Subtask #5:
score: 21
Accepted
Test #23:
score: 21
Accepted
time: 319ms
memory: 36240kb
input:
150 22500 150 117 116 91 74 113 95 110 26 141 115 38 66 71 138 17 83 112 99 149 18 3 44 15 28 53 114 96 37 7 145 20 109 80 19 117 16 63 27 42 137 135 132 14 39 1 148 147 30 68 126 12 32 57 67 119 139 124 46 133 24 36 51 69 88 131 60 86 140 102 29 100 150 35 123 84 85 90 105 75 45 77 143 130 127 98 7...
output:
66 44 74 4 22 56 78 126 130 62 88 128 149 74 139 143 6 26 125 25 135 27 136 37 78 35 100 17 126 75 82 97 111 73 14 37 65 91 70 138 22 29 56 48 148 14 72 1 112 31 88 125 140 104 143 143 29 133 104 107 5 31 17 132 92 105 33 65 123 8 55 39 58 108 112 134 136 38 123 113 111 89 60 9 89 98 74 44 30 50 149...
result:
ok construction is correct.
Test #24:
score: 0
Accepted
time: 302ms
memory: 35812kb
input:
150 22500 150 147 68 107 8 61 49 133 15 148 55 122 84 72 75 29 19 118 99 51 79 142 117 11 50 149 69 87 45 73 92 41 110 56 144 128 47 77 78 141 48 31 53 136 103 94 26 145 151 121 46 101 58 38 10 102 126 22 140 138 40 129 96 82 150 95 30 27 100 28 13 114 74 81 52 116 17 4 143 66 90 20 2 111 21 7 91 68...
output:
6 14 58 55 96 92 1 29 32 40 130 96 18 137 86 114 118 124 28 81 101 47 15 136 47 90 136 50 46 44 139 131 2 56 91 33 75 83 27 76 145 1 87 108 124 8 142 85 111 51 107 104 17 140 139 121 4 87 37 26 136 108 74 89 145 43 27 92 133 72 129 5 84 70 98 87 121 47 42 86 86 11 138 63 140 139 12 105 138 40 47 38 ...
result:
ok construction is correct.
Test #25:
score: 0
Accepted
time: 316ms
memory: 36176kb
input:
150 22500 150 53 59 70 142 54 108 56 6 22 92 39 80 38 84 125 144 117 127 74 71 40 140 33 146 145 72 85 44 128 45 86 94 93 66 34 52 21 59 57 137 78 120 63 67 13 124 2 126 60 76 79 102 116 100 23 150 58 115 107 82 104 138 97 151 106 131 152 42 132 77 32 11 89 55 30 31 95 49 65 96 141 135 17 114 143 14...
output:
140 144 143 59 78 73 20 1 76 38 135 62 6 108 138 54 84 97 80 54 118 24 72 33 34 57 129 90 85 44 61 127 148 21 35 14 63 138 12 96 7 62 106 53 151 89 77 78 13 32 76 35 136 45 21 76 37 80 22 34 80 147 69 104 134 107 129 15 46 4 17 87 48 120 84 147 77 88 129 111 23 35 30 13 122 38 90 90 25 112 5 142 50 ...
result:
ok construction is correct.
Test #26:
score: 0
Accepted
time: 310ms
memory: 36328kb
input:
150 22500 150 81 87 83 67 109 57 147 69 102 72 25 29 39 94 56 73 27 41 81 53 144 101 135 117 127 96 5 145 155 22 87 106 38 19 14 86 58 97 20 35 65 124 47 93 50 10 75 80 52 31 76 154 126 78 91 113 42 118 9 115 15 51 149 141 119 134 92 74 64 129 66 103 110 49 85 143 133 148 12 61 142 151 131 153 21 34...
output:
113 144 96 73 64 57 130 129 13 68 120 118 46 109 65 78 121 112 5 63 82 41 73 101 60 43 12 119 117 96 113 126 67 9 103 54 65 52 83 151 116 26 81 95 3 128 116 56 146 35 73 65 100 59 144 131 37 43 47 98 29 72 54 24 122 30 106 31 63 148 43 89 142 3 19 99 36 7 129 132 101 84 140 11 109 12 31 21 69 140 30...
result:
ok construction is correct.
Test #27:
score: 0
Accepted
time: 309ms
memory: 36948kb
input:
150 22500 150 21 135 30 53 162 62 34 163 112 104 16 67 48 161 137 99 94 93 158 20 70 91 12 148 40 24 141 131 29 132 14 44 31 7 167 146 35 113 45 39 136 84 142 108 87 123 129 85 58 134 5 166 28 73 128 56 80 147 155 6 149 76 41 36 88 66 121 86 168 97 63 47 26 116 169 151 95 15 100 19 50 103 98 126 38 ...
output:
12 166 20 52 86 99 81 2 15 76 154 160 149 44 114 13 53 65 46 52 102 32 57 131 168 168 137 161 86 167 146 96 125 55 113 79 129 72 36 27 77 39 4 136 24 149 108 101 67 58 17 106 45 41 40 60 53 47 60 41 67 64 19 2 106 94 2 60 53 150 55 51 92 55 68 27 54 66 123 58 32 21 34 111 131 138 9 47 105 18 119 74 ...
result:
ok construction is correct.
Test #28:
score: 0
Accepted
time: 596ms
memory: 83828kb
input:
150 22500 150 142 84 95127 811376 352518 34572 172491 645409 426070 585385 839136 465937 516075 461423 149284 929627 554965 743036 475305 268781 574670 840165 214086 131675 655651 402556 295405 797734 729790 132978 283490 807542 165311 188276 808619 466578 568749 15488 450230 528624 262879 824125 58...
output:
34572 983994 972615 136923 885508 261337 870536 434229 133921 922116 578723 853773 809838 314335 144339 745900 177135 757083 271731 238058 859533 429210 863766 543416 327851 69803 73171 516641 953787 632904 628674 911725 500762 95533 996971 385603 894581 525359 921741 980956 285553 652157 860649 779...
result:
ok construction is correct.
Subtask #6:
score: 0
Time Limit Exceeded
Test #29:
score: 28
Accepted
time: 1ms
memory: 3948kb
input:
150 450 3 57 22 2 1 3 142 57 1 3 2 138 113 3 1 2 13 77 2 3 1 43 112 1 2 3 82 99 2 1 3 66 65 3 1 2 3 31 2 1 3 24 146 3 2 1 127 18 2 3 1 125 37 1 2 3 13 137 1 2 3 105 127 1 3 2 54 20 1 2 3 48 15 3 1 2 23 71 2 3 1 30 28 1 2 3 125 146 1 3 2 68 120 2 1 3 38 92 2 1 3 101 100 1 3 2 81 28 1 3 2 70 7 1 2 3 1...
output:
2 1 2 3 1 2 3 2 1 1 2 1 1 2 2 1 2 3 1 1 3 1 2 1 1 2 3 3 2 3 1 3 1 1 1 1 1 2 2 3 2 2 2 2 2 3 3 2 3 3 2 1 3 3 1 1 1 3 2 3 1 2 2 3 3 1 3 1 1 3 1 3 3 3 2 1 3 3 1 1 3 1 2 1 2 2 3 2 3 1 1 3 2 3 1 2 3 1 3 1 3 1 3 2 2 3 3 2 1 1 3 2 1 1 1 3 2 2 3 1 1 1 2 2 2 2 2 1 2 3 1 1 2 3 3 2 2 3 3 2 2 2 3 1 3 2 1 2 3 2 ...
result:
ok construction is correct.
Test #30:
score: 0
Accepted
time: 1ms
memory: 3924kb
input:
150 450 3 148 73 905 1007 1204 72 13 614 952 114 72 3 1026 931 764 33 21 1143 204 536 19 112 694 1261 734 104 68 1057 72 1249 83 66 311 147 656 141 5 1349 1317 700 12 113 331 375 1165 49 7 1114 1149 1224 79 41 531 46 712 128 20 630 1175 399 35 74 421 1148 608 57 124 840 108 1238 63 22 922 403 203 35...
output:
1204 952 764 536 1261 1249 147 700 375 1149 46 630 421 840 403 1032 910 379 198 708 890 211 42 654 939 976 1321 835 1233 94 212 1288 650 639 130 708 990 797 249 564 1067 1012 529 567 46 1184 23 460 1068 1077 894 1321 535 1150 655 351 233 405 38 1317 250 1316 1336 1067 1342 1068 146 917 366 1005 1195...
result:
ok construction is correct.
Test #31:
score: 0
Accepted
time: 44ms
memory: 4032kb
input:
150 450 3 111 66 3 4 1 62 51 3 2 4 117 58 3 4 1 54 105 1 3 4 40 108 3 1 4 104 112 2 4 1 131 73 4 3 1 109 30 1 4 3 36 130 3 4 2 40 70 2 3 1 24 112 3 1 4 44 119 4 1 2 39 91 1 4 3 28 118 1 2 3 8 117 2 4 1 110 109 3 1 4 99 20 4 1 2 131 49 4 1 2 130 114 1 4 3 133 57 3 1 2 41 125 1 3 4 21 65 1 2 3 144 143...
output:
3 3 3 4 4 4 4 4 4 3 3 2 3 3 2 1 1 1 4 2 3 1 4 4 3 1 2 1 4 2 4 2 4 3 3 3 4 4 4 4 2 1 2 1 1 4 1 2 1 2 4 3 4 4 2 1 4 1 3 3 1 1 4 4 1 4 4 4 3 1 3 3 3 3 3 3 1 4 1 1 3 3 3 4 2 3 1 2 2 1 1 3 3 3 3 4 1 4 2 1 3 2 4 3 1 1 2 4 2 4 1 4 3 1 3 4 3 1 3 3 1 3 1 1 3 4 1 4 4 4 3 2 3 3 1 1 1 4 4 3 1 2 3 3 4 3 3 1 3 3 ...
result:
ok construction is correct.
Test #32:
score: 0
Accepted
time: 0ms
memory: 4200kb
input:
150 450 3 79 108 4 7 3 85 72 8 3 7 105 47 5 2 8 56 47 3 4 5 66 90 7 5 3 109 68 8 1 7 84 73 5 2 3 14 7 8 5 6 129 111 5 1 2 103 45 1 6 7 102 96 7 3 2 30 80 6 1 8 22 80 5 1 6 55 21 6 3 5 4 104 6 3 8 27 130 2 1 3 64 109 7 2 4 20 110 7 8 6 5 50 5 8 2 116 8 7 8 6 5 74 3 1 6 86 124 2 4 7 129 57 2 7 8 2 9 2...
output:
3 3 5 3 5 7 2 5 5 1 7 1 5 5 3 2 7 8 2 6 1 7 7 2 7 2 2 2 5 6 3 1 6 5 8 3 5 2 1 1 1 2 3 5 6 2 5 1 5 5 6 7 5 1 2 1 6 2 2 1 2 6 1 1 6 1 6 2 1 2 5 3 5 6 2 1 7 2 1 5 3 5 6 8 2 6 1 3 3 2 5 2 1 2 5 1 1 5 2 7 8 2 2 1 2 1 4 7 7 2 2 3 2 1 5 1 3 2 7 4 2 2 6 1 8 2 2 1 1 3 1 3 5 3 1 6 2 2 3 2 6 1 2 3 1 3 2 1 1 2 ...
result:
ok construction is correct.
Test #33:
score: 0
Accepted
time: 11ms
memory: 3844kb
input:
150 350 3 69 53 1 2 3 73 148 3 1 2 29 58 3 1 2 19 84 3 1 2 8 134 3 1 2 46 147 2 3 1 115 114 2 3 1 9 13 1 2 3 27 96 1 3 2 38 75 1 3 2 127 43 2 3 1 18 100 3 1 2 134 36 3 1 2 37 14 1 3 2 33 131 2 3 1 114 17 2 1 3 86 57 2 1 3 136 12 2 3 1 7 121 3 1 2 95 51 2 1 3 84 40 1 3 2 73 47 1 3 2 116 46 2 3 1 133 ...
output:
3 2 3 3 1 3 1 3 2 2 1 1 2 3 2 1 3 2 3 1 2 3 1 1 3 1 3 1 3 3 3 2 3 2 1 3 2 3 1 3 2 2 1 3 1 2 3 2 1 3 3 2 3 1 2 2 2 2 1 2 2 2 1 2 2 2 3 1 1 1 1 3 2 3 1 2 2 2 1 2 1 2 1 1 3 1 2 2 1 2 1 2 3 3 3 2 3 1 3 2 3 3 3 3 2 3 1 2 1 1 3 2 3 2 3 1 1 1 1 2 3 1 1 3 3 1 2 3 1 3 2 1 3 1 3 1 2 3 1 1 3 2 3 1 2 2 3 2 2 3 ...
result:
ok construction is correct.
Test #34:
score: 0
Accepted
time: 2ms
memory: 4172kb
input:
150 1500 10 35 119 4 6 7 8 10 3 5 9 2 1 35 5 4 1 6 7 5 8 9 3 10 2 35 18 4 1 6 9 8 2 10 7 5 3 25 90 9 10 8 1 6 4 5 3 7 2 54 132 2 3 5 4 6 9 10 8 1 7 23 122 8 3 2 6 9 10 4 7 5 1 37 108 2 9 10 7 1 6 5 4 3 8 42 45 3 1 2 4 6 9 5 8 7 10 61 54 5 10 2 1 7 6 4 8 9 3 21 10 6 2 4 3 10 1 5 8 7 9 9 68 6 3 9 5 1 ...
output:
6 3 10 4 4 3 7 7 2 6 8 5 6 1 7 2 8 6 7 2 8 9 7 5 10 2 5 7 9 10 8 7 4 10 8 8 4 4 5 7 5 3 8 9 7 3 1 8 9 8 8 5 6 7 10 7 9 3 3 3 2 8 5 6 1 10 10 1 3 1 7 6 3 6 7 1 5 1 6 10 3 5 8 8 8 10 2 5 1 8 1 5 6 6 2 1 5 5 6 10 9 2 6 9 7 5 10 7 4 3 2 1 1 1 10 5 3 9 3 4 1 8 7 6 10 2 7 2 7 5 9 8 2 1 4 9 7 2 3 4 10 2 8 ...
result:
ok construction is correct.
Test #35:
score: 0
Accepted
time: 3ms
memory: 4596kb
input:
150 1499 10 30 147 12041 480 2534 5853 460 9985 9511 2130 8477 8240 125 143 12383 3967 6251 3622 10294 1397 10212 7716 2711 6137 112 138 2728 3406 8823 707 12079 11902 11817 3859 8350 156 19 142 912 13564 8650 1043 4205 9930 2799 5040 11807 2018 4 32 10346 12401 4848 13807 13988 9904 814 4787 13290 ...
output:
9511 6137 2728 8650 9904 13761 6105 4973 5365 10020 9183 7462 2066 3289 13061 5986 1039 508 3986 9380 10540 340 2628 11604 2675 2330 13790 8725 9150 11416 8775 11666 2789 1287 1379 8775 10677 939 4071 6531 10894 9514 9009 10526 14667 12720 427 8385 7348 10484 4642 2330 10924 4064 7315 11244 10493 11...
result:
ok construction is correct.
Test #36:
score: 0
Accepted
time: 3ms
memory: 4376kb
input:
150 1498 10 13 93 4 3 7 9 11 10 5 1 6 8 135 4 11 6 5 1 10 3 2 8 4 9 75 91 3 9 2 8 5 4 1 6 10 11 137 110 10 9 6 2 1 11 3 4 7 8 77 76 5 6 11 3 8 4 9 1 10 7 69 51 2 9 1 4 10 8 5 3 7 11 18 27 10 6 3 11 5 4 1 2 8 7 122 101 11 3 4 2 6 10 8 9 5 1 56 2 7 9 1 10 4 3 11 8 5 2 1 16 2 5 10 8 11 1 9 6 3 4 18 54 ...
output:
1 6 10 10 10 3 6 4 11 2 2 10 6 9 1 8 6 8 10 7 1 11 1 5 11 4 4 10 8 8 9 2 4 6 4 1 7 4 4 4 9 3 2 11 6 11 7 7 2 1 1 7 4 9 2 4 7 4 7 2 8 2 11 5 8 11 7 11 7 10 2 1 1 5 10 10 5 11 2 5 4 6 5 2 10 3 1 9 11 4 4 7 6 9 4 7 5 2 2 6 10 11 5 9 8 4 2 10 9 4 6 11 2 10 1 9 6 4 6 1 7 10 4 11 11 5 7 8 4 5 9 11 2 2 5 5...
result:
ok construction is correct.
Test #37:
score: 0
Accepted
time: 2ms
memory: 4176kb
input:
150 1499 10 17 130 7 2 13 11 4 1 3 6 15 10 55 73 2 7 11 13 8 10 6 4 1 9 72 105 4 3 1 2 14 11 12 9 6 10 100 16 6 8 1 4 12 3 10 14 13 11 91 69 7 13 12 5 14 1 11 10 15 2 113 109 7 14 15 10 4 2 11 12 8 5 73 74 1 5 14 6 10 3 2 13 8 9 4 13 10 14 12 2 6 11 15 8 1 5 87 96 1 15 4 10 3 6 12 8 2 11 25 7 1 4 14...
output:
7 6 12 6 7 7 13 6 12 12 11 13 5 13 9 13 9 11 5 12 9 4 11 7 11 15 8 4 4 3 12 3 7 12 12 4 6 3 5 10 9 5 15 3 14 5 5 7 10 3 13 5 15 7 13 4 10 15 5 4 12 12 6 13 6 9 7 4 11 6 5 6 3 13 7 5 8 7 6 5 7 15 3 4 6 5 7 7 8 8 5 10 15 6 10 6 7 13 15 3 11 5 4 12 15 13 13 6 4 12 11 9 4 13 6 8 11 6 5 11 10 4 13 4 3 7 ...
result:
ok construction is correct.
Test #38:
score: 0
Accepted
time: 42ms
memory: 4172kb
input:
150 1400 10 101 73 1 7 5 3 10 6 2 8 4 9 100 14 6 4 8 5 9 2 10 7 1 3 89 103 3 2 5 7 1 9 4 8 6 10 31 63 5 10 6 7 9 4 2 8 1 3 81 145 6 7 5 2 9 4 10 8 1 3 103 95 4 8 3 5 2 9 10 1 7 6 14 89 1 9 2 4 10 8 5 3 6 7 90 111 7 10 8 5 4 6 3 1 9 2 82 11 10 7 1 3 9 2 8 6 5 4 5 119 6 9 7 4 10 5 8 1 3 2 147 74 9 2 6...
output:
4 8 4 10 7 4 9 5 8 5 10 7 1 9 3 7 8 1 3 6 4 10 1 10 5 10 4 2 4 4 1 6 2 8 6 2 3 6 7 4 7 10 6 5 6 6 10 10 7 8 6 4 2 9 4 10 7 9 6 1 8 9 3 4 4 10 5 8 4 3 7 10 7 10 6 9 2 7 2 1 3 2 7 6 7 5 4 10 9 6 1 10 4 8 5 5 10 5 5 4 7 5 3 10 10 4 1 7 3 9 3 10 9 1 8 10 1 5 4 7 8 8 2 6 1 9 8 8 3 6 3 6 10 9 5 7 6 9 3 1 ...
result:
ok construction is correct.
Test #39:
score: 0
Accepted
time: 7ms
memory: 4544kb
input:
150 3000 20 130 71 11 13 17 10 15 2 4 18 3 5 1 7 14 8 9 12 6 20 19 16 93 110 17 11 20 2 1 19 7 9 14 16 4 5 12 10 15 18 8 13 3 6 3 80 1 12 8 3 19 17 6 5 2 15 14 16 11 20 7 18 10 9 4 13 118 56 14 1 16 13 11 20 3 17 18 5 9 10 19 8 7 12 2 4 6 15 87 14 4 19 8 1 7 13 15 18 11 2 14 16 9 20 3 12 6 5 17 10 1...
output:
17 16 18 20 4 3 8 8 8 11 20 6 7 9 5 18 13 7 4 15 12 18 9 6 9 1 2 15 3 7 3 3 1 15 20 16 5 8 4 14 19 7 2 14 15 18 1 5 8 1 14 1 5 19 4 17 4 15 20 9 7 1 10 5 10 2 8 16 16 12 11 3 11 7 19 19 16 18 3 12 17 17 20 11 6 4 17 15 16 11 1 1 17 12 14 13 4 4 20 9 2 2 19 15 14 11 6 3 5 7 19 2 20 12 5 1 19 15 6 6 7...
result:
ok construction is correct.
Test #40:
score: 0
Accepted
time: 8ms
memory: 6680kb
input:
150 2997 20 137 131 5762 9111 38967 15773 52237 2826 21697 38030 50735 19494 3273 2767 35083 37295 10180 21810 12236 12874 15065 37851 29 78 50409 52886 11932 43949 7925 40147 2771 49165 639 12786 39123 36098 18441 22546 59053 36310 28727 8858 36938 4917 31 45 14688 22548 41715 42035 1729 54934 3718...
output:
52237 59053 14688 52109 25279 23396 43247 28741 26788 3339 43391 50403 57168 37205 32194 38590 58710 58380 52766 29090 30462 7147 30055 28992 11856 48688 49936 44317 19387 44044 10803 48595 4844 57838 18037 1469 36801 59675 46330 35644 6432 46163 15431 57779 44810 58664 48674 50403 9691 45723 38428 ...
result:
ok construction is correct.
Test #41:
score: 0
Accepted
time: 7ms
memory: 4400kb
input:
150 2998 20 57 43 1 2 17 16 7 9 11 15 6 3 12 20 10 21 5 14 4 13 18 19 70 32 13 15 17 8 19 3 6 5 1 18 16 7 21 4 9 14 12 10 20 11 119 97 2 13 19 4 21 11 8 15 9 16 1 3 10 14 12 17 7 5 6 18 31 74 12 13 20 19 18 11 6 4 10 1 9 8 3 7 2 17 5 14 21 16 40 144 15 3 6 17 9 5 13 21 18 12 14 11 20 7 10 1 19 16 2 ...
output:
12 8 10 17 20 10 13 9 14 9 19 9 3 6 17 5 15 17 13 12 8 14 18 18 13 16 19 1 19 21 18 10 7 9 5 17 19 19 16 12 8 14 19 10 10 10 2 10 8 13 19 15 10 9 8 18 14 5 3 1 6 1 3 4 6 15 1 18 19 7 3 18 3 8 5 16 6 1 21 8 19 5 14 5 1 2 15 3 18 11 13 12 2 11 15 14 1 14 2 1 20 10 5 13 14 2 1 19 8 11 13 10 21 14 2 2 1...
result:
ok construction is correct.
Test #42:
score: 0
Accepted
time: 3ms
memory: 4368kb
input:
150 2997 20 63 21 8 6 4 1 19 14 10 16 18 24 2 21 5 3 15 17 7 9 23 12 40 101 12 24 13 18 10 21 22 19 16 15 14 1 23 8 4 2 25 5 7 20 32 150 18 24 16 13 3 22 23 9 20 8 12 14 15 1 25 5 2 6 11 21 122 137 25 7 11 8 5 24 10 22 18 15 9 20 4 16 13 12 17 3 19 6 72 105 12 13 4 21 10 17 24 20 25 9 18 8 14 5 16 1...
output:
4 15 14 4 16 22 16 17 5 17 17 7 3 14 25 21 22 11 2 18 22 21 25 7 14 14 22 5 2 15 2 25 8 11 4 24 16 4 21 7 19 18 12 14 3 7 11 16 18 21 5 18 8 2 6 18 17 16 21 11 14 17 2 15 6 14 13 8 21 21 16 2 14 14 14 4 13 25 9 19 2 9 24 8 18 4 9 7 4 22 13 15 22 4 22 11 4 7 2 3 19 12 14 16 22 22 15 21 3 15 9 11 8 25...
result:
ok construction is correct.
Test #43:
score: -28
Time Limit Exceeded
input:
150 2900 20 84 108 9 13 4 12 20 6 7 2 11 15 14 1 17 8 16 18 19 3 10 5 24 23 6 13 2 8 20 17 1 4 3 19 12 7 11 16 14 9 5 10 15 18 141 53 11 8 2 13 19 1 12 9 18 4 6 3 14 16 17 15 20 5 10 7 37 109 8 7 2 18 4 17 12 6 16 20 19 13 11 1 10 14 5 3 15 9 88 3 4 20 3 1 15 2 18 7 11 17 9 19 10 12 13 14 6 16 5 8 3...