QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#943296 | #8967. Županije | valeriu# | 100 ✓ | 810ms | 98984kb | C++20 | 6.2kb | 2025-03-19 19:30:12 | 2025-03-19 19:30:13 |
Judging History
answer
#include <bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
using namespace std;
//#ifndef DLOCAL
// #define cin fin
// #define cout fout
// ifstream cin(".in");
// ofstream cout(".out");
//#endif
using ll = long long;
using ld = long double;
//#define int ll
#define sz(x) ((int)(x).size())
using pii = pair<int,int>;
using tii = tuple<int,int,int>;
const int nmax = 2e5 + 5;
namespace DSU {
int dsu[nmax];
int cc;
void init(int n) {
cc = n;
for(int i = 1; i <= n; i++) dsu[i] = i;
}
int f(int x) { return dsu[x] == x? x : dsu[x] = f(dsu[x]); }
void unite(int x, int y) {
x = f(x);
y = f(y);
if(x == y) return;
dsu[x] = y;
cc--;
}
}
vector<int> g[nmax];
int col[nmax];
vector<tii> bycol[nmax];
vector<int> atrnodes[nmax];
int couldbe[nmax];
int pri[nmax];
multiset<int> asked[nmax];
int timesreq[nmax], atrfreq[nmax];
int d[nmax];
int initpri(int node, int f) {
if(col[node] != col[f]) return 0;
int once = 0, twice = 0;
for(auto x : g[node]) {
if(x == f) continue;
int a = initpri(x, node);
//cerr << node << " -> " << x << '\t' << a << '\n';
twice |= once & a;
once |= a;
}
int c = 0;
while(twice) twice >>= 1, once >>= 1, c++;
while(once & 1) once >>= 1, c++;
pri[node] = c;
return (once | 1) << c;
}
template<typename CB> void initd(CB&& cb, int node, int f) {
if(!cb(node)) return;
for(auto x : g[node]) {
if(x == f || !cb(x)) continue;
d[x] = d[node] + 1;
initd(cb, x, node);
}
}
template<typename CB> void modS(CB&& cb, int node, int f, int mx) {
if(col[node] != col[f]) return;
if(pri[node] >= mx) return;
cb(node);
for(auto x : g[node]) {
if(x == f) continue;
modS(cb, x, node, mx);
}
return;
}
multiset<int> dfs(int ccol, int root, int f) {
int tranz = 0;
for(auto [ncol, anchor, troot] : bycol[ccol]) {
if(ncol == f) continue;
auto S = dfs(ncol, troot, ccol);
if(sz(asked[anchor]) < sz(S)) swap(asked[anchor], S);
for(auto x : S) asked[anchor].emplace(x);
tranz++;
}
initpri(root, root);
//for(auto x : atrnodes[ccol])
//cerr << pri[x] << ' ';
//cerr << '\n';
//for(auto x : atrnodes[ccol]) {
//cerr << x << ": ";
//for(auto a : asked[x]) cerr << a << ' ';
//cerr << '\n';
//}
//cerr << '\n';
for(auto centr : atrnodes[ccol]) {
d[centr] = 0;
initd([&](int node) {
return col[node] == col[root] && pri[node] <= pri[centr];
}, centr, centr);
for(auto cd : asked[centr]) {
if(cd == 0) atrfreq[centr]++;
else timesreq[cd]++;
}
#warning fa prefixe sufixe daca merge macar asta
for(auto y : g[centr]) {
modS([&](int node) {
for(auto cd : asked[node]) {
if(cd == d[node]) atrfreq[centr]++;
if(cd > d[node]) timesreq[cd - d[node]]++;
}
}, y, centr, pri[centr]);
}
for(auto y : g[centr]) {
modS([&](int node) {
for(auto cd : asked[node]) {
if(cd > d[node])
timesreq[cd - d[node]]--;
}
}, y, centr, pri[centr]);
modS([&](int node) {
atrfreq[node] += timesreq[d[node]];
}, y, centr, pri[centr]);
modS([&](int node) {
for(auto cd : asked[node]) {
if(cd > d[node])
timesreq[cd - d[node]]++;
}
}, y, centr, pri[centr]);
}
for(auto y : g[centr]) {
modS([&](int node) {
for(auto cd : asked[node]) {
if(cd > d[node]) timesreq[cd - d[node]]--;
}
}, y, centr, pri[centr]);
}
for(auto cd : asked[centr]) {
if(cd == 0);
else timesreq[cd]--;
}
//cerr << centr;
//cerr << "\t\t\t";
//for(auto x : atrnodes[ccol]) cerr << atrfreq[x] << ' ';
//cerr << '\n';
}
d[root] = 0;
initd([&](int node) {
return col[node] == col[root];
}, root, root);
multiset<int> S;
for(auto x : atrnodes[ccol]) {
//cerr << x << ' ' << atrfreq[x] << ' '<< tranz << '\n';
if(atrfreq[x] == tranz && S.count(d[x]) == 0) S.emplace(d[x]), couldbe[x] = 1;
}
//cerr << col[root] << ": ";
//for(auto x : S) cerr << x << ' ';
//cerr << '\n';
return S;
}
int atrcounty[nmax];
void reconstr(int ccol, int root, int f, int target) {
d[root] = 0;
initd([&](int node) {
return col[node] == col[root];
}, root, root);
int desire = -1;
for(auto x : atrnodes[ccol]) {
if(d[x] == target && couldbe[x]) { desire = x; break; }
}
//cerr << desire << '\n';
atrcounty[ccol] = desire;
d[desire] = 0;
initd([&](int node) {
return col[node] == col[root];
}, desire, desire);
for(auto [ncol, anchor, troot] : bycol[ccol]) {
if(ncol == f) continue;
reconstr(ncol, troot, ccol, d[anchor]);
}
return;
}
signed main() {
cin.tie(0) -> sync_with_stdio(0);
int n, k;
cin >> n >> k;
for(int i = 1; i <= n; i++) {
cin >> col[i];
atrnodes[col[i]].emplace_back(i);
}
DSU::init(n);
for(int j = 0, x, y; j < n - 1; j++) {
cin >> x >> y;
if(col[x] == col[y]) DSU::unite(x, y);
else {
bycol[col[x]].emplace_back(col[y], x, y);
bycol[col[y]].emplace_back(col[x], y, x);
}
g[x].emplace_back(y);
g[y].emplace_back(x);
}
if(DSU::cc != k) { cout << "NE\n"; return 0; }
auto S = dfs(1, atrnodes[1].back(), 1);
if(sz(S) == 0) { cout << "NE\n"; return 0; }
cout << "DA\n";
reconstr(1, atrnodes[1].back(), 1, *S.begin());
for(int i = 1; i <= k; i++)
cout << atrcounty[i] << ' ';
cout << '\n';
}
/**
Binecuvanteaza Doamne Ukraina.
--
*/
詳細信息
Subtask #1:
score: 10
Accepted
Test #1:
score: 10
Accepted
time: 1ms
memory: 18140kb
input:
20 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 18 8 3 13 3 4 7 12 2 20 4 16 14 10 16 19 14 20 2 11 13 9 15 6 1 17 1 15 19 6 18 9 5 11 12 8 10 17
output:
DA 20
result:
ok Answer is correct
Test #2:
score: 10
Accepted
time: 2ms
memory: 18148kb
input:
20 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 6 20 15 2 6 4 14 9 8 13 9 3 8 11 4 16 6 17 7 18 13 15 9 10 12 4 16 11 19 15 3 11 1 18 5 6 1 20
output:
DA 20
result:
ok Answer is correct
Test #3:
score: 10
Accepted
time: 0ms
memory: 18144kb
input:
20 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 1 2 10 18 12 15 17 2 8 16 20 13 13 12 16 3 18 11 14 17 9 4 5 11 2 10 11 8 2 6 1 10 19 15 14 7 15 6 4 20
output:
NE
result:
ok Answer is 'NE'
Test #4:
score: 10
Accepted
time: 2ms
memory: 18144kb
input:
20 2 2 1 2 2 2 2 2 1 2 2 1 2 1 2 2 1 2 2 2 2 20 9 13 11 20 15 5 15 2 11 1 10 3 12 18 19 8 16 6 10 5 7 13 6 2 16 12 10 7 3 17 6 17 18 4 9 4 14
output:
DA 16 3
result:
ok Answer is correct
Test #5:
score: 10
Accepted
time: 1ms
memory: 18016kb
input:
20 2 1 1 1 1 1 2 1 1 1 1 1 1 2 1 1 1 1 1 1 1 12 13 4 11 2 16 1 19 12 20 20 2 16 9 5 18 14 17 6 13 20 7 7 11 17 3 18 15 15 8 16 10 20 1 16 3 5 9
output:
DA 20 6
result:
ok Answer is correct
Test #6:
score: 10
Accepted
time: 0ms
memory: 18148kb
input:
20 4 4 1 1 3 1 3 3 1 4 1 1 1 4 3 4 2 4 4 4 4 19 14 9 17 4 14 19 18 1 19 11 12 6 4 3 12 17 15 13 1 16 6 5 6 20 15 7 5 11 2 3 8 2 18 13 9 3 10
output:
NE
result:
ok Answer is 'NE'
Test #7:
score: 10
Accepted
time: 2ms
memory: 18148kb
input:
20 4 4 4 2 4 4 2 2 4 2 4 4 4 2 3 2 4 4 2 2 1 8 10 1 17 5 16 2 17 1 12 13 14 11 4 20 18 13 9 4 12 19 9 3 15 15 19 2 10 4 16 6 15 7 16 7 3 18 9
output:
NE
result:
ok Answer is 'NE'
Test #8:
score: 10
Accepted
time: 0ms
memory: 15968kb
input:
20 4 1 3 1 1 2 1 1 1 3 1 1 4 1 1 2 3 3 2 2 4 17 16 14 10 8 3 14 6 18 19 5 19 13 11 11 6 3 14 15 16 9 2 4 1 7 6 15 6 3 4 17 2 20 12 18 15 5 12
output:
DA 3 19 2 20
result:
ok Answer is correct
Test #9:
score: 10
Accepted
time: 2ms
memory: 18012kb
input:
20 4 1 1 1 1 2 4 3 4 1 1 3 1 1 1 1 1 1 2 1 1 1 7 18 5 12 15 1 14 9 20 17 15 14 8 15 16 1 10 4 2 19 3 3 15 11 18 6 8 20 1 18 1 13 1 19 7 9 4
output:
NE
result:
ok Answer is 'NE'
Test #10:
score: 10
Accepted
time: 0ms
memory: 18020kb
input:
20 4 2 2 3 2 4 1 4 3 1 3 2 1 2 3 3 2 2 4 1 1 5 7 13 17 20 18 11 17 4 14 5 18 8 15 12 9 14 2 16 2 12 6 13 1 15 3 1 9 19 6 18 3 10 3 20 6 1 14
output:
NE
result:
ok Answer is 'NE'
Test #11:
score: 10
Accepted
time: 0ms
memory: 16096kb
input:
20 20 14 3 6 10 7 8 2 19 17 5 12 1 15 20 11 4 16 9 13 18 18 12 3 8 5 1 19 7 9 14 5 20 4 6 16 18 6 13 4 17 10 16 7 4 8 11 2 4 9 1 6 15 9 17 10 14 8 20
output:
DA 12 7 2 16 10 3 5 6 18 4 15 11 19 1 13 17 9 20 8 14
result:
ok Answer is correct
Test #12:
score: 10
Accepted
time: 0ms
memory: 18012kb
input:
20 10 7 2 6 10 7 9 3 7 10 10 8 8 8 5 4 9 10 9 1 3 5 8 18 6 5 3 17 2 13 10 9 10 20 7 16 19 16 18 14 15 4 10 15 5 11 12 16 3 12 20 9 17 8 1 1 10 13 11
output:
DA 19 2 20 15 14 3 5 12 16 17
result:
ok Answer is correct
Test #13:
score: 10
Accepted
time: 1ms
memory: 18140kb
input:
20 10 7 9 3 7 7 3 10 6 9 2 4 8 5 10 1 5 7 3 10 7 16 12 14 19 13 16 18 15 17 1 18 6 18 3 1 4 8 10 1 20 11 15 3 4 11 10 7 14 20 5 9 2 7 12 9 8 18 13
output:
NE
result:
ok Answer is 'NE'
Test #14:
score: 10
Accepted
time: 0ms
memory: 17968kb
input:
20 9 7 2 6 1 7 9 3 7 1 1 8 8 8 5 4 9 1 9 1 3 5 8 18 6 5 3 17 2 13 10 9 10 20 7 16 19 16 18 14 15 4 10 15 5 11 12 16 3 12 20 9 17 8 1 1 10 13 11
output:
NE
result:
ok Answer is 'NE'
Test #15:
score: 10
Accepted
time: 1ms
memory: 18140kb
input:
20 19 14 3 6 10 7 8 2 19 17 5 12 1 15 1 11 4 16 9 13 18 18 12 3 8 5 1 19 7 9 14 5 20 4 6 16 18 6 13 4 17 10 16 7 4 8 11 2 4 9 1 6 15 9 17 10 14 8 20
output:
NE
result:
ok Answer is 'NE'
Subtask #2:
score: 25
Accepted
Test #16:
score: 25
Accepted
time: 3ms
memory: 20304kb
input:
2000 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...
output:
DA 2000
result:
ok Answer is correct
Test #17:
score: 25
Accepted
time: 3ms
memory: 18148kb
input:
2000 2 2 1 1 2 2 2 1 2 1 1 2 1 1 2 2 2 2 2 1 2 2 2 2 2 1 2 1 1 2 2 1 2 2 2 1 2 2 2 2 2 2 1 2 2 1 2 2 1 2 2 2 2 2 2 2 2 1 2 1 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 1 2 2 2 1 2 2 2 1 1 2 2 2 2 2 2 2 2 2 1 2 1 2 2 1 1 2 2 2 1 2 2 1 1 2 2 2 2 1 2 1 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 2 2 2 1 1 2 2 2 2 1 2 2 1 2 2 2...
output:
DA 1984 124
result:
ok Answer is correct
Test #18:
score: 25
Accepted
time: 3ms
memory: 20284kb
input:
2000 10 10 5 4 10 1 8 10 10 7 8 10 7 9 1 6 10 8 9 10 10 10 9 7 4 4 10 4 2 7 7 10 4 2 4 4 10 9 10 8 9 9 10 8 4 7 10 10 2 9 5 4 4 10 9 5 8 9 10 7 10 2 6 2 1 4 9 10 4 6 1 10 4 7 10 9 9 9 7 10 10 1 2 1 10 9 9 6 9 2 10 10 9 9 8 6 10 8 4 1 6 4 10 10 8 9 10 10 10 9 1 7 9 9 7 9 2 10 10 10 9 9 10 2 10 9 2 6 ...
output:
DA 2000 1269 493 3 55 404 59 6 248 38
result:
ok Answer is correct
Test #19:
score: 25
Accepted
time: 3ms
memory: 18144kb
input:
2000 102 52 10 10 61 19 68 80 47 80 66 91 17 66 7 61 70 37 11 80 20 97 61 80 36 85 16 90 33 18 1 6 50 78 13 19 90 65 92 11 85 97 86 92 63 19 34 17 49 82 18 37 47 17 50 76 49 76 22 44 91 17 10 95 38 38 79 13 47 85 26 61 93 13 62 20 61 12 80 92 44 65 27 17 43 2 44 41 38 50 65 99 81 62 27 82 48 97 70 8...
output:
NE
result:
ok Answer is 'NE'
Test #20:
score: 25
Accepted
time: 1ms
memory: 18148kb
input:
2000 102 31 95 53 4 69 34 96 4 2 50 86 74 52 89 10 9 71 45 51 50 97 102 65 25 41 50 47 89 86 1 34 102 35 52 47 39 27 91 8 91 83 50 44 61 51 98 40 53 26 48 23 102 1 29 89 84 92 4 40 29 97 37 88 50 89 48 57 38 39 98 101 52 28 61 71 14 8 6 100 102 30 77 80 91 4 100 39 98 51 45 94 100 6 87 28 41 48 27 3...
output:
DA 1786 773 1835 1228 744 1419 1865 39 1563 268 846 1356 200 1594 620 1111 111 1404 653 991 1979 1347 951 560 973 49 583 95 445 81 778 383 968 754 729 1763 1491 1561 87 2000 312 1125 1016 976 1119 480 35 306 1367 352 391 962 285 351 229 1222 155 1965 437 1980 1258 934 1032 215 664 1474 253 1195 217 ...
result:
ok Answer is correct
Test #21:
score: 25
Accepted
time: 3ms
memory: 18152kb
input:
2000 345 211 321 264 78 89 264 320 12 251 289 40 34 134 190 106 342 305 19 316 207 286 254 79 178 91 91 44 236 175 316 124 267 236 33 92 18 62 270 316 207 272 27 19 330 40 280 131 114 337 234 114 81 260 309 92 162 124 152 14 127 196 207 250 322 100 78 235 170 301 190 334 72 272 281 89 91 14 280 217 ...
output:
NE
result:
ok Answer is 'NE'
Test #22:
score: 25
Accepted
time: 3ms
memory: 18276kb
input:
2000 96 41 41 19 1 96 20 32 50 7 92 44 92 7 23 67 69 25 38 59 83 30 13 86 23 52 89 57 8 41 25 79 58 27 96 49 75 76 58 23 23 41 34 94 23 96 35 76 75 32 35 81 34 23 53 51 29 84 83 41 7 14 5 89 14 52 87 23 12 47 68 54 54 38 86 23 76 53 93 83 38 41 32 70 95 38 52 76 87 20 38 43 41 29 34 89 53 34 80 27 9...
output:
NE
result:
ok Answer is 'NE'
Test #23:
score: 25
Accepted
time: 3ms
memory: 18276kb
input:
2000 96 42 75 26 26 9 55 18 75 90 29 2 4 33 60 77 77 43 10 64 75 90 66 32 62 55 60 34 62 89 75 38 69 23 46 71 13 31 37 39 13 57 61 45 1 46 57 9 52 85 94 79 20 90 93 90 21 33 60 35 9 26 46 22 4 90 75 94 92 28 33 3 44 51 93 6 13 62 82 63 13 39 45 95 28 18 42 90 32 95 78 69 6 46 39 65 66 49 12 32 62 71...
output:
NE
result:
ok Answer is 'NE'
Test #24:
score: 25
Accepted
time: 0ms
memory: 18532kb
input:
2000 1998 239 1672 1040 155 458 1634 1841 1607 1905 898 1827 517 1236 1481 1562 397 1903 23 376 1398 115 959 980 267 1866 1532 1798 128 1343 62 759 1813 1478 828 1523 314 325 142 1158 1831 202 842 1288 1595 1530 218 122 467 81 989 1069 810 1133 1197 1631 1214 355 403 278 356 141 18 605 295 387 217 1...
output:
DA 1969 249 647 1847 190 1888 1452 950 900 1252 689 493 1117 1717 1380 1476 759 62 1137 1799 1878 1422 18 1316 1120 1429 1942 1502 1234 182 1192 1021 369 202 680 262 504 1798 1456 1516 945 674 538 1646 1655 1874 1362 888 777 1697 883 556 797 787 694 1604 1548 1626 1389 863 69 30 1125 1236 1471 405 5...
result:
ok Answer is correct
Test #25:
score: 25
Accepted
time: 3ms
memory: 20592kb
input:
2000 1998 78 882 592 568 39 684 1389 1512 244 1969 551 1963 1390 921 1896 1097 1076 411 841 94 702 1282 1834 474 637 1267 1515 1705 295 49 161 414 749 1219 777 195 110 1092 1599 145 995 549 602 919 269 1981 775 1797 46 1112 1057 654 675 1457 445 207 1588 725 123 163 431 22 422 1475 1110 590 177 836 ...
output:
NE
result:
ok Answer is 'NE'
Test #26:
score: 25
Accepted
time: 0ms
memory: 18280kb
input:
2000 10 5 9 6 9 4 3 9 9 8 10 1 8 6 4 1 4 1 4 2 6 9 4 8 6 2 8 6 9 9 6 6 2 6 1 6 1 4 8 1 1 8 1 6 9 3 1 1 9 9 2 9 1 8 1 4 4 4 2 1 8 6 9 8 2 8 9 4 2 7 2 1 3 4 4 4 8 6 6 2 1 8 2 1 1 2 6 1 9 8 1 9 8 8 1 4 6 7 2 8 8 2 9 4 6 8 1 8 4 2 7 4 4 1 9 3 1 8 2 4 2 2 8 3 1 6 1 8 1 1 6 8 10 2 1 4 9 6 9 4 10 3 10 5 10...
output:
NE
result:
ok Answer is 'NE'
Test #27:
score: 25
Accepted
time: 2ms
memory: 20280kb
input:
2000 10 3 8 8 4 5 3 4 4 1 9 4 4 9 4 10 4 9 4 10 9 7 9 7 8 5 4 8 10 3 8 3 9 4 3 4 8 9 8 9 1 4 8 9 4 4 9 4 3 8 4 4 7 9 8 6 5 8 9 4 5 6 9 9 5 9 9 2 8 4 4 9 4 3 9 1 6 9 8 3 7 8 8 8 9 9 2 8 4 9 9 8 3 4 9 3 9 4 4 9 6 9 4 4 7 9 3 8 4 4 2 4 8 9 2 4 9 6 8 4 4 5 2 9 3 5 4 8 5 4 5 4 5 8 3 3 3 5 4 4 5 6 4 5 9 9...
output:
DA 2000 378 157 44 140 169 21 57 674 179
result:
ok Answer is correct
Test #28:
score: 25
Accepted
time: 2ms
memory: 18280kb
input:
2000 148 21 16 111 12 116 115 18 59 16 133 97 78 132 144 9 78 83 116 107 114 79 18 72 72 49 121 53 110 111 109 132 135 111 9 41 39 111 92 64 112 135 66 15 34 59 79 70 4 34 25 135 110 104 17 5 59 21 50 137 78 37 58 88 92 56 125 96 96 70 2 46 120 16 37 25 89 133 111 20 68 73 23 122 15 74 97 104 39 87 ...
output:
NE
result:
ok Answer is 'NE'
Test #29:
score: 25
Accepted
time: 1ms
memory: 18520kb
input:
2000 1970 87 461 313 688 223 1274 721 1311 1065 846 1127 804 1588 1292 998 1817 1445 120 1078 14 891 847 1115 1224 303 1345 633 955 861 1162 534 361 1866 1037 196 508 1160 940 1563 1609 666 588 49 910 1284 3 71 1779 1568 309 137 1021 12 1746 549 1283 1380 499 1321 610 271 1735 1968 1010 1031 1467 37...
output:
NE
result:
ok Answer is 'NE'
Test #30:
score: 25
Accepted
time: 2ms
memory: 18380kb
input:
2000 1990 285 1790 1497 1945 1067 1466 12 679 1392 1236 1893 1814 1502 1317 1365 656 221 557 42 910 1359 734 1107 942 1113 375 979 828 1324 1834 1498 524 989 1027 890 1884 849 24 996 1506 516 717 976 740 1511 598 617 753 1761 1799 94 1681 1120 911 233 113 730 156 1604 206 1946 70 1712 767 1695 907 5...
output:
DA 472 168 2000 270 1389 513 763 1214 1764 1189 944 7 715 1216 583 983 1402 1973 1203 572 191 543 1242 38 601 393 1327 848 1618 778 638 1695 1192 1111 1533 1729 783 1875 1780 1984 1697 19 568 1929 632 190 1538 1042 737 1749 642 990 821 748 460 280 736 902 626 1619 1055 457 803 721 1547 1817 365 1470...
result:
ok Answer is correct
Test #31:
score: 25
Accepted
time: 4ms
memory: 20296kb
input:
2000 20 18 15 9 15 9 8 11 14 2 15 18 3 3 5 16 3 3 1 5 15 16 17 17 9 3 15 11 17 15 1 15 16 15 16 3 7 2 3 17 16 12 5 5 9 11 1 6 8 18 5 18 18 15 15 15 12 2 3 15 6 8 5 18 15 17 12 15 8 3 3 12 5 7 14 14 16 2 17 5 18 14 20 17 15 8 11 3 18 4 10 14 3 13 3 9 11 12 13 11 18 12 18 7 13 2 19 3 5 3 2 3 17 2 9 15...
output:
DA 1215 1589 510 209 1558 1410 1017 1131 1030 90 162 960 1332 1608 1070 1665 1526 1960 741 660
result:
ok Answer is correct
Test #32:
score: 25
Accepted
time: 1ms
memory: 18144kb
input:
2000 39 21 37 24 1 20 2 1 14 2 2 2 20 29 2 27 30 3 30 2 30 23 24 2 15 30 11 30 38 29 24 33 31 23 3 29 22 29 23 14 2 2 27 33 29 15 2 34 15 14 31 20 28 29 2 2 37 2 28 38 33 33 23 24 2 2 3 2 28 38 29 2 39 33 14 3 5 24 24 15 27 15 22 12 30 30 23 31 2 3 28 38 24 37 2 1 25 28 2 23 19 5 33 3 19 33 23 21 24...
output:
DA 757 721 34 425 101 236 1423 335 869 380 160 320 872 1831 79 794 1106 156 405 428 130 144 121 77 1365 475 282 141 70 550 176 114 1489 682 448 263 187 1594 1001
result:
ok Answer is correct
Test #33:
score: 25
Accepted
time: 1ms
memory: 20160kb
input:
2000 39 31 20 11 11 37 31 20 32 4 8 8 13 11 12 27 13 14 27 12 33 31 39 19 12 8 8 8 35 34 13 31 8 31 20 8 37 27 31 32 8 2 11 18 31 4 2 20 8 13 31 23 31 4 4 8 27 8 31 34 31 9 20 2 3 31 8 8 9 31 8 31 33 32 31 8 2 31 37 6 8 31 11 27 31 22 8 19 31 4 25 11 2 2 11 23 11 8 34 31 31 31 27 2 11 31 8 31 8 20 3...
output:
NE
result:
ok Answer is 'NE'
Test #34:
score: 25
Accepted
time: 3ms
memory: 18148kb
input:
2000 39 30 38 7 5 11 29 33 35 29 31 29 36 17 21 7 13 38 22 5 37 2 11 30 39 34 18 21 16 26 28 7 34 14 30 24 9 9 31 11 31 2 5 11 16 5 29 33 22 20 31 28 19 18 25 7 21 31 32 31 5 36 26 35 7 31 2 15 22 29 21 8 34 34 36 26 33 24 30 11 2 34 22 7 22 31 2 32 29 37 31 27 39 29 9 8 33 26 5 28 17 21 38 15 39 16...
output:
NE
result:
ok Answer is 'NE'
Test #35:
score: 25
Accepted
time: 2ms
memory: 20176kb
input:
2000 39 33 18 24 5 21 30 2 26 18 16 12 36 23 24 12 4 1 26 17 27 12 31 30 3 29 35 25 13 10 10 11 12 12 24 15 24 37 23 14 6 18 26 10 3 22 21 32 18 2 30 18 23 12 1 5 14 14 21 28 35 22 8 2 1 21 15 3 39 39 37 3 4 9 28 24 18 1 2 16 17 15 18 35 22 18 21 1 28 29 23 39 23 12 1 4 11 3 35 21 32 21 37 33 21 3 1...
output:
DA 839 1051 1138 730 186 704 1975 1853 931 702 607 688 477 1615 1068 1568 385 223 335 999 860 1444 13 1066 177 18 1854 754 431 1748 770 1043 571 733 1197 638 1404 1009 1056
result:
ok Answer is correct
Test #36:
score: 25
Accepted
time: 3ms
memory: 18276kb
input:
2000 16 9 7 7 14 9 13 1 9 14 2 5 15 14 2 5 2 14 6 9 16 1 1 1 5 16 5 1 9 2 5 3 3 12 10 6 8 3 15 6 6 3 6 9 10 13 8 6 2 13 6 14 16 5 9 7 12 5 9 6 5 6 5 6 6 2 14 9 6 15 16 1 14 6 5 5 14 14 10 13 5 5 6 6 9 8 9 9 5 3 14 6 2 7 6 9 6 5 1 5 9 16 9 8 2 5 5 1 6 3 13 6 5 8 9 1 9 16 9 6 5 5 13 15 8 14 8 5 5 7 6 ...
output:
DA 2000 808 1279 377 206 391 1814 1726 1242 251 913 523 191 1455 1267 416
result:
ok Answer is correct
Test #37:
score: 25
Accepted
time: 1ms
memory: 18144kb
input:
2000 12 3 3 9 6 4 9 7 9 3 4 5 4 6 4 1 1 1 4 9 8 4 9 9 4 10 10 6 3 3 4 9 8 11 1 4 12 6 11 1 3 3 9 4 9 8 3 3 3 4 7 8 9 6 4 11 4 9 9 11 6 3 8 7 9 7 7 4 7 7 4 3 3 3 7 10 9 6 4 7 3 12 1 4 6 4 4 4 9 12 9 3 8 4 10 3 4 9 7 3 9 9 4 4 2 3 3 9 3 11 4 8 1 2 8 11 12 8 4 3 3 11 4 3 3 6 3 4 4 3 4 7 6 4 6 1 6 11 4 ...
output:
NE
result:
ok Answer is 'NE'
Test #38:
score: 25
Accepted
time: 1ms
memory: 18272kb
input:
2000 12 8 12 6 1 12 12 10 3 6 6 4 2 12 10 4 11 12 7 12 12 11 7 12 2 8 12 4 7 12 4 7 10 10 12 2 2 7 11 7 12 4 12 4 7 7 9 7 2 11 12 8 8 2 12 6 11 12 7 9 12 2 1 7 6 8 1 1 11 12 12 6 4 4 12 1 1 6 7 10 12 1 4 8 4 7 1 8 2 2 3 7 8 8 7 7 3 6 11 7 2 3 2 8 1 4 2 2 6 6 2 10 12 7 4 4 7 12 3 2 4 7 2 6 8 2 4 7 12...
output:
NE
result:
ok Answer is 'NE'
Test #39:
score: 25
Accepted
time: 1ms
memory: 18172kb
input:
2000 9 3 8 8 4 5 3 4 4 1 9 4 4 9 4 1 4 9 4 1 9 7 9 7 8 5 4 8 1 3 8 3 9 4 3 4 8 9 8 9 1 4 8 9 4 4 9 4 3 8 4 4 7 9 8 6 5 8 9 4 5 6 9 9 5 9 9 2 8 4 4 9 4 3 9 1 6 9 8 3 7 8 8 8 9 9 2 8 4 9 9 8 3 4 9 3 9 4 4 9 6 9 4 4 7 9 3 8 4 4 2 4 8 9 2 4 9 6 8 4 4 5 2 9 3 5 4 8 5 4 5 4 5 8 3 3 3 5 4 4 5 6 4 5 9 9 8 3...
output:
NE
result:
ok Answer is 'NE'
Subtask #3:
score: 30
Accepted
Test #40:
score: 30
Accepted
time: 536ms
memory: 30328kb
input:
200000 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...
output:
DA 200000
result:
ok Answer is correct
Test #41:
score: 30
Accepted
time: 527ms
memory: 30384kb
input:
200000 2 1 1 1 1 2 2 1 1 1 2 2 2 1 1 1 2 2 2 1 2 2 1 1 1 1 2 2 2 1 2 1 1 2 1 1 1 2 1 2 1 1 2 1 1 2 2 1 1 1 1 2 1 1 1 1 1 2 2 2 1 2 1 1 2 2 1 2 2 2 2 1 1 2 2 1 1 1 1 2 1 2 1 1 1 1 2 1 2 1 1 1 1 2 2 1 2 1 1 1 2 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 2 2 1 2 1 1 1 1 2 1 1 2 1 1 1 2 1 1 1 2 1 1 2 1 2 2 1 1 1 2 1...
output:
DA 199999 1531
result:
ok Answer is correct
Test #42:
score: 30
Accepted
time: 57ms
memory: 30300kb
input:
200000 2 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 2 1 1 2 1 1 1 1 1 1 2 1 1 2 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 2 1 1 1 2 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 2 1 1 1 1 1 1 1 1 2 1 1 2 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1...
output:
NE
result:
ok Answer is 'NE'
Test #43:
score: 30
Accepted
time: 442ms
memory: 31328kb
input:
200000 10 6 9 1 8 8 8 2 7 4 3 1 3 2 2 10 8 7 8 1 9 8 2 2 8 1 1 2 8 5 4 10 7 8 7 10 2 8 1 8 5 2 2 8 8 2 8 2 5 1 1 1 8 8 2 8 5 2 5 7 2 8 2 1 8 10 8 4 1 8 2 6 1 8 10 7 8 10 6 1 5 8 7 2 2 4 1 1 4 8 2 8 2 1 2 1 8 2 1 4 1 10 2 9 10 2 8 2 6 7 8 9 6 2 5 7 10 2 1 2 2 5 9 10 5 4 4 1 2 8 7 2 9 6 10 10 1 1 8 8 ...
output:
DA 199982 621 6356 1101 10735 3154 3447 1346 145 1427
result:
ok Answer is correct
Test #44:
score: 30
Accepted
time: 286ms
memory: 32156kb
input:
200000 123 42 83 7 104 42 66 91 16 51 21 41 91 51 45 83 32 22 31 29 51 1 34 2 72 86 19 56 85 118 7 67 31 92 68 72 80 66 88 84 51 66 79 66 108 53 14 53 118 114 14 51 58 71 40 35 41 88 38 119 72 89 84 51 72 32 108 19 49 105 47 47 104 53 73 66 1 55 7 66 7 108 51 108 49 1 118 41 14 7 17 83 40 48 1 65 11...
output:
DA 136603 16390 6801 203 3754 13667 7780 53394 7535 34746 5435 8155 83815 55043 64008 75797 5650 12914 3990 799 3542 581 8288 69749 12600 85947 48100 56548 8008 10857 16792 14438 3232 2152 3684 8171 9113 64200 13008 8071 881 3106 28180 3515 2628 13058 41261 1550 15712 86699 4129 5084 345 150308 1250...
result:
ok Answer is correct
Test #45:
score: 30
Accepted
time: 171ms
memory: 31592kb
input:
200000 1234 695 287 103 995 1003 367 615 683 967 624 625 344 443 1127 1162 1120 681 887 59 482 58 633 637 918 1160 922 1186 380 528 284 570 1186 708 125 454 571 125 727 1079 171 590 1041 948 228 80 901 296 345 718 137 445 198 542 607 212 147 945 344 1144 670 951 1193 296 297 1016 105 598 696 696 488...
output:
NE
result:
ok Answer is 'NE'
Test #46:
score: 30
Accepted
time: 208ms
memory: 65256kb
input:
200000 200000 46572 70341 145948 183039 184431 187642 84197 160743 106996 9016 84078 117037 1181 108510 184412 123613 149954 87033 31995 94029 112006 37558 78482 34678 137503 153576 88961 40263 889 86671 146651 179572 179966 181922 187192 30949 11289 166465 100114 196693 172513 80226 145411 196321 1...
output:
DA 197418 171718 177541 118864 141019 20711 163379 168045 101419 165420 127913 31425 90637 194727 152267 69052 148430 112028 77167 140035 128593 39990 157554 109262 165245 143642 72128 81553 98644 142603 77065 169842 144366 104360 95390 122276 191465 33219 108310 163026 29705 169565 135397 63545 116...
result:
ok Answer is correct
Test #47:
score: 30
Accepted
time: 218ms
memory: 65624kb
input:
200000 199995 67538 80576 157404 102317 35795 67774 125251 91691 199808 93505 134556 138258 97384 66011 92888 61742 143605 74557 120955 58712 69630 165251 63073 143506 125134 151985 120087 1716 111112 53838 78024 142577 124644 95378 133157 20487 22311 70593 57322 145479 147044 192287 196015 143943 1...
output:
DA 21949 33253 122962 125083 139696 151017 121002 77931 6975 85947 152189 120221 65339 172454 118857 160282 181205 140452 167351 60586 82271 140422 181761 176075 61610 27706 87694 181886 172953 105840 102363 29573 41148 36235 100334 156481 43098 27204 3208 53174 107873 115453 128675 90983 28094 1574...
result:
ok Answer is correct
Test #48:
score: 30
Accepted
time: 184ms
memory: 64740kb
input:
200000 199995 143073 47783 143218 24504 150440 150200 132065 114056 197896 79988 195936 93023 29244 59492 10125 70063 147915 195113 186822 192929 28331 190318 136904 100134 136975 97228 39360 42966 198454 154677 47336 5590 114349 129845 112677 133447 149104 25590 76267 141174 192387 90892 100927 165...
output:
NE
result:
ok Answer is 'NE'
Test #49:
score: 30
Accepted
time: 327ms
memory: 31840kb
input:
200000 55 9 5 52 34 32 9 55 17 14 5 36 42 11 12 32 44 14 14 19 14 30 32 14 45 46 38 3 43 44 5 8 39 16 11 21 42 45 51 45 43 16 43 42 42 39 48 6 51 42 42 42 38 55 30 28 45 48 38 32 55 30 14 8 2 42 54 32 11 55 51 42 40 25 28 45 39 14 28 42 5 30 3 43 25 55 26 30 32 23 30 28 51 51 6 16 11 28 20 30 12 55 ...
output:
DA 199985 18123 60561 7875 302 4050 44386 2111 5493 2550 13257 2211 25916 3517 4977 11305 41014 72248 8633 6019 8065 50793 9937 29837 6286 49949 1026 3115 1675 87 10951 3367 43572 1449 26166 7495 3957 36523 9133 349 11560 12842 3087 9906 891 16460 33274 24542 12337 27918 1808 10077 18674 926 2790
result:
ok Answer is correct
Test #50:
score: 30
Accepted
time: 221ms
memory: 32020kb
input:
200000 444 116 289 316 88 173 134 348 213 320 198 70 337 234 398 263 408 316 127 334 305 320 183 176 116 320 279 291 429 259 70 289 307 208 62 288 416 28 289 348 72 384 308 399 43 82 307 342 213 148 413 242 371 429 347 403 30 403 80 310 225 421 255 312 37 149 280 291 131 187 354 337 103 153 429 219 ...
output:
DA 71375 32298 1319 7353 28478 2266 45354 72035 6780 11408 15139 45840 133777 12222 94690 180477 15870 61260 36152 7608 59501 6443 78442 14120 3790 14689 23202 9691 8279 33157 19978 61866 71254 75497 52666 2559 15893 50076 19970 262 8290 3982 23797 7986 18087 170672 28026 1837 34178 58501 25398 295 ...
result:
ok Answer is correct
Test #51:
score: 30
Accepted
time: 206ms
memory: 31288kb
input:
200000 444 356 69 436 435 409 174 110 52 164 74 203 41 247 301 117 200 394 26 433 317 207 246 38 158 230 385 397 330 96 322 382 392 96 341 52 83 208 47 440 129 194 230 284 38 361 385 31 300 285 116 319 410 432 212 284 88 197 395 328 180 353 84 413 434 285 117 84 407 192 272 419 278 114 230 223 179 8...
output:
NE
result:
ok Answer is 'NE'
Test #52:
score: 30
Accepted
time: 216ms
memory: 32484kb
input:
200000 521 244 66 165 66 205 298 186 309 362 68 92 280 208 405 260 472 471 449 232 165 346 232 45 303 280 252 294 376 209 470 416 303 40 449 122 427 440 49 428 447 5 152 294 414 364 11 504 449 294 398 107 179 123 300 166 467 434 416 351 128 290 436 175 437 246 54 186 187 192 8 496 300 192 65 160 58 ...
output:
DA 196715 6122 7396 23639 101080 16824 89408 27024 33111 93877 160928 28679 180927 49761 42707 28369 135575 81113 537 10215 10624 270 157508 64687 52407 9947 124789 84465 22657 25954 1958 1132 8613 39857 22933 29141 11829 65540 16017 16174 65838 75403 3294 12284 40445 63301 10962 159657 68053 3580 7...
result:
ok Answer is correct
Test #53:
score: 30
Accepted
time: 199ms
memory: 33128kb
input:
200000 521 388 509 355 291 114 349 34 278 196 512 131 197 348 41 133 91 80 276 99 22 520 193 60 412 91 90 91 25 478 244 130 164 376 319 386 218 331 343 127 401 515 273 233 78 274 348 415 274 252 422 54 77 340 28 424 440 259 176 114 264 80 449 28 174 290 43 176 276 289 310 485 25 122 274 192 156 218 ...
output:
NE
result:
ok Answer is 'NE'
Test #54:
score: 30
Accepted
time: 53ms
memory: 30820kb
input:
200000 521 42 81 392 50 521 488 487 261 110 486 323 73 419 323 230 469 494 391 88 399 498 20 341 50 270 112 162 337 391 52 85 316 233 438 10 219 425 496 73 191 483 520 372 371 226 369 504 42 301 154 266 429 506 35 435 219 45 291 164 128 82 126 495 110 219 281 60 330 417 502 302 43 442 69 49 27 143 3...
output:
NE
result:
ok Answer is 'NE'
Test #55:
score: 30
Accepted
time: 53ms
memory: 28040kb
input:
200000 521 270 275 268 65 377 437 281 184 521 407 24 109 55 49 324 305 219 234 128 257 333 29 205 197 425 283 393 217 257 498 347 81 13 122 123 383 302 447 346 503 59 157 207 383 120 298 329 89 329 350 216 273 263 314 56 340 494 335 308 47 259 422 205 191 50 30 215 181 40 90 118 341 483 298 340 468 ...
output:
NE
result:
ok Answer is 'NE'
Test #56:
score: 30
Accepted
time: 49ms
memory: 27600kb
input:
200000 10 6 1 10 10 1 4 8 10 4 10 3 6 1 3 5 1 1 4 1 1 10 2 1 4 7 4 1 10 7 4 4 10 6 10 1 4 6 4 4 4 7 6 1 10 7 1 1 1 4 4 4 10 7 6 1 1 3 4 1 6 4 1 4 10 1 10 6 8 10 9 4 4 6 9 4 10 4 7 4 6 1 10 4 3 1 4 9 10 4 4 1 4 7 7 1 4 1 5 4 1 4 8 3 4 6 10 4 7 6 7 3 1 6 4 4 1 6 1 7 4 4 4 10 4 1 4 1 3 6 3 2 8 10 10 7 ...
output:
NE
result:
ok Answer is 'NE'
Test #57:
score: 30
Accepted
time: 502ms
memory: 33764kb
input:
200000 22 18 1 12 12 8 20 22 15 8 8 21 19 16 19 21 20 6 15 12 8 4 19 7 17 17 6 19 21 10 2 21 19 10 17 3 8 21 15 15 13 8 15 1 9 12 3 12 19 5 14 8 8 8 20 22 22 12 22 6 9 8 21 22 15 18 10 22 21 7 16 12 8 15 14 20 16 3 6 16 19 19 10 14 2 13 9 8 8 22 21 17 19 3 2 12 8 7 18 21 19 6 12 13 8 21 22 6 2 17 4 ...
output:
DA 60622 44997 29300 61231 152553 35362 28216 71261 44349 177829 193319 3479 148205 139891 127666 139046 20070 25770 135054 80102 91411 133782
result:
ok Answer is correct
Test #58:
score: 30
Accepted
time: 271ms
memory: 32612kb
input:
200000 222 222 135 34 167 33 4 80 9 45 20 193 131 76 1 181 18 98 216 122 121 3 178 218 67 109 72 206 167 76 205 57 64 212 99 154 183 21 17 193 221 154 3 84 56 222 100 88 170 119 110 211 1 132 174 43 56 155 93 147 52 51 170 88 41 25 125 196 167 153 155 1 138 8 151 221 66 72 202 125 72 181 42 98 103 6...
output:
DA 120810 86412 40487 53448 26275 86988 46779 112555 25998 91934 60750 40508 39004 417 13251 8771 68454 190191 19868 65859 111593 5093 105559 97904 24193 78020 76024 73016 191823 181424 193872 111952 55933 26709 139747 73841 35166 10205 44451 47633 237 10908 112939 81299 76451 68982 31434 150892 120...
result:
ok Answer is correct
Test #59:
score: 30
Accepted
time: 578ms
memory: 35140kb
input:
200000 8 3 8 7 6 5 7 3 2 5 7 8 6 7 3 7 5 2 2 1 7 4 5 2 1 4 2 2 4 8 8 6 8 7 3 4 2 2 6 7 8 2 8 8 8 4 3 8 6 5 7 1 2 6 8 7 4 7 7 3 1 2 8 1 5 7 7 7 2 4 2 8 6 7 5 7 3 7 4 8 3 3 6 3 2 2 5 6 8 2 3 3 2 4 5 8 3 3 5 6 4 3 6 4 3 2 6 5 5 8 6 5 2 5 8 6 2 6 8 6 7 7 6 5 5 5 2 4 5 8 3 7 5 3 2 2 8 5 4 5 7 2 3 6 7 1 6...
output:
DA 199994 45582 73615 33697 87701 136967 55552 62113
result:
ok Answer is correct
Test #60:
score: 30
Accepted
time: 218ms
memory: 32976kb
input:
200000 456 445 325 134 394 127 8 330 349 202 305 179 100 325 224 231 65 307 435 23 416 38 233 446 118 138 424 70 163 371 328 289 31 8 273 274 285 324 10 232 101 255 343 247 126 2 127 273 14 119 123 251 144 331 341 456 48 229 50 423 328 410 5 227 397 445 103 193 123 390 324 124 105 325 167 298 396 18...
output:
NE
result:
ok Answer is 'NE'
Test #61:
score: 30
Accepted
time: 239ms
memory: 32740kb
input:
200000 456 1 318 88 176 269 185 21 226 119 52 217 113 356 72 369 257 265 71 259 417 228 323 224 360 18 115 282 6 225 379 221 89 275 233 427 221 162 175 51 422 120 329 160 86 408 88 329 448 265 161 225 228 41 273 26 347 236 383 71 54 169 326 268 397 293 442 309 74 64 174 80 425 106 317 402 153 236 89...
output:
DA 93131 125707 159461 116394 10658 98716 13750 23917 47174 17791 6612 40565 3721 42658 150038 68290 48357 9268 24650 104111 146311 119442 111688 121949 119118 84429 5069 15271 79275 52376 62149 60443 73451 58807 171175 46795 75323 158659 4616 35988 114092 116491 130490 39740 97083 155681 33713 4748...
result:
ok Answer is correct
Test #62:
score: 30
Accepted
time: 627ms
memory: 36368kb
input:
200000 7 4 4 4 3 7 3 4 2 4 1 4 2 6 7 2 2 2 2 7 7 3 4 7 3 2 4 4 7 2 1 7 3 1 4 3 2 4 7 4 2 3 1 5 2 4 4 2 2 7 1 3 4 4 7 4 1 4 4 2 2 7 7 2 7 2 2 1 3 4 2 4 1 7 2 7 4 6 4 4 4 4 7 2 1 2 7 1 7 2 4 2 4 4 2 2 2 6 7 1 4 2 7 4 4 4 3 2 2 7 2 1 2 3 2 7 7 4 7 1 4 7 7 2 2 1 1 5 1 3 4 1 2 4 7 7 1 1 4 4 5 7 5 3 4 7 2...
output:
DA 31008 11624 82204 137543 4310 92382 108206
result:
ok Answer is correct
Test #63:
score: 30
Accepted
time: 137ms
memory: 45484kb
input:
200000 33334 32924 2742 29138 9368 5994 22887 17528 6039 10206 7086 31759 15587 10949 19971 29677 18316 26241 10065 13620 7946 19681 29808 22235 11232 28529 17074 12369 14608 17306 15285 32908 28747 17066 359 30779 27451 9380 12038 25051 9384 3383 23496 8597 4200 9724 2943 22662 15064 24673 23322 14...
output:
DA 168909 58262 52099 92406 40854 179722 13107 29542 33782 139932 162321 95667 110456 10867 41766 85040 93554 31881 40878 140015 83412 141325 6565 61104 16480 103177 124163 26763 50790 72515 174446 108880 67847 187546 39452 89228 16255 27876 3975 101255 118414 121974 39122 190681 137392 25524 40495 ...
result:
ok Answer is correct
Test #64:
score: 30
Accepted
time: 170ms
memory: 38456kb
input:
200000 4762 1617 117 688 3569 19 3324 2583 2830 2723 1638 2599 1696 1873 4146 3241 426 966 287 2881 4667 1918 1262 3483 3638 3667 2881 216 1085 455 1413 3738 4720 1006 3424 3282 4390 2662 1049 3523 2323 3280 4757 4658 3674 1239 1809 1369 476 1945 3964 1185 653 283 2872 2838 1834 3106 569 3507 2383 2...
output:
DA 198525 65278 129156 31962 29679 51040 67535 134452 78384 142154 57575 12627 74124 10478 147558 6877 67003 11258 5 93460 90942 94802 79312 2133 70274 62853 22753 27135 58195 121814 34101 128866 153376 148489 26156 94842 8751 9068 36059 121454 2965 98771 39448 7802 98918 57288 82739 36691 23826 126...
result:
ok Answer is correct
Test #65:
score: 30
Accepted
time: 54ms
memory: 31688kb
input:
200000 4762 713 4036 3048 4432 1037 1653 3853 1751 4299 4285 879 2139 1581 3133 3277 3798 2645 4428 2639 3271 2402 647 4190 4441 3204 3076 1049 3661 3785 2281 1132 483 955 4548 3105 1186 510 3525 4067 3554 4680 730 3650 2686 4411 2375 3740 4645 2809 1259 2726 4271 4754 3658 1571 1207 3265 3975 1910 ...
output:
NE
result:
ok Answer is 'NE'
Subtask #4:
score: 35
Accepted
Test #66:
score: 35
Accepted
time: 810ms
memory: 33156kb
input:
200000 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...
output:
DA 200000
result:
ok Answer is correct
Test #67:
score: 35
Accepted
time: 725ms
memory: 33140kb
input:
200000 3 3 1 1 1 2 3 1 3 3 3 3 2 2 3 3 3 2 3 2 2 2 1 1 3 2 1 3 1 2 3 2 1 2 3 2 2 3 2 2 2 3 3 2 3 3 1 2 3 3 1 1 3 1 1 2 3 3 2 3 1 2 3 2 1 3 1 2 1 2 2 3 1 3 3 3 1 3 3 2 2 3 2 2 1 2 3 2 1 1 2 3 1 1 1 3 3 1 3 2 2 3 2 3 3 3 3 2 1 1 3 3 3 2 2 3 2 1 1 1 2 2 2 3 2 2 1 2 2 3 2 2 1 3 3 2 1 2 3 2 1 1 3 3 3 3 1...
output:
DA 200000 23775 11627
result:
ok Answer is correct
Test #68:
score: 35
Accepted
time: 53ms
memory: 27132kb
input:
200000 3 1 1 2 3 2 2 2 1 2 2 1 1 2 3 1 2 2 2 2 3 2 1 3 2 2 2 1 2 1 3 1 3 1 2 1 1 1 1 2 2 1 2 2 1 2 1 2 2 3 1 2 1 1 1 2 1 1 2 2 2 2 2 3 2 3 2 1 1 1 2 2 3 1 1 1 1 3 2 1 3 1 1 2 2 2 2 3 2 2 1 2 2 1 3 2 1 1 1 1 1 1 1 2 3 3 1 2 3 1 2 3 2 1 1 2 1 2 1 2 2 1 1 1 3 2 1 3 3 2 1 2 1 2 2 3 3 1 2 2 1 2 2 2 2 2 1...
output:
NE
result:
ok Answer is 'NE'
Test #69:
score: 35
Accepted
time: 50ms
memory: 29924kb
input:
200000 9 4 3 9 5 3 9 3 1 4 4 5 5 1 5 3 3 6 5 7 4 5 7 1 1 7 9 7 5 4 3 9 1 5 3 1 5 4 5 8 4 1 3 7 4 8 5 4 1 8 3 1 1 4 7 1 4 8 4 1 6 4 1 6 4 3 4 4 6 4 3 5 3 8 6 4 6 3 3 4 3 4 1 7 3 5 7 5 1 3 3 1 5 5 4 1 1 5 4 1 3 3 1 6 5 4 4 9 7 9 1 6 6 6 1 7 1 4 4 4 9 9 5 5 3 1 4 4 1 1 5 1 9 7 1 3 4 6 4 1 8 8 4 5 7 1 4...
output:
NE
result:
ok Answer is 'NE'
Test #70:
score: 35
Accepted
time: 696ms
memory: 35784kb
input:
200000 10 5 3 3 3 5 10 10 5 6 9 2 10 1 4 2 4 9 3 3 2 6 7 5 3 4 1 4 9 6 1 9 8 7 4 4 4 1 2 4 1 2 8 10 4 4 4 7 1 6 1 2 6 2 9 6 2 8 10 9 4 3 5 8 10 4 10 4 3 1 6 1 1 4 1 1 1 5 1 3 4 5 9 3 2 7 1 4 4 2 6 4 3 4 5 5 4 3 4 1 5 6 4 6 4 3 4 4 3 3 10 5 2 4 5 10 4 8 3 10 2 4 4 2 2 1 1 4 7 6 8 4 9 3 1 7 10 4 2 4 9...
output:
DA 70600 12499 26220 194893 159121 10103 68327 14561 53966 33031
result:
ok Answer is correct
Test #71:
score: 35
Accepted
time: 170ms
memory: 32996kb
input:
200000 3333 1651 2158 1869 3028 1171 400 961 1505 2196 1575 1813 3194 2011 2407 1178 198 1950 1597 271 1433 1656 72 3328 1720 1539 469 2533 2951 1460 1552 245 1543 1555 1196 2420 2843 2022 3026 2787 2044 85 849 1458 1981 509 455 1402 1707 2161 1838 150 1984 1598 151 536 3070 2509 3157 1842 673 239 7...
output:
NE
result:
ok Answer is 'NE'
Test #72:
score: 35
Accepted
time: 234ms
memory: 33384kb
input:
200000 1357 461 1208 706 835 137 1120 695 735 172 1068 565 385 31 146 908 1228 1015 209 604 1159 1315 898 960 1310 405 1317 898 907 501 732 1162 754 718 1014 1091 110 1218 225 560 1237 413 694 405 1119 731 734 1229 852 82 823 721 283 82 4 804 362 412 277 129 767 795 311 147 118 114 568 326 499 257 9...
output:
DA 195942 104188 129986 91788 37051 21239 48730 3270 57575 50750 98684 5847 870 9521 61729 62003 170380 78459 27000 87652 94902 6809 24044 2848 47006 2957 63537 64037 18004 115132 129240 26870 61801 99067 38548 3789 56786 8428 85927 152974 135830 92688 88411 61082 37701 76432 43669 32757 86972 80185...
result:
ok Answer is correct
Test #73:
score: 35
Accepted
time: 198ms
memory: 33020kb
input:
200000 1357 1248 1279 890 882 1224 360 1228 1357 1198 107 647 1050 1340 449 856 89 954 438 89 664 752 1274 451 563 164 421 76 1074 57 219 1056 795 390 1110 905 615 489 393 608 1247 594 471 909 727 132 605 223 1201 1348 67 567 874 1088 542 507 463 1159 1265 673 717 624 1165 298 529 587 796 1079 123 3...
output:
NE
result:
ok Answer is 'NE'
Test #74:
score: 35
Accepted
time: 194ms
memory: 33408kb
input:
200000 1357 353 431 1099 671 1024 881 621 1219 548 318 76 52 747 1336 737 129 227 960 463 980 431 190 282 795 1247 1014 1141 623 443 793 151 1303 1056 805 696 836 392 35 1020 870 732 302 425 129 484 1195 949 665 428 1201 400 470 678 78 1096 398 686 205 300 888 1116 422 177 1171 55 1159 690 1340 385 ...
output:
NE
result:
ok Answer is 'NE'
Test #75:
score: 35
Accepted
time: 216ms
memory: 33312kb
input:
200000 1357 1078 286 975 1168 341 590 1010 315 739 99 79 635 127 1253 474 113 451 1314 372 718 187 351 315 965 1292 457 420 1136 532 606 604 1303 1098 459 661 251 1212 535 1122 1083 362 405 543 33 69 1050 1197 138 143 443 707 533 497 936 15 208 1212 116 707 312 765 25 316 856 430 975 813 1070 227 11...
output:
DA 123155 45991 72354 153719 85856 20101 126300 134617 53099 121227 5212 81057 9532 119865 154688 67263 38863 135097 78234 92874 114403 44958 147170 165096 50685 85347 104644 73474 60982 40284 63101 8220 53243 52541 139428 37148 68356 11772 55965 167262 137738 109207 70884 92518 62359 101302 182146 ...
result:
ok Answer is correct
Test #76:
score: 35
Accepted
time: 217ms
memory: 32472kb
input:
200000 1000 184 383 483 18 810 907 558 296 408 472 991 635 598 732 914 679 233 459 504 601 876 212 604 804 260 120 252 40 239 971 218 396 971 102 983 841 260 226 282 733 151 191 187 512 102 267 321 305 704 815 164 47 120 529 914 971 4 212 233 273 898 27 206 739 476 693 633 224 256 428 119 675 925 41...
output:
NE
result:
ok Answer is 'NE'
Test #77:
score: 35
Accepted
time: 380ms
memory: 32404kb
input:
200000 123 122 59 71 69 116 122 47 109 106 5 41 44 112 117 93 68 12 13 28 21 45 54 41 67 19 6 63 73 46 38 117 105 28 122 39 74 45 68 85 91 49 68 69 93 45 18 69 90 68 117 45 8 114 23 34 110 22 20 117 112 12 73 32 69 51 39 35 21 48 18 32 27 3 117 85 60 28 18 41 99 51 101 15 39 76 71 15 68 62 115 69 65...
output:
NE
result:
ok Answer is 'NE'
Test #78:
score: 35
Accepted
time: 440ms
memory: 33640kb
input:
200000 123 118 58 15 10 104 39 4 29 85 105 117 61 87 93 53 27 109 39 63 112 74 60 87 28 67 87 36 93 118 117 117 56 26 81 106 21 54 71 26 66 53 102 4 104 114 1 53 13 96 37 79 49 31 87 99 50 19 39 49 40 49 16 77 67 39 5 87 112 29 1 24 111 2 61 80 7 77 7 92 39 111 70 116 34 67 115 7 105 29 122 39 114 6...
output:
DA 37716 52542 82521 85008 614 163842 98749 71613 127369 115848 28067 33959 79046 56078 166749 169935 59845 180373 130590 7174 115692 95730 81319 106427 82599 175923 2446 75342 61283 51687 45935 41979 16482 46306 20138 76323 99277 31267 64132 7861 96706 46814 100452 106773 165878 139268 82086 30290 ...
result:
ok Answer is correct
Test #79:
score: 35
Accepted
time: 188ms
memory: 98984kb
input:
200000 199997 48201 80557 30230 77711 123332 144801 173977 144513 165394 159901 177258 110404 13267 190011 114257 153066 30404 100019 176213 125928 168021 51221 148807 120369 27120 22679 112617 34281 129995 34550 97763 183600 9736 32667 30804 35807 37683 47302 78172 20547 175087 94273 159817 199011 ...
output:
NE
result:
ok Answer is 'NE'
Test #80:
score: 35
Accepted
time: 195ms
memory: 95924kb
input:
200000 199998 32445 90467 177495 195200 40267 63522 47635 14924 180147 113482 125481 76791 44482 111148 14658 107995 188814 97662 181112 81694 178637 109020 130487 31008 178834 194695 16528 27540 38406 62609 59144 194881 38335 112188 106358 118092 8242 117762 107224 40166 198958 15307 18533 111330 1...
output:
NE
result:
ok Answer is 'NE'
Test #81:
score: 35
Accepted
time: 365ms
memory: 33680kb
input:
200000 201 71 52 103 54 186 82 98 1 181 98 75 181 43 198 72 90 63 192 41 177 111 138 44 75 26 159 86 93 168 166 146 179 160 12 125 181 92 120 115 18 97 148 31 93 160 73 178 198 103 21 130 174 138 78 49 50 29 19 160 133 181 69 179 26 93 76 109 195 32 196 130 85 60 41 4 177 181 141 35 148 33 44 31 163...
output:
DA 9373 126880 178863 167191 139404 15454 40769 62580 2194 56563 143438 174644 86546 84129 53466 4700 129382 137743 34946 92499 179316 40090 152997 21736 34158 68740 150218 109937 117610 60102 142422 181588 21195 52908 179708 108585 118112 191017 132675 33819 89210 107467 18125 71087 59224 79743 132...
result:
ok Answer is correct
Test #82:
score: 35
Accepted
time: 365ms
memory: 33796kb
input:
200000 201 148 103 10 3 66 116 33 67 113 45 160 91 16 24 31 50 33 140 132 5 138 200 1 33 51 157 147 47 99 66 138 146 67 198 25 14 44 18 68 183 27 81 124 23 147 169 10 163 74 39 149 64 178 52 118 34 44 87 149 132 171 33 195 147 162 59 24 167 86 136 88 84 57 11 97 9 163 76 14 69 186 102 3 18 135 59 16...
output:
DA 135142 193639 149893 29011 75247 6829 17024 28856 22550 190398 87441 97636 187223 3191 83160 49491 132819 49754 130283 193112 173531 36117 132912 70802 185495 35375 39372 140823 49675 57279 146045 198399 96562 11551 159582 147772 37835 110565 149884 137511 136789 198938 125311 127064 101633 62912...
result:
ok Answer is correct
Test #83:
score: 35
Accepted
time: 81ms
memory: 32332kb
input:
200000 2001 474 568 184 184 1267 1271 398 184 184 1267 568 568 1271 474 148 398 568 148 1271 148 85 398 474 1267 398 85 1271 1271 474 85 184 1271 1271 1271 184 398 398 1319 568 1271 398 1271 1319 398 85 1271 184 85 398 1021 184 148 984 184 148 474 474 148 398 740 148 398 1267 740 1267 1319 1271 474 ...
output:
DA 20444 71344 25684 18250 153294 69125 139368 102851 10023 64304 146708 56855 74510 73317 25441 119753 172723 126494 148279 58799 120639 67509 47721 71512 105143 28211 44669 166394 18229 12222 58136 41378 37670 57610 196081 96475 174114 65380 116255 127118 99134 61911 124551 51503 144007 114941 130...
result:
ok Answer is correct
Test #84:
score: 35
Accepted
time: 92ms
memory: 35232kb
input:
200000 20001 8122 11077 7240 11077 1270 7240 3100 3072 7240 9310 11311 8122 1270 8122 3072 10478 16683 8122 3100 12009 9310 3100 9310 9310 19990 3072 7735 19990 1270 2235 1270 11311 3100 7240 2235 11077 11311 11077 19990 1270 8122 9310 8122 3072 7240 7240 11077 3072 2235 3100 11311 1270 2235 3072 14...
output:
DA 125953 191632 35197 57487 33567 52949 31878 139725 115369 60311 173200 75098 112911 5185 189302 36829 180213 152061 21438 94915 75964 119394 65003 94008 3215 171599 24279 153185 119773 120576 149615 115887 51267 15997 126970 162633 60493 176959 107723 23996 152042 90519 171192 50874 111463 199879...
result:
ok Answer is correct
Test #85:
score: 35
Accepted
time: 90ms
memory: 36524kb
input:
200000 20301 3696 426 17317 19884 722 13930 17895 18166 2379 11683 6266 6559 17122 722 6266 7992 6856 17122 9482 11717 2379 19931 15295 12216 17213 17070 4490 16565 7294 20090 6856 19931 6856 11450 11450 11955 16077 8266 15210 19082 5408 13930 13254 1206 17468 8104 7088 3988 3753 17468 5874 16232 91...
output:
DA 42210 93143 148231 91924 163655 28256 98613 146207 106013 64455 92848 94241 134025 135012 46044 182858 80405 99211 136064 187821 89607 26257 122567 100285 197951 109773 159327 29222 145047 102452 54647 51378 3247 95943 73055 162346 147008 101626 178614 104554 150658 198830 76684 167288 26705 9943...
result:
ok Answer is correct
Test #86:
score: 35
Accepted
time: 124ms
memory: 34700kb
input:
200000 20301 12230 10198 19111 4982 12629 16163 467 3504 10038 13059 16270 16552 5668 3022 4504 5117 1785 10037 3660 19665 11609 7978 4112 5303 14549 17320 7280 7855 12067 8537 15857 12861 5380 16315 6406 17358 11799 391 876 9291 1259 10100 8530 261 17839 15389 13365 17530 6745 10547 1526 19444 2751...
output:
NE
result:
ok Answer is 'NE'
Test #87:
score: 35
Accepted
time: 84ms
memory: 37336kb
input:
200000 20301 3635 17695 15204 17007 12774 10601 4868 6792 17924 3278 176 20128 8236 11672 11479 9656 13478 19411 7832 2175 13418 754 3759 18641 13007 5185 15594 7293 20200 4989 16850 16394 14676 16098 7435 14258 2687 19684 17793 20081 3137 17280 13642 14450 623 2753 6584 15690 17511 16336 13860 1028...
output:
NE
result:
ok Answer is 'NE'
Test #88:
score: 35
Accepted
time: 128ms
memory: 32808kb
input:
200000 23 2 21 10 7 6 10 22 10 7 13 17 23 10 23 13 7 20 23 23 16 5 2 14 21 19 21 19 16 10 20 23 5 14 21 2 5 9 17 9 22 22 8 16 17 9 14 15 2 2 20 21 14 5 18 19 16 20 3 22 9 11 5 13 10 21 21 11 17 21 7 21 8 10 9 9 22 2 19 21 17 10 5 17 16 13 3 2 13 19 5 17 13 20 10 17 9 22 14 1 23 22 10 9 2 2 23 21 5 1...
output:
DA 72704 1399 3187 19216 18121 166 144541 574 1302 1079 74838 1018 85 165636 1548 1892 571 2043 562 1904 53106 2496 1139
result:
ok Answer is correct
Test #89:
score: 35
Accepted
time: 184ms
memory: 45052kb
input:
200000 22189 17540 14541 4694 18094 18960 10379 15116 9859 7042 2294 6230 7615 6454 14798 20131 4389 17331 21527 21053 21511 589 5194 18968 13240 6011 11383 4445 14243 4939 18991 15296 17390 6517 583 15051 2605 298 11545 13427 14503 10461 17541 15836 1462 3971 9163 1621 13653 8743 17100 259 1376 996...
output:
DA 175133 181705 81759 45624 28971 135143 86561 18509 186358 185624 129708 96791 76387 122046 78042 77652 110778 98468 62070 82309 31135 194475 5793 77507 170939 175041 82724 1743 105523 127331 89016 82841 19247 30208 25911 55912 124132 181472 193364 110331 133495 120895 96273 60483 192627 37591 786...
result:
ok Answer is correct
Test #90:
score: 35
Accepted
time: 165ms
memory: 59364kb
input:
200000 66567 46782 44282 59985 24447 38662 41588 47425 20920 7773 12625 50000 53653 11263 8804 17458 47039 64348 24692 15519 45896 24204 50382 58853 57677 5277 13440 2356 34829 5523 29566 27811 724 25515 7125 7342 62256 25251 51092 61228 47389 37374 2022 29994 50599 36252 13770 13845 49429 17665 210...
output:
DA 108026 97866 87468 87445 105691 5457 154957 5103 111312 177191 180291 12975 175151 79234 177899 55677 98258 4218 135073 95723 32496 123388 33149 13116 142529 81729 110201 146258 46153 3152 198860 110394 115562 71173 72294 190991 153889 32879 45565 148212 98020 12610 5566 2762 83414 126644 185940 ...
result:
ok Answer is correct
Test #91:
score: 35
Accepted
time: 198ms
memory: 41516kb
input:
200000 10000 3549 9636 9719 5904 6148 7025 5891 8071 5034 2238 6228 9227 677 3588 4431 9619 3468 15 468 1419 8923 9425 9727 6891 1302 3009 7595 1746 6327 704 1434 5105 8846 2932 220 271 8658 2304 2632 1870 9605 9757 7038 4590 4886 4954 9752 9013 7351 8206 6910 8330 3112 4041 8117 1665 782 8506 6804 ...
output:
DA 193565 192546 180256 57078 99065 167031 195576 39028 106885 15574 4083 12993 148859 112397 155563 8940 142057 107495 10048 90508 41284 92623 9099 62266 55468 125220 94179 109886 108459 194380 123210 196592 165083 18182 8692 113580 105776 108076 3832 68989 197347 164012 10105 28591 100123 45426 18...
result:
ok Answer is correct
Extra Test:
score: 0
Extra Test Passed