QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#128459 | #2760. Simurgh | somethingnew# | 32 | 219ms | 9992kb | C++20 | 8.5kb | 2023-07-21 05:38:29 | 2024-07-04 00:50:16 |
Judging History
answer
// ↘ ⬇ ⬇ ⬇ ⬇ ⬇ ↙
// ➡ @roadfromroi ⬅
// ↗ ⬆ ⬆ ⬆ ⬆ ⬆ ↖
#include <iostream>
#include "vector"
#include "algorithm"
#include "numeric"
#include "climits"
#include "iomanip"
#include "bitset"
#include "cmath"
#include "map"
#include "deque"
#include "array"
#include "set"
#include "simurgh.h"
#define all(x) x.begin(), x.end()
using namespace std;
struct dsu {
vector<int> p;
dsu(int n) {
p.assign(n, {});
for (int i = 0; i < n; ++i) {
p[i] = i;
}
}
int getv(int v) {
if (p[v] == v)
return v;
return p[v] = getv(p[v]);
}
bool merge(int a, int b) {
a = getv(a);
b = getv(b);
if (a == b)
return 0;
p[a] = b;
return 1;
}
};
vector<array<int, 3>> bb;
vector<int> banned;
vector<int> inba(int n) {
dsu usd(n);
vector<int> vec;
for (int i = 0; i < bb.size(); ++i) {
if (!banned[i] and usd.merge(bb[i][0], bb[i][1])) {
vec.push_back(i);
}
}
return vec;
}
vector<int> getel(int n, vector<int> ind) {
dsu usd(n);
vector<int> vec;
for (auto i : ind) {
if (usd.merge(bb[i][0], bb[i][1])) {
vec.push_back(i);
}
}
return vec;
}
bool chk(int n, int v, vector<int> indexes) {
dsu usd(n);
int rb = 1;
for (auto i : indexes) {
if (v != i)
rb += usd.merge(bb[i][0], bb[i][1]);
if (rb == n)
return 1;
}
return 0;
}
int countpls1(vector<int> r, int a) {
r.push_back(a);
return count_common_roads(r);
}
int weightedask(vector<int> a) {
//cout << "DD" << endl;
int res = 0;
for (auto i : a) {
if (bb[i][2] != -1)
res -= bb[i][2];
}
int vl = res + count_common_roads(a);
//cout << "EE" << endl;
return vl;
}
int cmp(int n, int a, int b, vector<int> indexes) {
dsu usd(n);
int vv;
if (bb[a][0] == bb[b][0] or bb[a][0] == bb[b][1]) {
vv = bb[a][0];
} else {
vv = bb[a][1];
}
int rb = 1;
vector<int> tocmp;
//cout << rb << ' ' << a << ' ' << b << endl;
for (auto i : indexes) {
//cout << i << endl;
if (bb[i][0] != vv and bb[i][1] != vv and usd.merge(bb[i][0], bb[i][1])) {
rb += 1;
tocmp.push_back(i);
}
}
if (rb != n - 1)
return -10;
//cout << vv << endl;
//cout << a << endl;
int vl1 = countpls1(tocmp, a);
//cout << b << endl;
int vl2 = countpls1(tocmp, b);
// cout << a << ' ' << vl1 << ' ' << b << ' ' << vl2 << endl;
return vl2 - vl1;
}
struct dsutype {
vector<int> p;
vector<int> tp;
dsutype(int n, vector<int> tps) {
p.assign(n, {});
tp = tps;
for (int i = 0; i < n; ++i) {
p[i] = i;
}
}
int getv(int v) {
if (p[v] == v)
return v;
return p[v] = getv(p[v]);
}
bool merge(int n, int a, int b, vector<int> &indexes) {
int aorig = a, borig = b;
a = getv(a);
b = getv(b);
if (tp[a] == -1 or tp[b] == -1) {
int vl = max(tp[a], tp[b]);
int quer = cmp(n, aorig, borig, indexes);
if (quer == -10)
return 0;
if (quer == 0) {
p[b] = a;
tp[a] = vl;
}
if (quer == 1) {
tp[b] = 1;
tp[a] = 0;
}
if (quer == -1) {
tp[b] = 0;
tp[a] = 1;
}
return 1;
}
return 0;
}
};
int zprsmart(int n, vector<int> addp, vector<int> knw) {
//cout << "ZPSt\n";
dsu usd(n);
vector<int> tocmp;
for (auto i : addp) {
tocmp.push_back(i);
if (!usd.merge(bb[i][0], bb[i][1]))
while (1);
}
for (auto i : knw) {
if (usd.merge(bb[i][0], bb[i][1]))
tocmp.push_back(i);
}
int vl = weightedask(tocmp);
//cout << "ZPend\n";
return vl;
}
std::vector<int> find_roads(int n, vector<int> u, vector<int> v) {
bb.assign(u.size(), {});
for (int i = 0; i < u.size(); ++i) {
bb[i] = {u[i], v[i], -1};
}
banned.assign(u.size(), 0);
/*vector<int> maybe(u.size());
for (int i = 0; i < u.size(); ++i) {
maybe[i] = i;
}*/
vector<int> maybe = inba(n);
for (auto i : maybe)
banned[i] = 1;
for (int i = 0; i < 1; ++i) {
vector<int> maybe2 = inba(n);
for (auto i : maybe2) {
//cerr << i << endl;
maybe.push_back(i);
}
}
vector<int> tpp(u.size(), -1);
for (auto i : maybe) {
if (!chk(n, i, maybe)) {
bb[i][2] = 1;
tpp[i] = 1;
} else {
tpp[i] = -1;
}
}
dsutype usd(tpp.size(), tpp);
for (auto i : maybe) {
for (auto j : maybe) {
if (i == j)
break;
if (bb[i][0] == bb[j][0] or bb[i][0] == bb[j][1] or bb[i][1] == bb[j][0] or bb[i][1] == bb[j][1]) {
//cout << i << ' ' << j << endl;
usd.merge(n, i, j, maybe);
}
}
}
vector<int> knowres2, knowres;
for (auto i : maybe) {
if (usd.tp[usd.getv(i)] != -1) {
bb[i][2] = usd.tp[usd.getv(i)];
knowres2.push_back(i);
}
}
knowres = getel(n, knowres2);
if (knowres.size() < n - 1)
exit(1);
vector<vector<int>> g(n);
for (int i = 0; i < v.size(); ++i) {
g[v[i]].push_back(i);
g[u[i]].push_back(i);
}
for (int i = 0; i < n; ++i) {
vector<int> clred;
for (auto j : g[i]) {
if (bb[j][2] == -1)
clred.push_back(j);
}
int fr = -1;
while (fr != clred.size()) {
int l = fr, r = clred.size();
while (l + 1 < r) {
int m = l + r >> 1;
vector<int> tepa;
for (int j = fr+1; j <= m; ++j) {
tepa.push_back(clred[j]);
}
if (zprsmart(n, tepa, knowres)) {
r = m;
} else {
l = m;
}
}
fr = r;
if (fr != clred.size()) {
bb[clred[fr]][2] = 1;
}
}
for (auto j : clred) {
if (bb[j][2] == -1)
bb[j][2] = 0;
}
}
//cout << "DAAA" << endl;
vector<int> resba;
for (int i = 0; i < bb.size(); ++i) {
if (bb[i][2] == 1)
resba.push_back(i);
}
return resba;
}
/*
static int MAXQ = 30000;
static int n, m, q = 0;
static vector<int> u, v;
static vector<bool> goal;
static void wrong_answer() {
printf("NO\n");
exit(0);
}
static bool is_valid(const vector<int>& r) {
if(int(r.size()) != n - 1)
return false;
for(int i = 0; i < n - 1; i++)
if (r[i] < 0 || r[i] >= m)
return false;
return true;
}
static int _count_common_roads_internal(const vector<int>& r) {
dsu usd(n);
if(!is_valid(r)) {
cout << "invalid query\n";
for (auto i : r)
cout << i << ' ';
cout << endl;
wrong_answer();
}
int rb = 1;
for (auto i : r) {
rb += usd.merge(u[i], v[i]);
}
if (rb != n) {
cout << "invalid query\n";
for (auto i : r)
cout << i << ' ';
cout << endl;
wrong_answer();
}
int common = 0;
for(int i = 0; i < n - 1; i++) {
bool is_common = goal[r[i]];
if (is_common)
common++;
}
return common;
}
int count_common_roads(const vector<int>& r) {
q++;
if(q > MAXQ)
wrong_answer();
return _count_common_roads_internal(r);
}
int main() {
assert(2 == scanf("%d %d", &n, &m));
u.resize(m);
v.resize(m);
for(int i = 0; i < m; i++)
assert(2 == scanf("%d %d", &u[i], &v[i]));
goal.resize(m, false);
for(int i = 0; i < n - 1; i++) {
int id;
assert(1 == scanf("%d", &id));
goal[id] = true;
}
vector<int> res = find_roads(n, u, v);
if(_count_common_roads_internal(res) != n - 1)
wrong_answer();
printf("YES\n");
return 0;
}
*/
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 13
Accepted
Test #1:
score: 13
Accepted
time: 0ms
memory: 3872kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 7 21 30000 2 0 0 1 5 2 2 6 1 3 3 0 6 0 4 5 3 2 4 0 1 4 0 5 4 3 4 6 6 1 2 1 5 3 2 4 5 6 5 1 6 3 7 10 9 13 12 17
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 7 9 10 12 13 17
result:
ok correct
Test #2:
score: 0
Accepted
time: 0ms
memory: 3820kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 7 21 30000 4 6 1 6 2 3 0 3 2 1 2 6 5 6 6 3 0 2 1 0 4 2 1 3 5 2 5 0 0 6 5 3 4 5 5 1 3 4 1 4 4 0 4 16 10 0 20 18
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 0 4 10 16 18 20
result:
ok correct
Test #3:
score: 0
Accepted
time: 0ms
memory: 3688kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 7 21 30000 2 5 0 4 4 5 4 3 5 3 1 3 3 6 4 1 6 0 5 6 6 2 6 1 6 4 3 2 2 1 1 0 0 2 5 0 5 1 4 2 0 3 20 17 15 9 2 19
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 2 9 15 17 19 20
result:
ok correct
Test #4:
score: 0
Accepted
time: 0ms
memory: 3748kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 7 13 30000 2 4 4 3 3 2 0 3 0 4 6 3 6 1 4 5 6 2 1 3 5 6 6 0 6 4 3 9 12 7 0 4
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 0 3 4 7 9 12
result:
ok correct
Test #5:
score: 0
Accepted
time: 0ms
memory: 3788kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 6 10 30000 5 2 0 1 1 2 0 3 3 2 1 4 0 5 3 5 4 3 1 3 5 0 7 2 1
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 0 1 2 5 7
result:
ok correct
Test #6:
score: 0
Accepted
time: 0ms
memory: 3744kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 7 16 30000 3 4 2 5 2 1 0 5 1 5 0 2 2 6 6 1 4 6 0 1 2 3 6 3 3 1 1 4 4 5 3 5 0 9 5 15 3 11
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 0 3 5 9 11 15
result:
ok correct
Test #7:
score: 0
Accepted
time: 0ms
memory: 3792kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 2 1 30000 0 1 0
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 0
result:
ok correct
Test #8:
score: 0
Accepted
time: 0ms
memory: 3788kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 3 3 30000 0 1 2 0 1 2 2 0
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 0 2
result:
ok correct
Test #9:
score: 0
Accepted
time: 0ms
memory: 3788kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 6 5 30000 2 4 5 4 4 0 4 1 3 4 3 1 4 0 2
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 0 1 2 3 4
result:
ok correct
Test #10:
score: 0
Accepted
time: 0ms
memory: 3872kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 6 14 30000 4 2 1 3 4 5 4 1 0 4 0 1 2 3 2 1 0 3 5 3 0 5 0 2 5 2 1 5 13 8 10 7 3
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 3 7 8 10 13
result:
ok correct
Test #11:
score: 0
Accepted
time: 0ms
memory: 3820kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 7 6 30000 3 0 3 5 4 0 5 6 0 2 1 3 3 4 1 5 0 2
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 0 1 2 3 4 5
result:
ok correct
Test #12:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 6 15 30000 4 3 2 3 3 5 2 0 5 2 1 3 1 4 0 5 3 0 4 0 1 0 2 1 4 5 4 2 5 1 9 13 12 6 0
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 0 6 9 12 13
result:
ok correct
Test #13:
score: 0
Accepted
time: 0ms
memory: 3884kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 7 21 30000 0 2 2 5 3 4 0 3 5 4 4 2 2 1 4 6 5 3 0 1 4 0 1 6 3 6 1 3 1 5 5 0 0 6 4 1 6 5 3 2 2 6 16 3 18 17 4 6
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 3 4 6 16 17 18
result:
ok correct
Subtask #2:
score: 0
Runtime Error
Dependency #1:
100%
Accepted
Test #14:
score: 17
Accepted
time: 2ms
memory: 3888kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 50 1225 30000 47 4 24 48 42 13 5 42 19 17 29 31 23 48 37 25 37 43 27 22 43 30 19 44 49 37 39 14 26 46 46 35 49 15 40 19 6 31 37 1 21 0 26 45 6 4 38 36 6 8 20 4 18 24 20 35 5 29 1 19 35 49 29 20 25 10 10 36 2 22 26 11 7 9 24 3 35 38 48 41 22...
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 24 61 62 119 127 166 195 212 221 257 277 299 322 333 355 377 397 440 458 478 497 503 509 552 584 591 638 679 706 746 754 760 768 770 795 848 851 860 866 880 923 1006 1033 1042 1058 1071 1107 1199 1205
result:
ok correct
Test #15:
score: 0
Accepted
time: 2ms
memory: 3868kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 50 1225 30000 44 29 11 44 39 16 20 31 6 3 9 27 49 27 12 0 27 1 48 49 46 12 35 36 35 11 49 13 23 20 28 26 12 1 42 37 5 15 28 32 6 10 16 7 4 43 4 31 49 34 9 14 2 46 44 30 40 17 14 29 41 18 27 44 13 3 23 40 47 24 16 3 6 26 45 18 24 42 11 10 23...
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 21 48 67 88 89 95 97 151 178 181 182 196 204 228 230 256 275 279 280 294 297 315 354 420 456 472 496 497 501 552 562 577 600 607 633 649 678 701 723 769 776 849 913 933 1037 1051 1055 1173 1185
result:
ok correct
Test #16:
score: 0
Accepted
time: 2ms
memory: 3888kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 50 1225 30000 12 30 6 44 33 47 7 33 0 2 10 30 30 46 14 11 43 42 13 27 49 24 6 17 21 2 12 21 24 38 5 21 17 0 16 4 26 5 27 32 20 45 6 20 19 0 20 35 47 39 17 39 0 23 26 33 1 17 3 20 4 46 48 21 21 35 24 40 9 29 28 23 9 1 43 34 4 44 18 37 40 13 ...
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 24 25 56 67 93 95 150 160 166 198 204 213 222 261 273 290 326 374 382 438 466 470 482 513 524 535 610 784 790 795 834 841 847 859 874 882 885 894 907 917 948 966 997 1048 1064 1068 1075 1082 1141
result:
ok correct
Test #17:
score: 0
Accepted
time: 2ms
memory: 3880kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 50 1002 30000 35 6 20 23 17 3 16 48 49 29 31 32 38 3 10 39 16 4 47 13 0 19 24 25 42 39 48 44 39 32 1 42 18 8 17 15 19 32 33 23 21 18 7 13 6 0 26 35 34 22 39 13 48 47 6 21 44 7 21 13 43 16 41 43 36 6 25 14 3 49 3 33 47 29 25 45 45 13 12 13 3...
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 4 20 28 90 96 112 116 135 174 213 221 229 237 266 304 308 313 348 351 357 370 372 401 402 403 420 436 440 559 560 591 614 636 668 670 685 712 783 801 808 823 828 837 841 858 875 898 941 963
result:
ok correct
Test #18:
score: 0
Accepted
time: 1ms
memory: 3868kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 50 371 30000 20 0 5 9 13 38 4 3 12 23 20 42 43 12 27 28 1 42 23 42 14 41 39 9 2 9 10 13 14 32 18 30 6 7 32 3 39 38 12 34 33 0 10 41 32 30 15 43 13 6 2 30 20 14 36 21 17 2 0 28 24 29 19 7 25 15 10 48 21 49 31 7 2 44 7 44 28 40 38 17 33 48 18...
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 0 14 16 18 21 24 27 35 38 45 46 62 74 82 89 93 101 102 105 121 129 131 135 139 140 152 156 193 210 212 216 224 233 234 237 238 239 257 274 277 279 290 294 300 309 314 344 349 364
result:
ok correct
Test #19:
score: 0
Accepted
time: 2ms
memory: 3860kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 50 1027 30000 46 5 15 29 43 39 16 32 38 5 4 22 13 4 41 5 0 41 39 6 6 8 3 13 25 6 40 25 17 40 47 0 26 15 30 11 27 31 43 45 30 17 35 37 8 27 2 38 35 19 7 12 36 31 41 21 14 25 14 35 15 17 37 2 27 46 24 39 24 29 19 10 28 1 22 35 24 41 16 46 13 ...
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 5 13 31 77 83 85 112 140 142 148 158 170 173 196 198 220 230 238 313 398 406 417 487 488 497 506 521 571 583 585 607 639 645 660 670 674 816 839 885 928 974 983 986 988 994 1001 1005 1007 1021
result:
ok correct
Test #20:
score: 0
Accepted
time: 2ms
memory: 4136kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 50 965 30000 28 25 38 23 12 44 1 35 45 46 39 4 19 22 40 23 25 49 20 29 30 9 17 2 15 32 32 14 45 7 19 12 40 22 12 35 10 5 49 37 29 31 19 40 22 6 28 46 23 11 2 1 40 24 14 44 44 40 16 47 7 14 38 47 43 34 4 18 17 22 32 30 33 13 36 21 47 37 37 3...
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 6 16 45 48 50 74 79 93 109 114 125 127 138 146 157 161 182 213 251 257 259 273 332 335 346 352 353 371 505 508 541 544 546 551 570 673 679 698 766 796 799 820 837 841 846 901 907 911 952
result:
ok correct
Test #21:
score: 0
Accepted
time: 0ms
memory: 4136kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 50 900 30000 25 47 5 46 35 22 46 22 15 35 37 46 27 46 29 20 0 7 7 14 8 19 28 38 11 7 9 16 28 0 38 29 30 47 23 11 26 10 3 38 30 49 28 13 45 3 7 17 42 0 30 1 48 2 47 22 18 49 26 34 12 20 40 9 12 38 46 16 24 16 40 30 31 33 45 34 16 25 14 31 4 ...
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 27 32 40 46 65 78 196 211 252 256 288 291 298 300 323 351 360 404 423 428 430 433 487 498 502 524 530 533 551 557 561 566 575 590 605 645 653 699 703 704 727 745 751 763 805 816 870 877 897
result:
ok correct
Test #22:
score: 0
Accepted
time: 1ms
memory: 3860kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 50 701 30000 1 47 37 0 2 41 32 33 15 40 38 42 5 27 0 9 0 8 10 36 26 42 5 25 41 35 27 2 21 15 40 28 0 15 43 29 37 3 28 18 9 3 47 27 32 38 48 47 28 13 34 32 27 23 40 8 38 15 46 7 24 14 12 46 47 28 20 43 2 48 2 28 22 45 14 27 23 42 30 35 26 18...
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 21 22 23 24 25 26 28 29 30 31 32 33 36 37 39 42 46 51 55 56 57 60 61 62 70 76 84 86 477
result:
ok correct
Test #23:
score: 0
Accepted
time: 1ms
memory: 3928kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 50 626 30000 49 25 30 31 0 3 6 11 25 10 19 13 10 49 43 31 7 19 24 28 39 31 15 7 32 30 27 41 18 23 31 13 26 40 19 41 42 30 47 28 5 4 41 24 42 27 15 45 29 14 29 37 42 6 2 42 45 13 27 32 32 20 4 29 4 21 20 24 16 44 14 12 28 6 25 37 10 22 8 48 ...
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 0 1 2 3 4 5 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 23 24 25 26 27 30 31 32 34 35 37 38 39 41 43 44 46 47 49 51 52 54 56 61 66 77 91 97
result:
ok correct
Test #24:
score: 0
Accepted
time: 1ms
memory: 3856kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 50 601 30000 28 10 43 16 22 35 42 20 8 39 34 33 47 44 47 49 3 9 10 32 34 5 4 14 9 18 19 33 29 38 31 25 8 2 5 4 5 8 40 23 27 21 36 23 10 6 14 26 39 27 44 36 29 47 6 1 2 46 21 15 43 13 28 38 1 23 41 45 3 49 26 15 39 2 11 17 22 0 45 47 48 46 4...
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33 34 37 38 39 40 44 47 49 50 52 56 59 60 65 70 130
result:
ok correct
Test #25:
score: -17
Runtime Error
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 50 85 30000 33 16 22 4 21 25 32 42 13 46 7 38 18 16 38 33 44 27 19 2 3 2 30 24 0 47 49 12 20 47 17 32 23 26 45 28 35 8 31 20 40 34 25 36 25 43 5 40 11 46 24 1 49 35 30 9 17 41 33 29 11 13 28 19 9 32 6 48 11 39 15 23 16 29 31 0 6 38 27 4 3 0...
output:
Unauthorized output
result:
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 19
Accepted
Test #58:
score: 19
Accepted
time: 0ms
memory: 3792kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 2 1 12000 1 0 0
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 0
result:
ok correct
Test #59:
score: 0
Accepted
time: 0ms
memory: 4044kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 10 45 12000 4 8 0 5 2 0 5 8 8 0 3 8 6 4 4 1 2 3 2 1 6 2 1 7 3 7 8 1 7 0 8 6 0 6 9 5 9 6 7 4 7 6 7 9 1 6 3 5 2 5 7 5 3 9 0 3 3 6 2 9 1 5 0 4 7 8 5 4 9 4 5 6 3 1 2 8 7 2 2 4 1 0 9 8 4 3 1 9 9 0 22 41 3 16 7 25 28 11 39
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 3 7 11 16 22 25 28 39 41
result:
ok correct
Test #60:
score: 0
Accepted
time: 125ms
memory: 7576kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 400 79800 12000 32 64 96 254 115 203 7 171 112 81 124 143 336 175 217 328 152 133 124 331 19 91 92 232 152 43 215 169 4 341 363 18 83 99 52 46 248 66 242 187 150 319 335 158 172 150 3 49 126 256 60 153 165 230 265 68 119 380 171 22 35 169 3...
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 191 880 904 936 984 1196 1400 1519 1527 1591 1641 1778 1905 2324 2784 3295 3383 3553 4096 4103 4107 4125 4574 4728 4954 4988 5340 5415 5473 5562 5832 6075 7231 7562 7566 7638 7730 7949 8141 8374 8581 8972 8976 9309 9357 9540 9658 9774 98...
result:
ok correct
Test #61:
score: 0
Accepted
time: 214ms
memory: 9792kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 500 124750 12000 81 373 318 76 428 363 341 147 361 355 210 392 305 286 311 54 101 386 387 55 233 144 275 414 328 304 360 389 471 417 152 385 65 468 53 127 376 100 498 472 241 462 259 452 62 224 139 280 42 454 353 455 289 191 5 376 479 277 2...
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 287 480 713 989 1433 2010 2176 2225 2252 2731 3245 3490 3780 3943 4061 4332 4470 4755 4859 4870 4921 5249 5281 5690 6110 6196 6251 6332 6532 6688 7299 7377 7807 7838 7917 8132 8264 8465 8488 9032 9281 9456 9800 10365 10495 10555 10896 11...
result:
ok correct
Test #62:
score: 0
Accepted
time: 205ms
memory: 9748kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 500 124750 12000 46 114 300 154 29 338 393 146 238 239 371 22 27 445 366 429 28 425 441 111 67 216 468 477 398 199 487 185 192 234 357 110 211 177 219 292 45 496 237 416 122 116 109 293 402 45 395 409 432 178 42 252 100 372 422 92 25 18 208...
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 270 287 573 1240 2098 2114 2393 2775 3573 3607 4011 4364 4887 5110 5200 5349 5596 6254 6310 6358 6605 6944 6968 7502 7809 7990 8054 8197 8350 8407 8954 9283 9762 9798 9831 10397 10606 10684 10709 11064 12109 12230 12772 13144 13607 13817...
result:
ok correct
Test #63:
score: 0
Accepted
time: 197ms
memory: 9716kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 500 124750 12000 404 346 493 279 394 299 249 306 24 180 417 182 364 271 410 73 228 494 51 38 405 400 485 130 356 167 221 77 358 274 308 338 497 16 345 14 247 53 146 212 312 362 350 202 8 128 311 328 78 265 422 38 463 36 340 378 333 151 270 ...
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 10 82 1022 1440 1462 1562 1579 2092 2200 2574 2647 2780 2785 2850 3702 3808 4021 4110 4886 4901 4981 5005 5072 5095 5146 5726 6390 6639 6777 7029 7346 7613 7785 8107 8578 9413 9736 9793 10144 10168 10282 10344 10434 11135 11202 11376 117...
result:
ok correct
Test #64:
score: 0
Accepted
time: 198ms
memory: 9732kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 500 124750 12000 12 99 447 205 312 178 469 8 28 268 348 87 211 422 458 494 193 363 447 246 82 18 438 459 345 263 128 467 439 44 140 225 453 5 260 9 12 323 407 387 113 130 376 413 109 398 65 99 407 254 150 427 132 256 425 432 40 368 172 375 ...
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 209 612 664 949 1285 1307 1553 1670 1882 2254 2297 2451 2823 3397 3839 3912 3938 3958 4035 4142 5609 5614 5663 5665 6037 6168 6618 6787 7118 7259 7349 7396 7529 7536 7945 8104 8236 8376 8543 8956 8987 9025 9289 9675 9709 9883 9935 9975 1...
result:
ok correct
Test #65:
score: 0
Accepted
time: 200ms
memory: 9992kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 500 124750 12000 128 41 159 483 111 238 13 123 279 81 65 219 169 137 446 493 488 259 481 383 181 158 210 237 139 330 16 161 96 494 385 323 222 14 19 426 63 194 18 84 11 364 28 297 129 321 20 420 232 28 139 478 103 3 473 457 38 310 181 171 4...
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 217 304 776 1082 1454 1482 1543 1789 2061 2332 2553 2735 2872 3060 3141 3321 3712 3762 4015 4210 4274 4343 4443 4634 5161 5485 6004 6132 6181 6407 6502 6518 6845 6975 7096 7691 7815 7900 8498 9458 9740 9914 10323 10328 11117 11167 11346 ...
result:
ok correct
Test #66:
score: 0
Accepted
time: 207ms
memory: 9740kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 500 124750 12000 120 418 278 467 158 189 488 359 239 281 320 463 340 248 292 409 79 351 430 43 103 233 18 57 308 404 124 289 204 469 23 192 388 139 136 360 169 303 205 68 96 440 473 188 283 355 495 480 144 183 434 490 200 229 33 352 79 107 ...
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 52 388 832 916 1269 1426 2112 2304 2968 3182 3209 3509 3603 3632 3994 4474 4690 4917 4990 5366 5596 5646 5755 5973 6472 6520 6527 6837 7242 7464 7981 8031 8265 8484 8822 9562 9713 9933 10160 10788 10923 11260 11624 11696 11731 11925 1234...
result:
ok correct
Test #67:
score: 0
Accepted
time: 219ms
memory: 9928kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 500 124750 12000 65 32 62 261 436 43 345 82 407 452 322 309 132 296 272 140 63 267 165 194 0 183 401 446 71 87 303 253 265 230 82 250 193 60 234 381 67 164 476 92 10 487 207 25 421 359 421 374 84 292 430 318 151 440 76 420 129 23 127 24 106...
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 31 716 1632 1690 1844 1915 1920 2106 2582 2899 3246 3553 3759 4020 4238 4707 4914 4985 5522 5615 5729 6585 6644 6911 7092 7136 7715 7773 8383 8494 8567 8596 9153 9567 9902 10169 10895 11471 11590 11600 11800 11912 11945 12030 12142 12569...
result:
ok correct
Test #68:
score: 0
Accepted
time: 205ms
memory: 9796kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 500 124750 12000 156 245 217 282 199 269 211 86 49 16 165 487 134 118 396 47 382 176 76 191 6 362 50 281 433 72 73 217 253 304 335 55 35 449 496 6 43 7 494 452 74 143 259 133 84 1 147 153 143 47 415 414 212 319 437 82 238 312 195 346 279 53...
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 14 278 335 511 551 1303 1688 2145 2308 2479 2663 3223 3420 3432 3510 3549 4198 4416 4548 4672 4683 4796 5627 5877 6036 6061 6513 6745 7247 7252 7543 7581 8132 8261 8373 8919 9393 9519 9791 9901 10011 10078 10445 10642 10829 11007 11148 1...
result:
ok correct
Test #69:
score: 0
Accepted
time: 206ms
memory: 9800kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 500 124750 12000 319 475 103 47 229 199 134 18 469 488 319 373 30 301 61 313 297 366 358 129 129 450 92 290 386 301 173 91 388 118 438 334 359 144 358 464 211 73 39 68 455 307 129 152 489 239 409 170 163 414 264 455 142 495 87 459 116 225 3...
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 246 425 516 707 947 1567 1573 1731 1740 1931 1952 2308 2491 2593 2840 3295 3332 3578 4427 4442 4568 4792 5022 5084 5952 6100 6132 7007 7151 8075 8091 8359 9137 9320 9616 9653 9743 9982 10032 10980 11175 11349 11388 11394 11982 12116 1233...
result:
ok correct
Test #70:
score: 0
Accepted
time: 0ms
memory: 3812kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 3 3 12000 0 2 1 0 2 1 1 0
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 0 1
result:
ok correct
Test #71:
score: 0
Accepted
time: 202ms
memory: 9752kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 500 124750 12000 71 12 119 201 196 158 243 3 186 287 136 328 274 343 444 398 487 247 84 38 368 203 411 463 260 148 289 59 261 32 87 169 308 57 428 435 97 347 302 247 257 373 362 241 496 440 305 307 486 182 395 371 223 77 1 148 234 36 241 12...
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 100 181 299 345 847 1040 1113 1154 1268 1661 1812 1966 2042 2163 2175 2415 2680 2689 2690 2822 3051 3265 3412 3427 4148 4302 4753 5199 5417 5443 5633 5859 6014 6079 6976 7445 7760 8167 8448 8450 8609 9281 10276 10560 10676 10693 10939 11...
result:
ok correct
Test #72:
score: 0
Accepted
time: 205ms
memory: 9828kb
input:
wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd 500 124750 12000 196 332 346 305 336 251 18 480 12 478 494 343 499 274 419 262 336 360 410 33 469 495 374 109 224 313 397 120 162 96 207 286 450 451 119 283 65 159 142 17 216 420 486 75 90 455 107 110 297 261 232 370 408 124 54 59 126 88 24...
output:
lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs OK 91 227 915 970 1027 1034 1206 1523 1926 2469 2789 2895 3949 3956 4201 5257 5944 6011 6039 6154 6294 6557 6617 7123 7190 7440 7938 7948 8112 8253 9093 9098 9354 9924 10165 10769 10932 11718 12129 12697 12851 12991 13557 14230 14434 14539 ...
result:
ok correct
Subtask #5:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #2:
0%