QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#457585 | #8835. Goodman | ucup-team987# | AC ✓ | 144ms | 17164kb | C++20 | 11.6kb | 2024-06-29 13:22:02 | 2024-06-29 13:22:03 |
Judging History
answer
/**
* date : 2024-06-29 14:21:53
* author : Nyaan
*/
#define NDEBUG
using namespace std;
// intrinstic
#include <immintrin.h>
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cfenv>
#include <cfloat>
#include <chrono>
#include <cinttypes>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdarg>
#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <initializer_list>
#include <iomanip>
#include <ios>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <streambuf>
#include <string>
#include <tuple>
#include <type_traits>
#include <typeinfo>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
// utility
namespace Nyaan {
using ll = long long;
using i64 = long long;
using u64 = unsigned long long;
using i128 = __int128_t;
using u128 = __uint128_t;
template <typename T>
using V = vector<T>;
template <typename T>
using VV = vector<vector<T>>;
using vi = vector<int>;
using vl = vector<long long>;
using vd = V<double>;
using vs = V<string>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<long long>>;
template <typename T>
using minpq = priority_queue<T, vector<T>, greater<T>>;
template <typename T, typename U>
struct P : pair<T, U> {
template <typename... Args>
P(Args... args) : pair<T, U>(args...) {}
using pair<T, U>::first;
using pair<T, U>::second;
P &operator+=(const P &r) {
first += r.first;
second += r.second;
return *this;
}
P &operator-=(const P &r) {
first -= r.first;
second -= r.second;
return *this;
}
P &operator*=(const P &r) {
first *= r.first;
second *= r.second;
return *this;
}
template <typename S>
P &operator*=(const S &r) {
first *= r, second *= r;
return *this;
}
P operator+(const P &r) const { return P(*this) += r; }
P operator-(const P &r) const { return P(*this) -= r; }
P operator*(const P &r) const { return P(*this) *= r; }
template <typename S>
P operator*(const S &r) const {
return P(*this) *= r;
}
P operator-() const { return P{-first, -second}; }
};
using pl = P<ll, ll>;
using pi = P<int, int>;
using vp = V<pl>;
constexpr int inf = 1001001001;
constexpr long long infLL = 4004004004004004004LL;
template <typename T>
int sz(const T &t) {
return t.size();
}
template <typename T, typename U>
inline bool amin(T &x, U y) {
return (y < x) ? (x = y, true) : false;
}
template <typename T, typename U>
inline bool amax(T &x, U y) {
return (x < y) ? (x = y, true) : false;
}
template <typename T>
inline T Max(const vector<T> &v) {
return *max_element(begin(v), end(v));
}
template <typename T>
inline T Min(const vector<T> &v) {
return *min_element(begin(v), end(v));
}
template <typename T>
inline long long Sum(const vector<T> &v) {
return accumulate(begin(v), end(v), 0LL);
}
template <typename T>
int lb(const vector<T> &v, const T &a) {
return lower_bound(begin(v), end(v), a) - begin(v);
}
template <typename T>
int ub(const vector<T> &v, const T &a) {
return upper_bound(begin(v), end(v), a) - begin(v);
}
constexpr long long TEN(int n) {
long long ret = 1, x = 10;
for (; n; x *= x, n >>= 1) ret *= (n & 1 ? x : 1);
return ret;
}
template <typename T, typename U>
pair<T, U> mkp(const T &t, const U &u) {
return make_pair(t, u);
}
template <typename T>
vector<T> mkrui(const vector<T> &v, bool rev = false) {
vector<T> ret(v.size() + 1);
if (rev) {
for (int i = int(v.size()) - 1; i >= 0; i--) ret[i] = v[i] + ret[i + 1];
} else {
for (int i = 0; i < int(v.size()); i++) ret[i + 1] = ret[i] + v[i];
}
return ret;
};
template <typename T>
vector<T> mkuni(const vector<T> &v) {
vector<T> ret(v);
sort(ret.begin(), ret.end());
ret.erase(unique(ret.begin(), ret.end()), ret.end());
return ret;
}
template <typename F>
vector<int> mkord(int N, F f) {
vector<int> ord(N);
iota(begin(ord), end(ord), 0);
sort(begin(ord), end(ord), f);
return ord;
}
template <typename T>
vector<int> mkinv(vector<T> &v) {
int max_val = *max_element(begin(v), end(v));
vector<int> inv(max_val + 1, -1);
for (int i = 0; i < (int)v.size(); i++) inv[v[i]] = i;
return inv;
}
vector<int> mkiota(int n) {
vector<int> ret(n);
iota(begin(ret), end(ret), 0);
return ret;
}
template <typename T>
T mkrev(const T &v) {
T w{v};
reverse(begin(w), end(w));
return w;
}
template <typename T>
bool nxp(T &v) {
return next_permutation(begin(v), end(v));
}
// 返り値の型は入力の T に依存
// i 要素目 : [0, a[i])
template <typename T>
vector<vector<T>> product(const vector<T> &a) {
vector<vector<T>> ret;
vector<T> v;
auto dfs = [&](auto rc, int i) -> void {
if (i == (int)a.size()) {
ret.push_back(v);
return;
}
for (int j = 0; j < a[i]; j++) v.push_back(j), rc(rc, i + 1), v.pop_back();
};
dfs(dfs, 0);
return ret;
}
// F : function(void(T&)), mod を取る操作
// T : 整数型のときはオーバーフローに注意する
template <typename T>
T Power(T a, long long n, const T &I, const function<void(T &)> &f) {
T res = I;
for (; n; f(a = a * a), n >>= 1) {
if (n & 1) f(res = res * a);
}
return res;
}
// T : 整数型のときはオーバーフローに注意する
template <typename T>
T Power(T a, long long n, const T &I = T{1}) {
return Power(a, n, I, function<void(T &)>{[](T &) -> void {}});
}
template <typename T>
T Rev(const T &v) {
T res = v;
reverse(begin(res), end(res));
return res;
}
template <typename T>
vector<T> Transpose(const vector<T> &v) {
using U = typename T::value_type;
if(v.empty()) return {};
int H = v.size(), W = v[0].size();
vector res(W, T(H, U{}));
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
res[j][i] = v[i][j];
}
}
return res;
}
template <typename T>
vector<T> Rotate(const vector<T> &v, int clockwise = true) {
using U = typename T::value_type;
int H = v.size(), W = v[0].size();
vector res(W, T(H, U{}));
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
if (clockwise) {
res[W - 1 - j][i] = v[i][j];
} else {
res[j][H - 1 - i] = v[i][j];
}
}
}
return res;
}
} // namespace Nyaan
// bit operation
namespace Nyaan {
__attribute__((target("popcnt"))) inline int popcnt(const u64 &a) {
return __builtin_popcountll(a);
}
inline int lsb(const u64 &a) { return a ? __builtin_ctzll(a) : 64; }
inline int ctz(const u64 &a) { return a ? __builtin_ctzll(a) : 64; }
inline int msb(const u64 &a) { return a ? 63 - __builtin_clzll(a) : -1; }
template <typename T>
inline int gbit(const T &a, int i) {
return (a >> i) & 1;
}
template <typename T>
inline void sbit(T &a, int i, bool b) {
if (gbit(a, i) != b) a ^= T(1) << i;
}
constexpr long long PW(int n) { return 1LL << n; }
constexpr long long MSK(int n) { return (1LL << n) - 1; }
} // namespace Nyaan
// inout
namespace Nyaan {
template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
os << p.first << " " << p.second;
return os;
}
template <typename T, typename U>
istream &operator>>(istream &is, pair<T, U> &p) {
is >> p.first >> p.second;
return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
int s = (int)v.size();
for (int i = 0; i < s; i++) os << (i ? " " : "") << v[i];
return os;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
for (auto &x : v) is >> x;
return is;
}
istream &operator>>(istream &is, __int128_t &x) {
string S;
is >> S;
x = 0;
int flag = 0;
for (auto &c : S) {
if (c == '-') {
flag = true;
continue;
}
x *= 10;
x += c - '0';
}
if (flag) x = -x;
return is;
}
istream &operator>>(istream &is, __uint128_t &x) {
string S;
is >> S;
x = 0;
for (auto &c : S) {
x *= 10;
x += c - '0';
}
return is;
}
ostream &operator<<(ostream &os, __int128_t x) {
if (x == 0) return os << 0;
if (x < 0) os << '-', x = -x;
string S;
while (x) S.push_back('0' + x % 10), x /= 10;
reverse(begin(S), end(S));
return os << S;
}
ostream &operator<<(ostream &os, __uint128_t x) {
if (x == 0) return os << 0;
string S;
while (x) S.push_back('0' + x % 10), x /= 10;
reverse(begin(S), end(S));
return os << S;
}
void in() {}
template <typename T, class... U>
void in(T &t, U &...u) {
cin >> t;
in(u...);
}
void out() { cout << "\n"; }
template <typename T, class... U, char sep = ' '>
void out(const T &t, const U &...u) {
cout << t;
if (sizeof...(u)) cout << sep;
out(u...);
}
struct IoSetupNya {
IoSetupNya() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
cout << fixed << setprecision(15);
cerr << fixed << setprecision(7);
}
} iosetupnya;
} // namespace Nyaan
// debug
#ifdef NyaanDebug
#define trc(...) (void(0))
#else
#define trc(...) (void(0))
#endif
#ifdef NyaanLocal
#define trc2(...) (void(0))
#else
#define trc2(...) (void(0))
#endif
// macro
#define each(x, v) for (auto&& x : v)
#define each2(x, y, v) for (auto&& [x, y] : v)
#define all(v) (v).begin(), (v).end()
#define rep(i, N) for (long long i = 0; i < (long long)(N); i++)
#define repr(i, N) for (long long i = (long long)(N)-1; i >= 0; i--)
#define rep1(i, N) for (long long i = 1; i <= (long long)(N); i++)
#define repr1(i, N) for (long long i = (N); (long long)(i) > 0; i--)
#define reg(i, a, b) for (long long i = (a); i < (b); i++)
#define regr(i, a, b) for (long long i = (b)-1; i >= (a); i--)
#define fi first
#define se second
#define ini(...) \
int __VA_ARGS__; \
in(__VA_ARGS__)
#define inl(...) \
long long __VA_ARGS__; \
in(__VA_ARGS__)
#define ins(...) \
string __VA_ARGS__; \
in(__VA_ARGS__)
#define in2(s, t) \
for (int i = 0; i < (int)s.size(); i++) { \
in(s[i], t[i]); \
}
#define in3(s, t, u) \
for (int i = 0; i < (int)s.size(); i++) { \
in(s[i], t[i], u[i]); \
}
#define in4(s, t, u, v) \
for (int i = 0; i < (int)s.size(); i++) { \
in(s[i], t[i], u[i], v[i]); \
}
#define die(...) \
do { \
Nyaan::out(__VA_ARGS__); \
return; \
} while (0)
namespace Nyaan {
void solve();
}
int main() { Nyaan::solve(); }
//
struct UnionFind {
vector<int> data;
UnionFind(int N) : data(N, -1) {}
int find(int k) { return data[k] < 0 ? k : data[k] = find(data[k]); }
int unite(int x, int y) {
if ((x = find(x)) == (y = find(y))) return false;
if (data[x] > data[y]) swap(x, y);
data[x] += data[y];
data[y] = x;
return true;
}
// f ... merge function
template<typename F>
int unite(int x, int y,const F &f) {
if ((x = find(x)) == (y = find(y))) return false;
if (data[x] > data[y]) swap(x, y);
data[x] += data[y];
data[y] = x;
f(x, y);
return true;
}
int size(int k) { return -data[find(k)]; }
int same(int x, int y) { return find(x) == find(y); }
};
/**
* @brief Union Find(Disjoint Set Union)
* @docs docs/data-structure/union-find.md
*/
using namespace Nyaan;
void q() {
ini(N);
vi a(N);
in(a);
each(x, a)-- x;
UnionFind uf(N);
rep(i, N) uf.unite(i, a[i]);
vi ans;
rep(i, N) if (uf.find(i) == i) {
int j = i;
do {
ans.push_back(j + 1);
j = a[j];
} while (j != i);
}
out(ans);
}
void Nyaan::solve() {
int t = 1;
in(t);
while (t--) q();
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3804kb
input:
2 4 1 2 3 4 6 6 5 4 3 2 1
output:
1 2 3 4 1 6 2 5 3 4
result:
ok Correct (2 test cases)
Test #2:
score: 0
Accepted
time: 1ms
memory: 3648kb
input:
873 6 1 5 2 4 6 3 6 5 1 6 4 3 2 4 1 4 3 2 6 2 1 6 5 4 3 6 4 5 1 3 6 2 6 6 2 1 5 4 3 5 1 5 4 3 2 6 1 2 6 3 5 4 4 2 1 3 4 6 1 6 4 2 3 5 6 6 1 3 5 2 4 6 2 1 4 5 3 6 6 3 4 1 5 2 6 6 4 1 5 2 6 3 6 5 2 1 4 6 3 6 4 1 6 2 3 5 6 5 1 3 4 6 2 6 6 2 5 4 1 3 6 6 2 5 1 4 3 6 5 2 3 6 4 1 6 6 1 2 5 4 3 6 2 3 4 6 1 ...
output:
1 2 5 6 3 4 1 5 3 6 2 4 1 2 4 3 1 2 3 6 4 5 1 4 3 2 5 6 1 6 3 2 4 5 1 2 5 3 4 1 2 3 6 4 5 1 2 3 4 1 3 4 2 6 5 1 6 4 5 2 3 1 2 3 4 5 6 1 3 2 4 5 6 1 4 2 3 5 6 1 5 6 3 2 4 1 4 2 3 6 5 1 5 6 2 3 4 2 3 5 1 6 4 1 6 3 5 4 2 1 5 4 6 2 3 1 6 3 2 4 5 1 2 3 4 6 5 1 5 2 6 3 4 1 4 2 3 6 5 2 3 5 1 4 6 1 3 2 4 6 ...
result:
ok Correct (873 test cases)
Test #3:
score: 0
Accepted
time: 39ms
memory: 3648kb
input:
46233 7 2 1 7 5 3 4 6 7 5 6 2 4 3 7 1 4 3 4 1 2 7 4 5 1 6 3 2 7 8 4 2 6 5 1 3 8 7 8 3 4 8 6 7 5 2 1 7 6 2 4 3 7 1 5 8 8 1 3 2 7 4 6 5 8 6 5 4 2 1 3 7 8 8 8 3 5 6 2 7 1 4 8 7 3 6 1 8 5 2 4 8 2 3 4 5 8 6 1 7 8 5 8 2 4 7 3 1 6 8 3 4 8 2 7 5 6 1 8 2 8 3 5 7 4 6 1 8 8 4 5 7 6 1 2 3 8 5 2 6 3 4 7 8 1 8 2 ...
output:
1 2 4 5 3 7 6 2 6 7 1 5 3 4 1 3 2 4 1 4 6 2 5 3 7 1 4 5 2 3 6 7 8 1 3 8 2 4 6 5 7 1 6 2 3 4 5 7 1 8 5 7 6 4 2 3 3 4 2 5 1 6 7 8 2 3 5 4 6 7 1 8 2 3 6 5 8 4 1 7 1 2 3 4 5 8 7 6 1 5 7 2 8 6 3 4 1 3 8 2 4 5 7 6 1 2 8 3 4 5 7 6 2 4 7 3 5 6 1 8 2 3 6 7 8 1 5 4 1 2 4 7 3 5 6 8 1 5 6 3 2 8 4 7 1 2 4 3 5 6 ...
result:
ok Correct (46233 test cases)
Test #4:
score: 0
Accepted
time: 139ms
memory: 15328kb
input:
1 999995 992870 548521 579550 387108 249895 990007 476463 686591 907510 311379 340877 491996 478527 996443 681309 483046 760005 905577 711115 275827 697004 737465 904964 381424 774578 217570 554656 914370 935328 624905 590395 761191 265062 978389 670994 184745 662928 389422 952905 447853 325275 9796...
output:
127921 199174 341436 424785 357250 845619 904033 122029 409868 405250 643875 482427 500565 499398 713445 963839 594503 224662 359826 197223 677989 766164 295464 240814 814910 526012 74752 873541 819538 365129 968402 530508 469162 371303 52130 244052 91657 932046 608294 117227 156568 76614 189237 183...
result:
ok Correct (1 test case)
Test #5:
score: 0
Accepted
time: 115ms
memory: 15836kb
input:
1 999999 132956 959208 556000 604257 627699 841942 392337 85216 596714 941258 128586 319266 589450 975529 945897 459533 878473 562877 170464 568730 134581 853340 114919 588755 677661 246220 410344 431559 600933 71503 340747 300767 956226 134024 377489 407095 922690 597383 328440 183077 305496 911409...
output:
94071 302984 299991 718076 809579 556091 629579 142450 937176 734228 388547 242893 78145 253030 157132 13430 330933 52160 126749 56571 108442 546154 585166 440670 941772 494003 355276 988206 318501 102561 231536 661226 894148 254672 878836 413621 938372 401245 904383 711548 724210 885249 713376 3086...
result:
ok Correct (1 test case)
Test #6:
score: 0
Accepted
time: 131ms
memory: 16012kb
input:
1 999995 185456 546022 237157 854346 194860 12795 423507 139747 41617 745842 562041 586948 901868 41548 724084 551713 363602 993352 196139 134920 732744 223803 52636 647112 662549 111584 37972 544386 618225 516655 675627 995447 377631 547578 200968 309294 943960 544713 472717 970952 614182 556187 87...
output:
543 183262 523259 227381 150325 738854 459628 960382 277178 847571 710675 198667 227357 680595 168182 853374 802838 625946 914409 870457 300928 634081 764023 274905 86856 482145 389090 130755 450704 84551 661431 529385 452632 565910 700399 374227 649904 305424 114696 838735 510021 943693 620386 5060...
result:
ok Correct (1 test case)
Test #7:
score: 0
Accepted
time: 127ms
memory: 15396kb
input:
1 999995 106319 883863 505649 461531 879328 592439 610753 498388 652259 561960 714720 4816 619701 583083 891705 422579 600013 649185 247069 757914 629341 259990 491011 371586 561323 496611 245037 738066 356885 551034 869487 727770 296409 616290 689659 540280 866041 373099 500141 78755 296645 410259 ...
output:
155 736626 774126 736435 827329 981373 263979 455010 378609 885689 918107 209587 820658 295 71211 96690 777551 328106 876289 183617 580992 118898 408403 917246 202102 64954 904565 638482 126438 135297 313874 163712 283869 878109 353615 477072 314393 971224 287170 139852 637423 270181 40507 71213 713...
result:
ok Correct (1 test case)
Test #8:
score: 0
Accepted
time: 136ms
memory: 17164kb
input:
1 999997 647436 223560 313749 173791 208472 19484 202293 58288 577646 25489 244804 502016 110660 46059 201131 215956 785297 601887 950455 761106 206866 813740 939637 640694 854103 13254 848440 623785 581087 736815 802377 395356 692446 827316 489135 986276 352461 218066 58935 546307 287432 954710 200...
output:
26 13254 148893 421787 195724 190113 370011 433295 939225 178817 189480 301260 279730 943586 106130 38 218066 43105 615635 252848 460805 603739 672149 683373 383392 681250 509029 451307 14899 811754 737573 987456 808599 725212 396271 170408 877105 548565 789219 698225 241316 670035 271744 985113 205...
result:
ok Correct (1 test case)
Test #9:
score: 0
Accepted
time: 122ms
memory: 15868kb
input:
1 999995 376560 189743 96064 714725 867320 410293 327461 399762 389351 517285 704557 989487 207994 873227 905081 242749 393577 520522 234915 645189 838929 828070 762191 768295 341660 516402 615369 153009 702022 820850 232061 336729 691838 160947 191695 675838 826901 56793 381344 839583 914210 752257...
output:
15887 140648 147584 564015 351047 926445 513467 496197 717467 142116 205936 938367 662930 696757 335322 27281 489880 463840 909312 373126 698920 192311 575070 571418 743183 56309 269870 254525 589232 49510 727069 697020 5637 612958 654206 1316 950410 470660 182374 215494 928001 863626 987516 58555 1...
result:
ok Correct (1 test case)
Test #10:
score: 0
Accepted
time: 130ms
memory: 17044kb
input:
1 999997 69588 647230 167087 991071 412817 332088 426389 505132 301 303011 826476 261371 472289 436452 333073 396919 683995 819266 408456 235065 994502 537023 770928 354622 409101 557451 303341 765827 126406 603996 972615 930685 347903 634610 50624 706028 918863 574760 921336 411043 829389 369276 37...
output:
123 55235 91657 288671 505087 305106 756771 426703 642797 802194 624654 74928 932484 652297 53621 168949 368142 879362 823993 597779 723377 449469 901802 324111 408207 40131 384745 816075 37898 890532 690295 855289 886368 48909 433008 290270 2516 68199 61386 818108 162368 396528 433232 852333 190358...
result:
ok Correct (1 test case)
Test #11:
score: 0
Accepted
time: 115ms
memory: 15324kb
input:
1 999995 944829 184022 584189 44931 382020 646738 472283 116610 935974 570355 788773 241934 738294 626043 874067 603890 741968 138232 528117 609827 426413 419495 494434 809342 94243 198801 749308 766492 505446 969921 372479 49158 138897 702882 55890 776117 638050 57623 553563 26230 261953 942379 323...
output:
55404 342038 230035 514470 35816 18401 524492 453537 479202 500738 253684 856112 836685 194409 312223 724665 73147 684202 686212 300168 519262 479740 546138 290443 433494 876413 533159 766325 634495 154362 383843 686552 463599 659664 160505 236355 138694 534786 150282 699221 375853 290258 631074 168...
result:
ok Correct (1 test case)
Test #12:
score: 0
Accepted
time: 108ms
memory: 15464kb
input:
1 999999 598262 800757 953677 4 792073 6 136708 66880 371324 212640 11 634080 13 385137 494685 16 48898 394580 171289 165715 21 165348 103815 24 208885 877590 916434 28 265045 30 410055 32 33 34 35 38471 37 350679 287494 120609 571575 973011 513657 892070 45 46 118690 410186 49 977441 756000 40886 5...
output:
1 598262 2 800757 3 953677 80271 4 5 792073 960413 6 7 136708 589145 8 66880 171426 699681 10 212640 59711 11 12 634080 850048 13 14 385137 794865 15 494685 984765 16 17 48898 54738 137139 18 394580 19 171289 230572 248190 20 165715 21 22 165348 63929 387255 23 103815 786991 24 25 208885 26 877590 4...
result:
ok Correct (1 test case)
Test #13:
score: 0
Accepted
time: 131ms
memory: 16632kb
input:
1 1000000 598176 980780 744557 853014 801288 772247 686653 948835 432494 397868 653067 88262 742372 978141 748202 436733 798902 30649 648030 890447 124194 832356 162447 690075 519137 485417 580895 188011 923659 541160 793504 808452 587076 664683 992260 711573 958279 280009 695716 468598 162778 94422...
output:
179767 199268 441371 135458 574176 728140 119196 866845 858124 856424 57334 631808 295328 542851 651186 942135 346768 738719 89307 358438 451879 893014 911228 388659 378375 417093 732712 1002 698389 628204 951466 446364 235115 277787 62583 104682 687838 135082 973835 380653 263005 582981 750321 4495...
result:
ok Correct (1 test case)
Test #14:
score: 0
Accepted
time: 132ms
memory: 15612kb
input:
2 971703 762817 773672 219107 586536 332168 315958 296133 682875 574385 514958 225986 401184 585660 790285 726807 784565 967457 873283 910489 454986 183546 184833 114031 602717 368603 143720 164887 161047 795581 607835 863860 280058 803410 734559 493748 847157 251064 200343 658098 142723 738858 8711...
output:
228 261566 312106 426371 522668 487835 638886 294708 181300 480810 733159 519317 223376 438069 624275 178626 175238 608969 723103 769479 529585 308140 348282 378072 872008 658493 348167 507072 670147 28988 946434 312935 113329 852109 743304 747375 24148 581581 939447 737239 629984 251319 923232 9147...
result:
ok Correct (2 test cases)
Test #15:
score: 0
Accepted
time: 128ms
memory: 16416kb
input:
2 940880 111423 813285 759715 575729 564486 700432 368517 290146 832317 243897 473955 698594 394826 240249 172631 330487 448008 923374 194632 300004 214964 371360 588767 48592 166492 461462 549128 15020 291507 192368 543356 182395 625291 371071 30251 920902 162794 530453 587740 906092 231419 117911 ...
output:
146 84790 569875 259928 533790 8712 4138 271727 716293 372242 187640 493668 266358 579594 492391 249575 544099 219081 56432 805892 482420 181754 857006 853334 62523 909868 416876 299422 274232 512370 744067 344806 672675 43479 42553 207807 642661 110613 482238 549178 804121 679367 781691 298938 1031...
result:
ok Correct (2 test cases)
Test #16:
score: 0
Accepted
time: 144ms
memory: 14788kb
input:
2 860629 735188 534252 744523 117977 300521 124360 836277 733811 399530 449393 606669 107978 303823 356049 223557 217235 222785 29525 489289 166055 741811 125793 594271 165471 40345 271714 320863 185123 177911 603339 701397 374390 350130 722274 497043 286267 391000 639814 512894 4979 666163 331108 8...
output:
1117 54278 54855 576586 77332 473878 407599 68180 192661 760119 296276 742843 578995 720368 312484 683406 750250 399931 167923 720976 192473 731172 642340 773899 376861 625908 720372 82168 233894 160709 687109 849327 299986 359692 177936 777185 798762 852321 817636 107280 810127 544033 633141 446233...
result:
ok Correct (2 test cases)
Test #17:
score: 0
Accepted
time: 109ms
memory: 14808kb
input:
2 829683 1 431959 16473 4 5 6 732917 467247 9 97836 11 263443 280696 14 77453 16 75676 18 19 20 672505 789285 605702 24 25 26 635082 444514 29 346335 324390 32 391754 34 699517 36 37 38 509820 284968 807779 42 472180 739589 45 46 627304 48 49 525992 381425 143087 53 710147 55 56 57 225867 113034 256...
output:
1 2 431959 3 16473 4 5 6 7 732917 8 467247 9 10 97836 668831 741053 11 12 263443 13 280696 14 15 77453 521630 16 17 75676 18 19 20 21 672505 633371 448790 23 605702 24 25 26 27 635082 28 444514 466007 29 30 346335 31 324390 421030 32 33 391754 34 35 699517 432089 36 37 38 39 509820 40 284968 42 43 4...
result:
ok Correct (2 test cases)
Test #18:
score: 0
Accepted
time: 126ms
memory: 15716kb
input:
2 114226 10177 47219 101883 102864 32912 88330 112020 9867 97854 21341 46080 93875 84379 32540 15256 58601 105938 89861 105525 22416 10688 84874 46087 88318 35202 31508 18928 20099 39856 89872 112368 11246 43553 102822 40104 16396 7333 25520 62338 46542 35767 23602 84780 33447 110677 33337 94547 306...
output:
5837 46287 91638 74612 101754 21378 44250 77476 12054 55726 43747 69585 40574 45965 24857 71533 10618 19565 63 40206 104828 29908 33832 49611 78416 101464 28384 36160 4637 66591 109347 52649 90210 5836 80163 103300 110173 110733 109307 18708 62794 33250 100061 98196 66882 32053 51689 30570 39404 663...
result:
ok Correct (2 test cases)
Test #19:
score: 0
Accepted
time: 119ms
memory: 11140kb
input:
2 490803 247930 211116 224844 4 244683 6 193671 485364 225504 421778 140897 50721 1860 14 416567 372449 225900 476979 387561 377844 41836 384022 23 355383 411447 302152 128244 88216 130829 169089 398076 101119 64788 371087 194408 67042 37 124187 247834 108274 376285 246797 118696 337858 27533 299129...
output:
1 247930 448018 280171 266765 269210 49463 2 211116 3 224844 151074 324433 106956 228808 4 5 244683 6 7 193671 29000 8 485364 9 225504 394466 79074 40612 464489 11 140897 421043 227365 172440 12 50721 467345 226531 185893 348227 2323 115295 13 1860 160426 8286 461607 381338 279627 188296 112862 14 1...
result:
ok Correct (2 test cases)
Test #20:
score: 0
Accepted
time: 115ms
memory: 14040kb
input:
2 761593 728574 427183 105004 539902 490594 19394 641085 680208 603234 469570 13865 523930 161239 728643 145061 58553 79305 527939 498712 205099 648967 167771 490981 527188 241919 713720 29645 269740 712984 312637 358383 160090 352029 195148 410521 217910 407035 735962 465901 591533 262438 683820 17...
output:
16837 607270 580063 225362 54859 729318 329068 338570 193102 701762 424599 563113 610521 231517 81750 383724 307262 257073 212501 251151 721515 494013 132112 173026 336787 493328 185624 749518 636666 430982 502617 392109 133627 622205 699762 305298 304909 7294 121082 73973 329595 328122 614520 12204...
result:
ok Correct (2 test cases)
Test #21:
score: 0
Accepted
time: 116ms
memory: 14884kb
input:
2 740849 306411 103496 631429 340096 197195 407246 688964 419402 200695 303965 338708 12 131085 586905 595912 215676 448624 392728 730988 298088 628536 132706 164216 589774 127513 86929 348093 569335 380268 33670 391430 252531 423710 439306 678824 9999 645092 314322 328803 536960 379519 104374 20466...
output:
2 103496 539791 3 631429 5 197195 184578 422210 104189 737 8 419402 226564 95312 10 303965 339812 217860 639163 364690 470070 11 338708 428290 435490 12 13 131085 510597 671542 15 595912 290958 16 215676 438026 247433 276268 17 448624 668490 611368 413631 729423 20 298088 18812 22 132706 204800 1191...
result:
ok Correct (2 test cases)
Test #22:
score: 0
Accepted
time: 123ms
memory: 16096kb
input:
2 372608 6161 118264 213659 293946 359350 233967 998 257534 249401 347493 368805 32132 103517 237945 271044 277292 119681 196699 283337 151083 111301 275696 191897 108525 323510 11725 161417 86376 136605 216341 62779 311126 89583 122522 291813 154811 246045 54158 369436 107863 22017 201059 155982 15...
output:
103 209538 110912 361983 234332 9378 358309 232097 236615 113420 138533 168196 203148 171580 304948 102117 823 257483 63524 159733 43242 353003 37748 305769 196471 123513 60794 40243 363990 314220 8625 87488 51917 303861 163811 86730 24567 181738 182762 335838 188525 178840 242446 117459 10730 14219...
result:
ok Correct (2 test cases)
Test #23:
score: 0
Accepted
time: 104ms
memory: 14192kb
input:
2 422157 48267 316096 323543 400772 78389 341504 248827 236534 99971 415431 374598 189566 164740 367740 46908 284090 17 68342 387377 349247 218752 145102 285235 348717 33025 414010 180283 241559 230772 372204 229293 8883 35967 346124 288272 36 301437 362593 111482 367922 34022 316392 159968 1972 391...
output:
1 48267 330418 200342 222502 3 323543 24027 357961 4 400772 413090 8 236534 330400 9 99971 263462 12 189566 35590 307886 13 164740 71911 15 46908 9101 409734 16 284090 340355 17 18 68342 149636 406377 19 387377 20 349247 21 218752 22 145102 187733 279551 359026 388978 23 285235 173877 24 348717 1224...
result:
ok Correct (2 test cases)
Test #24:
score: 0
Accepted
time: 106ms
memory: 15064kb
input:
3 129186 31755 11876 57100 86126 81796 35836 60008 95679 121107 63977 48671 107704 75245 125881 1952 84481 72400 20538 9788 121467 58250 15284 52305 122856 124667 83008 20996 32166 49867 96890 58689 101545 105869 105678 37189 124501 30217 72764 8227 124244 12229 34971 55154 56311 114246 41135 79766 ...
output:
3912 22203 24334 43090 15561 4155 46450 28384 24037 22562 3611 67999 55073 13781 31495 118922 44421 114081 42676 80493 40413 101296 23176 97007 29826 28309 49868 95822 1124 56603 85358 56333 104531 93039 123376 94015 52567 101177 23614 106676 55466 102246 43395 33687 11207 27431 104584 9105 30546 19...
result:
ok Correct (3 test cases)
Test #25:
score: 0
Accepted
time: 126ms
memory: 13292kb
input:
4 576473 138534 9158 386505 271582 253613 505067 21315 255917 531131 70593 200185 399046 63462 384920 398535 135563 77884 46170 167179 416370 353883 271084 196966 361621 493549 195011 524237 384979 548509 88272 75116 465541 555434 505759 323150 511129 210266 362446 472113 217471 541744 121619 464159...
output:
1 138534 110586 17653 222742 160368 82814 263671 381316 335034 458922 5085 531288 311769 440466 344026 181996 537946 188109 386348 568657 253000 153564 296342 230403 437136 7987 25981 254109 437523 378482 323335 421633 472121 40565 186774 391461 495727 531161 251830 439061 46209 82799 158222 391303 ...
result:
ok Correct (4 test cases)
Test #26:
score: 0
Accepted
time: 109ms
memory: 10736kb
input:
5 291107 4344 253602 242407 4 5 236812 1999 179653 90206 274589 11 12 13 14 100064 16 17 151536 19 20 29619 22 23 290167 25 26 27 162665 29 198598 40701 215269 183865 34 52718 147488 129463 38 214863 149217 251494 266166 8325 44 75704 92419 277502 48 283269 272669 51 164404 53 146186 29598 169233 57...
output:
1 4344 2 253602 4 5 6 236812 35342 195968 257735 59731 25421 21497 7 1999 8 179653 233627 93051 9 90206 11 12 13 14 15 100064 16 17 18 151536 187440 19 20 21 29619 228019 223837 258341 230053 22 23 24 290167 25 26 27 28 162665 29 30 198598 31 40701 193915 32 215269 162130 33 183865 34 35 52718 11339...
result:
ok Correct (5 test cases)
Test #27:
score: 0
Accepted
time: 113ms
memory: 9380kb
input:
6 171846 88727 167968 171648 104621 113388 170614 83131 171812 114961 72135 75118 138444 119342 167606 83183 2544 119818 1538 47334 8831 148067 120230 50991 142431 131115 160279 25321 88060 34171 40731 87202 148162 122759 55748 157938 71982 39735 30505 77905 59596 60948 118087 124927 35449 131770 13...
output:
11770 19207 107440 127551 31915 45451 68408 72641 132906 108168 46626 22643 143838 106301 81795 84688 100174 129262 74850 48262 59417 47740 121158 116009 56430 158329 97039 134367 4693 25290 157554 14250 29364 126639 28392 13354 20570 103483 17008 81107 102812 31207 128992 111803 36570 112184 33266 ...
result:
ok Correct (6 test cases)
Test #28:
score: 0
Accepted
time: 115ms
memory: 9948kb
input:
7 34222 23613 18586 30860 26673 1470 24232 3310 9740 18142 24635 9368 4183 9405 3042 11074 13003 5948 19837 17297 6192 3902 15446 19385 21861 2574 22358 23569 12381 28520 4915 34060 13423 2816 10801 30581 16798 8629 17508 16908 16312 28630 8832 16593 32016 19801 19926 24548 4722 29268 9130 7641 8301...
output:
11 9368 27717 11221 4721 21814 29218 16068 12 4183 4540 6658 20153 5840 19449 9958 26075 5147 1881 29143 2073 12123 14375 29404 12886 19056 1473 29526 9360 33582 21536 23592 6954 974 18133 21440 2832 22245 25879 23045 17619 31134 17 5948 7204 27705 24469 13996 13615 16822 17185 19125 31105 7796 8520...
result:
ok Correct (7 test cases)
Test #29:
score: 0
Accepted
time: 107ms
memory: 6660kb
input:
8 124117 1 2 94219 73581 102279 57865 7 7582 362 44659 11 12 13923 50071 117683 16 48835 18 19 119653 68403 22 23 23598 25 26 27 112321 1175 99981 39947 30139 33 99236 84885 32089 24773 38 39 39429 93420 42 65218 44 109731 46 87083 44915 2873 50 97092 122740 32459 88363 55 4390 57 58 110977 14017 61...
output:
1 2 3 94219 18505 98394 21938 4 73581 22858 5 102279 6 57865 7 8 7582 9 362 113174 10 44659 11 12 13 13923 91173 14 50071 15 117683 16 17 48835 54462 98088 94259 18 19 20 119653 21 68403 70079 22 23 24 23598 68009 42189 25 26 27 28 112321 29 1175 49866 30 99981 31 39947 22333 46446 103882 32 30139 3...
result:
ok Correct (8 test cases)
Test #30:
score: 0
Accepted
time: 102ms
memory: 7060kb
input:
9 25269 3656 4305 20794 20524 4941 18071 11432 1354 24292 17833 21323 7468 13870 14 20138 5430 24955 23127 15922 20067 17287 22 22670 14424 22468 26 23166 7053 22199 23721 22154 24074 4257 7538 23332 21057 2107 2984 24798 11542 21386 11387 24020 7935 45 8540 1882 8124 24682 16920 24947 13365 6825 25...
output:
1 3656 23844 22317 2 4305 15789 16432 3 20794 16140 14128 4 20524 5 4941 24960 20363 19540 19939 7 11432 8090 9126 3384 8 1354 24729 16533 3309 9 24292 4253 10 17833 2957 24982 4005 12 7468 13 13870 14 21 17287 22 23 22670 13170 1928 26 28 7053 6710 19058 10455 1762 29 22199 19969 16701 30 23721 144...
result:
ok Correct (9 test cases)
Test #31:
score: 0
Accepted
time: 99ms
memory: 7272kb
input:
10 143919 67710 2 129458 107948 49717 120331 7 128218 58515 79909 11 104303 70438 14 70861 63592 17 18 98891 20 45882 66998 93668 51451 81268 26 19878 28 25598 69454 45455 5371 64724 34 14288 72335 79409 65860 1896 40 55669 78955 43 103019 105786 116605 47284 6056 49 13596 141664 87382 53 54 62439 3...
output:
1 67710 2 3 129458 4 107948 38780 5 49717 131496 129165 87752 7 8 128218 9 58515 132980 29999 11 12 104303 13 70438 3538 14 15 70861 91649 16 63592 17 18 19 98891 20 21 45882 20982 105873 22512 9110 22 66998 23 93668 127326 24 51451 25 81268 23643 26 27 19878 28 29 25598 30 69454 30658 90353 57125 1...
result:
ok Correct (10 test cases)
Test #32:
score: 0
Accepted
time: 115ms
memory: 6752kb
input:
11 59994 28919 7546 17564 46765 16954 24583 33885 48269 37805 25491 9859 10000 56306 38924 59750 54979 17 13468 1054 56316 14451 44679 21323 55444 46596 58891 50718 7148 10580 27177 47509 48370 55051 29986 6217 5555 17183 1144 56697 49615 11242 34179 15502 19415 50815 35422 15680 27712 55002 25995 5...
output:
1 28919 13318 14423 16659 29389 13423 13829 9063 3 17564 15493 53703 1210 2919 57991 4 46765 11370 49572 4320 52624 49176 2058 9812 25568 20922 56230 49347 16195 47446 45502 942 50627 42764 43955 32966 56338 54816 41224 1590 446 5 16954 47236 39484 6 24583 23414 53677 9372 40628 21360 58684 6436 145...
result:
ok Correct (11 test cases)
Test #33:
score: 0
Accepted
time: 117ms
memory: 8672kb
input:
12 296268 246194 195113 285819 144995 110267 278665 115028 243078 134463 264181 127223 112549 257710 245008 76626 14552 83091 221158 150463 278137 104120 125573 86778 137185 63708 260801 273375 284624 26676 8478 13628 144241 278947 89469 216821 176481 256176 283540 190373 255420 291753 110932 259911...
output:
146 262701 281419 146712 109995 190553 53972 180756 237918 51457 77717 113755 180435 208395 59680 11366 290319 257816 243573 232124 208302 251091 164299 134734 161892 114896 142322 160392 221610 18584 14381 216967 1924 230634 238479 25432 144114 167358 9717 117417 90067 184540 80894 16520 48382 2537...
result:
ok Correct (12 test cases)
Test #34:
score: 0
Accepted
time: 118ms
memory: 7108kb
input:
13 58622 3302 18027 49527 11722 8017 35628 53598 48494 9324 28940 14825 24185 3548 56985 42983 13063 51742 41327 28216 12898 5492 32222 5228 19649 20509 48109 20044 21012 51120 5138 26491 28380 51448 37123 45036 25750 13970 1804 31231 20498 12066 986 57872 33097 35489 31770 54639 4045 13690 15786 46...
output:
1004 30905 24754 33630 16456 43514 27563 41994 44333 1412 47642 16983 47424 12743 39006 42307 9204 35038 53794 25352 30157 16177 57414 36431 49061 52190 46930 31735 10053 9248 40837 57674 35893 26264 30725 29015 27080 28935 32049 3474 52867 31162 270 15645 17401 22818 38646 57960 30673 39818 12729 3...
result:
ok Correct (13 test cases)
Test #35:
score: 0
Accepted
time: 106ms
memory: 7620kb
input:
14 287735 250431 222877 25799 117882 153424 6 51352 180699 147333 223582 11 134078 255320 176994 221961 194160 109851 247808 32565 203538 9844 283440 166776 57945 281831 34772 152796 28 48870 30 189994 242066 61845 226764 110535 249472 195706 261012 239150 117942 98734 42 87817 226894 278701 43883 1...
output:
1 250431 226317 124722 3 25799 36980 124111 177508 4 117882 266170 6 7 51352 5638 132069 262919 145905 243573 8 180699 9 147333 10 223582 11 12 134078 13 255320 143655 97816 14 176994 128821 216691 253199 16 194160 14271 237070 253365 250151 17 109851 40971 18 247808 217820 85477 106228 60359 21553 ...
result:
ok Correct (14 test cases)
Test #36:
score: 0
Accepted
time: 87ms
memory: 6428kb
input:
15 6181 3268 3157 394 214 5 6 2955 2598 1907 371 3273 12 13 3806 2104 16 3233 871 4997 1792 21 3013 4008 5153 5723 3060 2137 1322 1375 669 2726 3836 33 2867 5361 5995 1570 745 39 2633 136 5617 43 836 3043 2651 3462 4787 5758 771 4341 5774 53 2974 5735 4182 694 1305 1177 4287 2052 62 5382 64 5980 136...
output:
1 3268 2155 5513 2968 3498 2 3157 3 394 5 6 7 2955 1864 8 2598 3025 9 1907 3223 2044 2791 4811 10 371 961 3984 2217 3400 11 3273 2757 5611 1364 5786 237 12 13 14 3806 6098 4582 3194 2191 3835 1266 15 2104 5871 16 17 3233 659 18 871 2334 4229 3733 4573 2118 4111 19 4997 5720 3700 4910 108 20 1792 21 ...
result:
ok Correct (15 test cases)
Test #37:
score: 0
Accepted
time: 100ms
memory: 4028kb
input:
100 3026 1 2 3 4 2466 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 1822 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 1842 84 85 827 87 88 89 90 91 92 93 94 95 96 97 9...
output:
1 2 3 4 5 2466 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1822 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 1842 84 85 86 827 87 88 89 90 91 92 93 94 95 96 97...
result:
ok Correct (100 test cases)
Test #38:
score: 0
Accepted
time: 99ms
memory: 4224kb
input:
101 8146 1 2 3883 4960 4762 3205 3799 1640 9 4446 255 4211 7920 7719 15 7820 697 18 3033 20 3199 1610 23 3547 2140 413 4588 3739 29 6962 31 8098 3747 34 5067 36 3407 38 5240 3509 41 4078 7441 2865 1409 46 7334 48 1653 7949 51 52 2123 1016 729 1374 57 4925 59 6743 61 62 1768 3984 5726 1894 5433 68 35...
output:
1 2 3 3883 3465 4 4960 1216 5 4762 6 3205 7529 7969 7 3799 8 1640 9 10 4446 4887 11 255 746 782 7161 12 4211 13 7920 15 16 7820 7882 17 697 3347 18 19 3033 6200 20 21 3199 22 1610 23 24 3547 1591 25 2140 3998 27 4588 28 3739 5674 3555 29 30 6962 1337 31 32 8098 33 3747 34 35 5067 5515 36 38 39 5240 ...
result:
ok Correct (101 test cases)
Test #39:
score: 0
Accepted
time: 98ms
memory: 5080kb
input:
102 14999 5489 4491 8375 6095 10926 2441 9421 1641 14240 10984 7862 6111 4031 8049 14669 9982 5229 14768 8209 13573 11158 4078 3308 6807 8681 1905 2701 4586 10924 1025 5433 9647 8381 2792 9868 10470 7144 4980 12189 11938 4034 11840 2779 6338 1055 3945 13152 11293 10954 9377 12727 1867 7296 14524 906...
output:
1 5489 6906 10976 10239 12019 3312 2008 13881 8459 5005 12110 2180 13739 6428 3998 2900 882 2468 14886 10373 14395 14276 3849 14168 1816 3175 7812 14213 1980 3685 10332 1741 9538 11861 5409 2183 7942 11116 13338 1407 6388 1400 6377 12496 9508 12010 8291 10938 10487 11334 8420 2202 3250 14849 9014 27...
result:
ok Correct (102 test cases)
Test #40:
score: 0
Accepted
time: 102ms
memory: 4292kb
input:
103 19032 18365 130 13329 18529 2938 608 13636 12776 2937 18130 17907 18446 458 4634 4003 5804 1779 7958 2827 16045 7917 6139 9405 6110 16419 11364 16563 9659 18273 4062 17687 15599 9891 11866 15901 12774 11796 11690 17729 8186 6465 17803 15097 17721 9833 5026 1251 13562 16038 15438 4467 5441 11527 ...
output:
680 2196 13158 4940 12921 14755 9652 845 1504 13579 1894 4374 18596 12337 15565 14661 322 6137 12701 14522 4262 2083 8927 7308 12608 1312 7435 2626 16345 7702 8240 18779 5654 332 3974 6981 9638 14706 5846 3002 226 11157 9215 17630 9176 12362 10926 2032 893 9918 16306 2913 8720 13851 14725 2740 2876 ...
result:
ok Correct (103 test cases)
Test #41:
score: 0
Accepted
time: 94ms
memory: 4612kb
input:
104 1474 974 1408 1403 1265 168 854 65 1135 1158 940 100 1258 388 1292 255 1360 179 49 918 1468 498 1313 1358 1108 489 1169 387 785 914 569 1392 52 570 1455 1084 78 316 382 894 248 631 682 948 597 954 53 1055 926 114 137 749 959 314 324 277 60 994 57 1216 898 207 549 1270 853 1212 532 243 680 267 22...
output:
11 100 849 471 1319 1209 371 16 1360 1 974 1247 1105 758 447 527 665 309 429 1259 67 243 641 120 149 1422 579 846 1140 20 1468 565 437 632 1069 1304 487 502 1413 1026 1467 1157 971 417 430 1281 230 583 235 763 332 859 125 515 202 865 7 65 1212 1017 1051 1336 201 1072 286 585 794 1203 495 1328 104 13...
result:
ok Correct (104 test cases)
Test #42:
score: 0
Accepted
time: 94ms
memory: 3984kb
input:
105 4350 4127 1488 2648 3557 435 3468 1407 533 3564 2386 2446 114 3246 3460 368 1896 3446 2999 1812 1864 581 871 512 1495 3455 3874 2563 1382 3630 2472 4135 4317 2924 4025 2367 1322 2619 22 1101 3207 2086 2564 3153 2604 4156 3920 208 1023 1114 1482 1159 4177 4348 627 400 2878 1724 982 2250 1790 2274...
output:
8 533 3117 3899 619 4119 4039 1336 859 2028 3489 2540 3819 1665 1340 1797 3122 34 4025 2113 1906 1257 3982 1807 2974 1969 2871 1536 1405 1421 11 2446 3192 2755 2234 420 3964 2408 4047 4142 1952 3444 2718 999 2561 567 1937 3002 2805 4252 3458 371 505 3183 321 626 2521 3746 3550 4242 1096 565 2679 578...
result:
ok Correct (105 test cases)
Test #43:
score: 0
Accepted
time: 93ms
memory: 3800kb
input:
1000 1896 29 588 1481 15 1020 1139 748 1085 725 368 580 1520 362 670 210 1031 1796 1366 596 1500 1513 277 1561 303 485 997 1055 253 1766 1140 1195 669 1403 1188 22 880 675 1057 1503 1385 1127 1274 1015 587 1817 1590 1792 859 1750 1490 401 1266 283 619 526 151 284 443 629 508 1865 795 1613 1416 1757 ...
output:
19 596 297 185 799 739 1322 657 1028 755 871 1065 1731 436 1677 1537 1745 890 1860 292 250 576 43 1015 1651 470 1280 1741 898 364 22 277 1123 1763 976 757 1744 946 1768 900 1248 35 23 1561 1 29 1766 533 24 303 732 1567 1279 248 1702 581 905 964 610 85 1084 892 61 1865 1330 482 840 1811 978 1114 1675...
result:
ok Correct (1000 test cases)
Test #44:
score: 0
Accepted
time: 101ms
memory: 3836kb
input:
1001 877 49 700 741 217 744 510 396 418 592 791 227 164 749 311 865 750 573 45 199 173 98 443 310 157 413 773 63 567 248 33 798 481 171 4 466 656 392 281 868 873 588 845 201 703 124 365 184 154 505 256 565 180 179 754 513 651 468 140 30 558 678 89 126 736 735 721 346 587 692 393 451 529 377 330 775 ...
output:
15 865 428 829 351 18 45 124 284 85 877 69 692 27 63 126 796 534 383 34 4 217 757 60 558 582 855 751 547 423 206 794 679 384 322 614 473 406 1 49 505 486 29 248 350 514 142 848 223 7 396 195 560 364 10 791 500 615 407 341 628 439 325 787 830 875 228 790 495 112 559 312 107 563 822 214 491 326 698 46...
result:
ok Correct (1001 test cases)
Test #45:
score: 0
Accepted
time: 100ms
memory: 4024kb
input:
1002 92 21 2 48 88 66 41 7 8 71 16 12 57 67 60 15 10 17 79 61 20 1 22 19 24 84 26 27 29 33 85 50 32 28 64 11 80 81 38 52 77 6 42 76 44 5 46 47 30 92 31 51 39 25 49 9 91 35 65 59 14 23 62 69 34 58 45 13 73 40 37 55 72 68 74 75 43 63 78 4 36 3 82 90 53 70 86 87 18 89 83 56 54 152 146 18 123 92 116 29 ...
output:
1 21 2 3 48 30 85 70 37 81 5 66 45 6 41 7 8 9 71 55 10 16 11 12 57 35 13 67 14 60 15 17 18 79 4 88 19 61 23 20 22 24 25 84 53 26 27 28 29 33 31 50 32 34 64 36 80 38 39 52 42 43 76 44 46 47 49 92 54 51 56 91 58 65 59 62 63 69 40 77 68 73 72 74 75 78 82 83 90 86 87 89 16 63 70 101 87 57 85 137 14 74 5...
result:
ok Correct (1002 test cases)
Test #46:
score: 0
Accepted
time: 100ms
memory: 3712kb
input:
1003 2339 1433 1479 282 611 118 1509 1150 1827 602 1702 2277 2323 801 1523 2076 1683 1708 688 1959 20 2230 395 1564 1709 2080 304 1305 2160 733 915 771 1611 2104 985 1178 1657 2112 632 1927 1998 911 1366 1251 1926 1527 1810 47 1570 572 1764 1161 1399 1464 1870 155 1092 2010 2060 2270 1372 786 1595 4...
output:
2 1479 1167 415 2207 1912 751 1923 1245 2196 2326 135 1780 1445 202 5 118 665 6 1509 512 1713 1120 1700 392 7 1150 474 2064 1230 2113 924 189 2140 2031 8 1827 1854 397 9 602 622 516 94 651 1492 145 13 801 494 1214 927 1045 1715 1617 229 1746 1357 2061 1952 1078 1805 1676 1317 14 1523 16 1683 2339 16...
result:
ok Correct (1003 test cases)
Test #47:
score: 0
Accepted
time: 101ms
memory: 3856kb
input:
1004 932 1 732 177 4 5 6 79 8 9 10 11 12 13 14 15 429 819 618 19 20 859 22 23 281 25 26 27 857 35 30 884 32 33 118 623 914 37 38 39 40 41 372 136 807 45 46 47 48 263 627 790 530 599 54 892 222 876 58 59 60 61 62 63 64 443 66 370 68 69 169 71 72 73 74 214 88 77 78 7 167 451 352 76 84 425 241 87 83 89...
output:
1 2 732 867 598 3 177 4 5 6 7 79 8 9 10 11 12 13 14 15 16 429 17 819 18 618 19 20 21 859 22 23 24 281 448 25 26 27 28 857 107 29 35 623 30 31 884 557 32 33 34 118 36 914 37 38 39 40 41 42 372 43 136 44 807 606 45 46 47 48 49 263 50 627 51 790 764 52 530 53 599 54 55 892 56 222 57 876 58 59 60 61 62 ...
result:
ok Correct (1004 test cases)
Test #48:
score: 0
Accepted
time: 101ms
memory: 3868kb
input:
1005 656 506 74 507 505 512 187 641 151 469 182 234 457 359 18 15 259 1 153 561 326 116 107 55 102 123 51 200 235 227 410 581 286 33 58 558 514 518 453 431 272 264 42 138 101 60 27 4 545 468 12 84 257 494 406 10 83 451 93 419 474 625 541 373 293 390 647 86 485 575 233 499 573 498 633 77 205 439 418 ...
output:
1 506 226 17 4 505 203 92 47 5 512 634 528 408 382 8 151 570 332 411 556 598 75 77 439 155 445 43 138 554 592 284 188 403 291 69 575 488 266 552 331 9 469 596 635 12 457 492 643 471 136 50 13 359 14 18 153 536 351 379 563 377 289 23 55 10 182 145 15 21 116 22 107 425 322 397 491 25 123 539 399 454 6...
result:
ok Correct (1005 test cases)
Test #49:
score: 0
Accepted
time: 95ms
memory: 3684kb
input:
10000 4 1 2 4 3 108 48 64 35 75 59 65 101 93 56 104 83 100 69 43 38 18 15 67 33 29 92 51 77 52 44 36 96 66 89 24 70 16 31 72 7 40 95 45 79 84 28 3 82 71 12 34 47 1 103 105 20 37 5 85 42 86 32 80 58 60 49 62 8 2 57 4 99 21 78 22 11 46 63 26 91 13 39 50 14 98 17 61 81 108 53 9 107 19 87 90 94 102 73 4...
output:
1 2 3 4 1 48 2 64 5 59 58 80 98 55 42 3 35 7 101 54 85 53 8 93 73 63 9 56 86 10 104 13 69 78 50 105 106 76 15 38 45 12 100 25 44 71 11 83 81 17 16 18 67 99 68 21 92 102 6 65 57 32 20 29 89 87 107 23 77 39 79 14 43 82 61 49 103 88 19 33 31 70 22 51 24 52 37 95 30 26 36 40 84 108 97 27 96 74 28 66 4 7...
result:
ok Correct (10000 test cases)
Test #50:
score: 0
Accepted
time: 96ms
memory: 3728kb
input:
10001 35 13 31 11 23 35 1 26 21 34 3 10 20 14 5 16 24 33 2 9 32 17 30 15 8 29 18 28 27 6 19 12 22 4 7 25 27 5 18 17 26 6 19 25 21 3 1 2 27 4 12 13 20 7 23 14 9 11 22 24 8 15 16 10 309 92 183 305 4 100 249 93 83 101 245 226 56 131 58 186 179 94 187 71 11 52 147 16 207 75 146 3 122 285 123 152 150 259...
output:
1 13 14 5 35 25 29 6 2 31 12 20 32 22 30 19 9 34 7 26 18 3 11 10 15 16 24 8 21 17 33 4 23 27 28 1 5 6 19 14 12 27 10 2 18 23 24 8 21 11 3 17 7 25 15 13 4 26 16 20 9 22 1 92 36 206 248 231 133 230 176 204 90 219 203 3 305 229 76 232 262 6 249 27 4 5 100 124 95 117 218 163 208 43 28 122 241 188 139 7 ...
result:
ok Correct (10001 test cases)
Test #51:
score: 0
Accepted
time: 97ms
memory: 3728kb
input:
10002 402 275 227 367 402 91 249 345 167 268 222 290 36 215 156 280 23 78 119 240 231 129 300 270 293 378 352 10 107 76 112 234 301 216 82 336 221 252 386 37 147 110 348 173 118 127 385 377 286 135 214 287 132 384 382 321 61 387 83 272 172 186 150 370 210 116 28 332 140 397 284 322 64 103 209 188 26...
output:
13 215 171 16 23 270 228 197 143 55 321 125 181 88 33 216 170 310 262 297 81 218 245 271 355 80 308 356 114 253 199 365 130 57 387 347 176 319 184 7 345 205 323 337 168 32 301 392 289 207 233 106 338 65 116 302 84 265 60 172 138 307 238 113 46 385 398 266 158 111 117 17 78 8 167 329 131 151 243 391 ...
result:
ok Correct (10002 test cases)
Test #52:
score: 0
Accepted
time: 96ms
memory: 3912kb
input:
10003 18 16 7 15 4 13 14 17 11 10 3 6 2 18 9 12 1 8 5 40 20 22 33 29 25 19 40 28 36 30 9 7 12 34 38 24 6 14 18 15 37 8 3 1 13 35 26 27 5 31 21 39 10 4 11 23 32 2 17 16 19 19 13 10 4 16 15 8 14 3 9 5 12 2 11 18 7 6 1 17 187 1 2 3 4 5 6 40 8 154 10 11 12 13 14 15 141 17 18 19 20 21 22 23 24 25 26 27 2...
output:
1 16 4 5 13 18 8 11 6 14 9 10 3 15 12 2 7 17 2 22 8 28 27 26 35 11 9 36 23 3 33 10 30 31 21 37 32 39 17 6 19 18 14 34 4 29 5 25 13 12 7 40 16 24 1 20 15 38 2 13 3 10 9 4 6 15 18 1 19 17 7 8 14 11 5 16 12 1 2 3 4 5 6 7 40 8 9 154 10 11 12 13 14 15 16 141 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 3...
result:
ok Correct (10003 test cases)
Test #53:
score: 0
Accepted
time: 101ms
memory: 3676kb
input:
10004 67 45 3 27 21 49 35 66 32 64 15 59 48 36 19 53 25 52 12 29 63 33 37 43 14 62 65 67 5 8 54 11 41 44 22 23 55 50 7 58 16 39 6 40 28 51 9 20 61 38 30 10 13 60 17 56 4 42 18 26 1 57 24 2 46 34 47 31 349 283 187 282 266 5 58 233 264 44 184 210 158 104 14 48 179 2 291 218 207 15 22 342 333 141 298 2...
output:
1 45 51 10 15 53 60 9 64 46 14 19 29 8 32 41 39 58 18 12 48 61 57 42 6 35 23 43 40 16 25 62 24 22 37 50 30 54 17 52 13 36 55 56 4 21 33 44 28 5 49 38 7 66 47 20 63 2 3 27 67 31 11 59 26 65 34 2 187 132 199 67 154 133 40 230 17 5 6 58 7 233 4 266 57 295 248 33 138 213 110 338 212 8 264 114 122 228 26...
result:
ok Correct (10004 test cases)
Test #54:
score: 0
Accepted
time: 85ms
memory: 3728kb
input:
10005 64 12 21 16 34 42 8 54 19 22 48 59 55 62 47 13 64 61 60 29 6 23 2 49 5 44 56 33 26 25 37 39 57 27 52 14 11 20 18 3 36 30 50 53 58 46 38 35 10 32 4 31 24 45 1 7 28 51 41 63 43 9 15 40 17 43 41 33 31 14 12 27 11 16 22 40 8 19 30 10 6 5 29 35 24 1 42 20 38 34 13 17 4 18 21 37 25 43 3 2 15 9 36 39...
output:
1 12 55 7 54 2 21 23 49 32 57 51 31 39 3 16 64 17 61 9 22 5 42 50 4 34 52 24 6 8 19 29 25 44 58 41 30 37 20 10 48 11 59 63 40 36 13 62 15 14 47 35 18 60 43 53 45 46 38 26 56 28 27 33 7 11 8 16 5 12 19 24 34 2 33 3 31 25 13 30 37 36 9 22 20 1 41 32 43 23 38 39 26 17 29 21 42 28 18 35 15 6 27 4 14 10 ...
result:
ok Correct (10005 test cases)
Test #55:
score: 0
Accepted
time: 113ms
memory: 3900kb
input:
99995 20 3 13 5 2 1 12 9 14 10 6 7 16 4 20 11 8 18 17 15 19 28 26 5 14 25 2 19 12 18 24 9 1 3 7 22 11 6 10 21 4 28 16 13 17 23 20 15 27 8 1 1 9 1 7 8 9 5 3 4 6 2 12 4 9 8 6 2 1 7 11 12 10 3 5 10 1 2 3 4 5 6 7 8 9 10 41 13 24 5 22 3 10 23 12 15 6 11 9 1 20 39 16 17 18 19 35 30 25 7 27 8 26 2 28 29 21...
output:
1 3 5 2 13 4 7 9 10 6 12 16 8 14 20 19 15 11 17 18 1 26 15 11 2 5 6 19 4 25 20 28 8 18 21 16 7 12 3 14 22 13 9 24 23 17 10 27 1 1 2 7 4 9 3 8 6 5 1 4 6 2 9 12 5 3 8 11 7 10 1 2 3 4 5 6 7 8 9 10 1 13 2 24 27 3 5 6 10 7 23 8 12 9 15 39 36 4 22 25 11 14 20 35 16 17 18 19 21 30 26 28 29 31 32 33 34 40 3...
result:
ok Correct (99995 test cases)
Test #56:
score: 0
Accepted
time: 109ms
memory: 3636kb
input:
99996 1 1 12 3 8 12 6 7 10 1 4 9 2 5 11 5 1 2 5 4 3 23 22 6 15 9 14 8 7 4 10 18 20 16 2 3 1 5 12 11 17 13 19 23 21 18 11 18 3 9 17 7 4 8 16 10 15 14 12 13 1 6 5 2 3 3 1 2 18 10 14 5 9 16 7 17 13 15 1 2 8 11 12 18 3 6 4 1 1 2 1 2 6 1 5 4 6 3 2 1 1 21 1 2 10 15 5 6 7 8 9 3 11 12 13 14 4 16 17 18 19 20...
output:
1 1 3 12 11 5 7 4 6 10 2 8 9 1 2 3 5 4 2 6 8 4 9 10 18 11 20 13 5 14 3 15 1 22 23 21 19 17 12 16 7 1 11 15 2 18 3 5 17 6 7 4 9 16 8 10 12 14 13 1 3 2 1 10 3 5 16 4 9 15 18 6 7 17 8 13 11 2 14 12 1 1 2 1 3 4 6 2 5 1 1 2 3 10 4 15 5 6 7 8 9 11 12 13 14 16 17 18 19 20 21 1 2 7 8 9 6 3 5 4 1 2 5 6 3 4 1...
result:
ok Correct (99996 test cases)
Test #57:
score: 0
Accepted
time: 112ms
memory: 3900kb
input:
99997 5 2 3 4 5 1 8 3 6 2 1 8 7 5 4 18 3 11 16 13 2 17 10 5 14 6 18 15 12 1 7 9 8 4 6 6 5 1 3 2 4 17 11 2 8 9 12 17 10 15 4 16 1 5 13 14 3 7 6 2 2 1 7 7 5 3 4 2 6 1 4 1 2 3 4 4 4 1 2 3 7 3 2 4 6 1 5 7 11 10 2 3 4 5 6 7 8 9 1 11 2 1 2 1 1 5 1 2 3 4 5 8 8 5 1 3 7 4 6 2 19 1 4 3 2 19 12 7 16 9 10 11 6 ...
output:
1 2 3 4 5 1 3 2 6 7 5 8 4 1 3 16 9 14 4 13 12 15 7 10 6 17 8 5 2 11 18 1 6 4 3 2 5 1 11 2 3 8 15 4 9 5 12 6 17 7 10 16 13 14 1 2 1 7 2 5 3 4 6 1 2 3 4 1 4 3 2 1 3 4 6 5 2 7 1 10 2 3 4 5 6 7 8 9 11 1 2 1 1 2 3 4 5 1 8 2 5 7 6 4 3 1 2 4 3 5 19 6 12 7 8 16 9 10 11 13 14 15 17 18 2 5 8 6 12 7 9 10 3 13 ...
result:
ok Correct (99997 test cases)
Test #58:
score: 0
Accepted
time: 113ms
memory: 3588kb
input:
99998 15 10 13 6 14 7 8 15 1 9 12 5 4 2 3 11 10 8 7 9 2 3 4 6 10 5 1 1 1 9 7 2 1 4 5 6 9 8 3 15 10 9 3 4 5 14 11 8 2 1 12 6 13 7 15 10 9 6 7 1 8 10 2 3 5 4 18 1 2 3 16 5 6 7 8 17 10 11 12 13 14 15 4 9 18 4 1 3 2 4 5 1 2 3 4 5 40 38 18 9 39 22 40 24 5 1 31 10 27 32 4 29 33 13 21 37 8 19 30 34 3 25 35...
output:
2 13 3 6 8 1 10 12 4 14 5 7 15 11 9 1 8 10 2 7 6 4 3 9 5 1 1 7 9 3 2 4 5 6 8 1 10 2 9 3 4 5 7 11 12 6 14 8 13 15 2 6 10 4 1 9 5 8 3 7 1 2 3 4 16 5 6 7 8 9 17 10 11 12 13 14 15 18 1 2 3 4 1 2 3 4 5 3 9 1 38 7 24 5 22 30 23 34 6 40 2 18 21 19 37 36 20 8 10 31 17 13 32 11 12 27 28 14 4 39 26 35 15 29 1...
result:
ok Correct (99998 test cases)
Test #59:
score: 0
Accepted
time: 113ms
memory: 3896kb
input:
99999 33 7 26 21 23 17 27 13 16 28 2 11 19 15 20 4 14 6 1 5 8 30 9 12 22 32 10 29 3 33 31 18 24 25 16 13 15 5 1 16 14 2 6 3 10 4 12 7 8 11 9 19 17 16 6 9 1 10 5 7 4 14 11 3 2 12 15 13 18 8 19 15 4 5 11 13 3 12 6 15 14 7 10 1 8 2 9 3 1 2 3 7 1 3 7 6 4 2 5 6 2 4 1 3 6 5 9 3 8 4 9 1 7 5 2 6 25 12 3 21 ...
output:
1 7 13 15 4 23 12 19 5 17 6 27 29 33 25 32 24 22 9 28 3 21 30 31 18 2 26 10 8 16 14 20 11 1 13 7 2 15 11 4 3 5 16 9 6 14 8 10 12 1 17 18 8 7 5 2 16 13 3 6 10 14 12 4 9 11 15 19 2 5 3 11 10 7 6 12 1 4 13 8 15 9 14 1 2 3 1 4 6 2 3 7 5 1 2 4 3 5 6 1 3 4 9 6 7 5 2 8 1 12 2 3 21 4 10 5 7 14 17 8 6 20 9 1...
result:
ok Correct (99999 test cases)
Test #60:
score: 0
Accepted
time: 112ms
memory: 3672kb
input:
100000 1 1 9 8 1 2 7 5 3 4 6 9 14 4 2 10 5 6 12 13 1 8 11 9 3 14 7 7 4 6 5 3 7 2 1 46 31 34 46 5 4 36 24 21 3 16 23 2 29 38 14 10 15 35 45 12 19 39 25 37 33 7 22 43 1 41 9 13 27 40 17 42 26 20 11 18 30 28 44 6 8 32 4 1 4 3 2 1 1 14 1 2 3 10 14 12 13 4 9 8 7 6 5 11 1 1 27 11 25 22 26 5 14 27 21 13 15...
output:
1 1 8 6 3 2 4 7 5 9 1 4 5 6 12 3 10 11 9 8 2 7 13 14 1 4 3 5 7 2 6 4 5 6 36 42 28 43 44 7 24 37 26 8 21 19 45 10 16 11 23 25 33 27 22 39 13 29 1 31 9 3 46 32 14 38 20 12 2 34 40 18 35 17 15 30 41 1 2 4 3 1 1 2 3 4 10 8 6 12 7 13 5 14 11 9 1 1 11 9 13 12 17 6 14 2 25 3 22 5 7 27 10 15 20 4 26 19 8 21...
result:
ok Correct (100000 test cases)
Extra Test:
score: 0
Extra Test Passed