QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#78566 | #5528. Least Annoying Constructive Problem | maspy | AC ✓ | 230ms | 7052kb | C++20 | 15.2kb | 2023-02-19 15:32:16 | 2023-02-19 15:32:18 |
Judging History
answer
#line 1 "library/my_template.hpp"
#if defined(LOCAL)
#include <my_template_compiled.hpp>
#else
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using u32 = unsigned int;
using u64 = unsigned long long;
using i128 = __int128;
template <class T>
constexpr T infty = 0;
template <>
constexpr int infty<int> = 1'000'000'000;
template <>
constexpr ll infty<ll> = ll(infty<int>) * infty<int> * 2;
template <>
constexpr u32 infty<u32> = infty<int>;
template <>
constexpr u64 infty<u64> = infty<ll>;
template <>
constexpr i128 infty<i128> = i128(infty<ll>) * infty<ll>;
template <>
constexpr double infty<double> = infty<ll>;
template <>
constexpr long double infty<long double> = infty<ll>;
using pi = pair<ll, ll>;
using vi = vector<ll>;
template <class T>
using vc = vector<T>;
template <class T>
using vvc = vector<vc<T>>;
template <class T>
using vvvc = vector<vvc<T>>;
template <class T>
using vvvvc = vector<vvvc<T>>;
template <class T>
using vvvvvc = vector<vvvvc<T>>;
template <class T>
using pq = priority_queue<T>;
template <class T>
using pqg = priority_queue<T, vector<T>, greater<T>>;
#define vv(type, name, h, ...) \
vector<vector<type>> name(h, vector<type>(__VA_ARGS__))
#define vvv(type, name, h, w, ...) \
vector<vector<vector<type>>> name( \
h, vector<vector<type>>(w, vector<type>(__VA_ARGS__)))
#define vvvv(type, name, a, b, c, ...) \
vector<vector<vector<vector<type>>>> name( \
a, vector<vector<vector<type>>>( \
b, vector<vector<type>>(c, vector<type>(__VA_ARGS__))))
// https://trap.jp/post/1224/
#define FOR1(a) for (ll _ = 0; _ < ll(a); ++_)
#define FOR2(i, a) for (ll i = 0; i < ll(a); ++i)
#define FOR3(i, a, b) for (ll i = a; i < ll(b); ++i)
#define FOR4(i, a, b, c) for (ll i = a; i < ll(b); i += (c))
#define FOR1_R(a) for (ll i = (a)-1; i >= ll(0); --i)
#define FOR2_R(i, a) for (ll i = (a)-1; i >= ll(0); --i)
#define FOR3_R(i, a, b) for (ll i = (b)-1; i >= ll(a); --i)
#define overload4(a, b, c, d, e, ...) e
#define overload3(a, b, c, d, ...) d
#define FOR(...) overload4(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)(__VA_ARGS__)
#define FOR_R(...) overload3(__VA_ARGS__, FOR3_R, FOR2_R, FOR1_R)(__VA_ARGS__)
#define FOR_subset(t, s) \
for (ll t = (s); t >= 0; t = (t == 0 ? -1 : (t - 1) & (s)))
#define all(x) x.begin(), x.end()
#define len(x) ll(x.size())
#define elif else if
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define stoi stoll
int popcnt(int x) { return __builtin_popcount(x); }
int popcnt(u32 x) { return __builtin_popcount(x); }
int popcnt(ll x) { return __builtin_popcountll(x); }
int popcnt(u64 x) { return __builtin_popcountll(x); }
// (0, 1, 2, 3, 4) -> (-1, 0, 1, 1, 2)
int topbit(int x) { return (x == 0 ? -1 : 31 - __builtin_clz(x)); }
int topbit(u32 x) { return (x == 0 ? -1 : 31 - __builtin_clz(x)); }
int topbit(ll x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); }
int topbit(u64 x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); }
// (0, 1, 2, 3, 4) -> (-1, 0, 1, 0, 2)
int lowbit(int x) { return (x == 0 ? -1 : __builtin_ctz(x)); }
int lowbit(u32 x) { return (x == 0 ? -1 : __builtin_ctz(x)); }
int lowbit(ll x) { return (x == 0 ? -1 : __builtin_ctzll(x)); }
int lowbit(u64 x) { return (x == 0 ? -1 : __builtin_ctzll(x)); }
template <typename T, typename U>
T ceil(T x, U y) {
return (x > 0 ? (x + y - 1) / y : x / y);
}
template <typename T, typename U>
T floor(T x, U y) {
return (x > 0 ? x / y : (x - y + 1) / y);
}
template <typename T, typename U>
pair<T, T> divmod(T x, U y) {
T q = floor(x, y);
return {q, x - q * y};
}
template <typename T, typename U>
T SUM(const vector<U> &A) {
T sum = 0;
for (auto &&a: A) sum += a;
return sum;
}
#define MIN(v) *min_element(all(v))
#define MAX(v) *max_element(all(v))
#define LB(c, x) distance((c).begin(), lower_bound(all(c), (x)))
#define UB(c, x) distance((c).begin(), upper_bound(all(c), (x)))
#define UNIQUE(x) \
sort(all(x)), x.erase(unique(all(x)), x.end()), x.shrink_to_fit()
template <typename T>
T POP(deque<T> &que) {
T a = que.front();
que.pop_front();
return a;
}
template <typename T>
T POP(pq<T> &que) {
T a = que.top();
que.pop();
return a;
}
template <typename T>
T POP(pqg<T> &que) {
assert(!que.empty());
T a = que.top();
que.pop();
return a;
}
template <typename T>
T POP(vc<T> &que) {
assert(!que.empty());
T a = que.back();
que.pop_back();
return a;
}
template <typename F>
ll binary_search(F check, ll ok, ll ng) {
assert(check(ok));
while (abs(ok - ng) > 1) {
auto x = (ng + ok) / 2;
tie(ok, ng) = (check(x) ? mp(x, ng) : mp(ok, x));
}
return ok;
}
template <typename F>
double binary_search_real(F check, double ok, double ng, int iter = 100) {
FOR(iter) {
double x = (ok + ng) / 2;
tie(ok, ng) = (check(x) ? mp(x, ng) : mp(ok, x));
}
return (ok + ng) / 2;
}
template <class T, class S>
inline bool chmax(T &a, const S &b) {
return (a < b ? a = b, 1 : 0);
}
template <class T, class S>
inline bool chmin(T &a, const S &b) {
return (a > b ? a = b, 1 : 0);
}
// ? は -1
vc<int> s_to_vi(const string &S, char first_char) {
vc<int> A(S.size());
FOR(i, S.size()) { A[i] = (S[i] != '?' ? S[i] - first_char : -1); }
return A;
}
template <typename T, typename U>
vector<T> cumsum(vector<U> &A, int off = 1) {
int N = A.size();
vector<T> B(N + 1);
FOR(i, N) { B[i + 1] = B[i] + A[i]; }
if (off == 0) B.erase(B.begin());
return B;
}
// stable sort
template <typename T>
vector<int> argsort(const vector<T> &A) {
vector<int> ids(len(A));
iota(all(ids), 0);
sort(all(ids),
[&](int i, int j) { return (A[i] == A[j] ? i < j : A[i] < A[j]); });
return ids;
}
// A[I[0]], A[I[1]], ...
template <typename T>
vc<T> rearrange(const vc<T> &A, const vc<int> &I) {
vc<T> B(len(I));
FOR(i, len(I)) B[i] = A[I[i]];
return B;
}
#endif
#line 1 "library/other/io.hpp"
// based on yosupo's fastio
#include <unistd.h>
namespace fastio {
#define FASTIO
// クラスが read(), print() を持っているかを判定するメタ関数
struct has_write_impl {
template <class T>
static auto check(T &&x) -> decltype(x.write(), std::true_type{});
template <class T>
static auto check(...) -> std::false_type;
};
template <class T>
class has_write : public decltype(has_write_impl::check<T>(std::declval<T>())) {
};
struct has_read_impl {
template <class T>
static auto check(T &&x) -> decltype(x.read(), std::true_type{});
template <class T>
static auto check(...) -> std::false_type;
};
template <class T>
class has_read : public decltype(has_read_impl::check<T>(std::declval<T>())) {};
struct Scanner {
FILE *fp;
char line[(1 << 15) + 1];
size_t st = 0, ed = 0;
void reread() {
memmove(line, line + st, ed - st);
ed -= st;
st = 0;
ed += fread(line + ed, 1, (1 << 15) - ed, fp);
line[ed] = '\0';
}
bool succ() {
while (true) {
if (st == ed) {
reread();
if (st == ed) return false;
}
while (st != ed && isspace(line[st])) st++;
if (st != ed) break;
}
if (ed - st <= 50) {
bool sep = false;
for (size_t i = st; i < ed; i++) {
if (isspace(line[i])) {
sep = true;
break;
}
}
if (!sep) reread();
}
return true;
}
template <class T, enable_if_t<is_same<T, string>::value, int> = 0>
bool read_single(T &ref) {
if (!succ()) return false;
while (true) {
size_t sz = 0;
while (st + sz < ed && !isspace(line[st + sz])) sz++;
ref.append(line + st, sz);
st += sz;
if (!sz || st != ed) break;
reread();
}
return true;
}
template <class T, enable_if_t<is_integral<T>::value, int> = 0>
bool read_single(T &ref) {
if (!succ()) return false;
bool neg = false;
if (line[st] == '-') {
neg = true;
st++;
}
ref = T(0);
while (isdigit(line[st])) { ref = 10 * ref + (line[st++] & 0xf); }
if (neg) ref = -ref;
return true;
}
template <typename T,
typename enable_if<has_read<T>::value>::type * = nullptr>
inline bool read_single(T &x) {
x.read();
return true;
}
bool read_single(double &ref) {
string s;
if (!read_single(s)) return false;
ref = std::stod(s);
return true;
}
bool read_single(char &ref) {
string s;
if (!read_single(s) || s.size() != 1) return false;
ref = s[0];
return true;
}
template <class T>
bool read_single(vector<T> &ref) {
for (auto &d: ref) {
if (!read_single(d)) return false;
}
return true;
}
template <class T, class U>
bool read_single(pair<T, U> &p) {
return (read_single(p.first) && read_single(p.second));
}
template <size_t N = 0, typename T>
void read_single_tuple(T &t) {
if constexpr (N < std::tuple_size<T>::value) {
auto &x = std::get<N>(t);
read_single(x);
read_single_tuple<N + 1>(t);
}
}
template <class... T>
bool read_single(tuple<T...> &tpl) {
read_single_tuple(tpl);
return true;
}
void read() {}
template <class H, class... T>
void read(H &h, T &... t) {
bool f = read_single(h);
assert(f);
read(t...);
}
Scanner(FILE *fp) : fp(fp) {}
};
struct Printer {
Printer(FILE *_fp) : fp(_fp) {}
~Printer() { flush(); }
static constexpr size_t SIZE = 1 << 15;
FILE *fp;
char line[SIZE], small[50];
size_t pos = 0;
void flush() {
fwrite(line, 1, pos, fp);
pos = 0;
}
void write(const char val) {
if (pos == SIZE) flush();
line[pos++] = val;
}
template <class T, enable_if_t<is_integral<T>::value, int> = 0>
void write(T val) {
if (pos > (1 << 15) - 50) flush();
if (val == 0) {
write('0');
return;
}
if (val < 0) {
write('-');
val = -val; // todo min
}
size_t len = 0;
while (val) {
small[len++] = char(0x30 | (val % 10));
val /= 10;
}
for (size_t i = 0; i < len; i++) { line[pos + i] = small[len - 1 - i]; }
pos += len;
}
void write(const string s) {
for (char c: s) write(c);
}
void write(const char *s) {
size_t len = strlen(s);
for (size_t i = 0; i < len; i++) write(s[i]);
}
void write(const double x) {
ostringstream oss;
oss << fixed << setprecision(15) << x;
string s = oss.str();
write(s);
}
void write(const long double x) {
ostringstream oss;
oss << fixed << setprecision(15) << x;
string s = oss.str();
write(s);
}
template <typename T,
typename enable_if<has_write<T>::value>::type * = nullptr>
inline void write(T x) {
x.write();
}
template <class T>
void write(const vector<T> val) {
auto n = val.size();
for (size_t i = 0; i < n; i++) {
if (i) write(' ');
write(val[i]);
}
}
template <class T, class U>
void write(const pair<T, U> val) {
write(val.first);
write(' ');
write(val.second);
}
template <size_t N = 0, typename T>
void write_tuple(const T t) {
if constexpr (N < std::tuple_size<T>::value) {
if constexpr (N > 0) { write(' '); }
const auto x = std::get<N>(t);
write(x);
write_tuple<N + 1>(t);
}
}
template <class... T>
bool write(tuple<T...> tpl) {
write_tuple(tpl);
return true;
}
template <class T, size_t S>
void write(const array<T, S> val) {
auto n = val.size();
for (size_t i = 0; i < n; i++) {
if (i) write(' ');
write(val[i]);
}
}
void write(i128 val) {
string s;
bool negative = 0;
if (val < 0) {
negative = 1;
val = -val;
}
while (val) {
s += '0' + int(val % 10);
val /= 10;
}
if (negative) s += "-";
reverse(all(s));
if (len(s) == 0) s = "0";
write(s);
}
};
Scanner scanner = Scanner(stdin);
Printer printer = Printer(stdout);
void flush() { printer.flush(); }
void print() { printer.write('\n'); }
template <class Head, class... Tail>
void print(Head &&head, Tail &&... tail) {
printer.write(head);
if (sizeof...(Tail)) printer.write(' ');
print(forward<Tail>(tail)...);
}
void read() {}
template <class Head, class... Tail>
void read(Head &head, Tail &... tail) {
scanner.read(head);
read(tail...);
}
} // namespace fastio
using fastio::print;
using fastio::flush;
using fastio::read;
#define INT(...) \
int __VA_ARGS__; \
read(__VA_ARGS__)
#define LL(...) \
ll __VA_ARGS__; \
read(__VA_ARGS__)
#define STR(...) \
string __VA_ARGS__; \
read(__VA_ARGS__)
#define CHAR(...) \
char __VA_ARGS__; \
read(__VA_ARGS__)
#define DBL(...) \
double __VA_ARGS__; \
read(__VA_ARGS__)
#define VEC(type, name, size) \
vector<type> name(size); \
read(name)
#define VV(type, name, h, w) \
vector<vector<type>> name(h, vector<type>(w)); \
read(name)
void YES(bool t = 1) { print(t ? "YES" : "NO"); }
void NO(bool t = 1) { YES(!t); }
void Yes(bool t = 1) { print(t ? "Yes" : "No"); }
void No(bool t = 1) { Yes(!t); }
void yes(bool t = 1) { print(t ? "yes" : "no"); }
void no(bool t = 1) { yes(!t); }
#line 2 "library/ds/unionfind/unionfind.hpp"
struct UnionFind {
int n, n_comp;
vc<int> dat; // par or (-size)
UnionFind(int n = 0) { build(n); }
void build(int m) {
n = m, n_comp = m;
dat.assign(n, -1);
}
int operator[](int x) {
while (dat[x] >= 0) {
int pp = dat[dat[x]];
if (pp < 0) { return dat[x]; }
x = dat[x] = pp;
}
return x;
}
ll size(int x) {
assert(dat[x] < 0);
return -dat[x];
}
bool merge(int x, int y) {
x = (*this)[x], y = (*this)[y];
if (x == y) return false;
if (-dat[x] < -dat[y]) swap(x, y);
dat[x] += dat[y], dat[y] = x, n_comp--;
return true;
}
};
#line 4 "main.cpp"
void solve() {
LL(N);
vc<pi> ANS;
auto check = [&](vc<pi> ANS) -> void {
vv(bool, use, N, N);
for (auto&& [a, b]: ANS) {
assert(a != b);
use[a][b] = use[b][a] = 1;
}
assert(len(ANS) == N * (N - 1) / 2);
FOR(i, N) FOR(j, i) assert(use[i][j]);
FOR(p, len(ANS)) {
UnionFind uf(N);
int e = p;
FOR(N - 1) {
auto [a, b] = ANS[e];
assert(uf.merge(a, b));
++e;
if (e == len(ANS)) e = 0;
}
}
};
if (N % 2 == 1) {
FOR(i, N) {
int x = i, y = i;
FOR((N - 1) / 2) {
--x, ++y;
if (x == -1) x = N - 1;
if (y == N) y = 0;
ANS.eb(x, y);
}
}
}
if (N % 2 == 0) {
FOR(i, N - 1) {
int x = i, y = i;
ANS.eb(i, N - 1);
FOR((N - 2) / 2) {
--x, ++y;
if (x == -1) x = N - 2;
if (y == N - 1) y = 0;
ANS.eb(x, y);
}
}
}
check(ANS);
for (auto&& [a, b]: ANS) {
if (a > b) swap(a, b);
print(1 + a, 1 + b);
}
}
signed main() {
solve();
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 2ms
memory: 3408kb
input:
3
output:
2 3 1 3 1 2
result:
ok Correct
Test #2:
score: 0
Accepted
time: 2ms
memory: 3404kb
input:
4
output:
1 4 2 3 2 4 1 3 3 4 1 2
result:
ok Correct
Test #3:
score: 0
Accepted
time: 1ms
memory: 3412kb
input:
5
output:
2 5 3 4 1 3 4 5 2 4 1 5 3 5 1 2 1 4 2 3
result:
ok Correct
Test #4:
score: 0
Accepted
time: 2ms
memory: 3476kb
input:
6
output:
1 6 2 5 3 4 2 6 1 3 4 5 3 6 2 4 1 5 4 6 3 5 1 2 5 6 1 4 2 3
result:
ok Correct
Test #5:
score: 0
Accepted
time: 2ms
memory: 3420kb
input:
7
output:
2 7 3 6 4 5 1 3 4 7 5 6 2 4 1 5 6 7 3 5 2 6 1 7 4 6 3 7 1 2 5 7 1 4 2 3 1 6 2 5 3 4
result:
ok Correct
Test #6:
score: 0
Accepted
time: 0ms
memory: 3416kb
input:
8
output:
1 8 2 7 3 6 4 5 2 8 1 3 4 7 5 6 3 8 2 4 1 5 6 7 4 8 3 5 2 6 1 7 5 8 4 6 3 7 1 2 6 8 5 7 1 4 2 3 7 8 1 6 2 5 3 4
result:
ok Correct
Test #7:
score: 0
Accepted
time: 2ms
memory: 3512kb
input:
9
output:
2 9 3 8 4 7 5 6 1 3 4 9 5 8 6 7 2 4 1 5 6 9 7 8 3 5 2 6 1 7 8 9 4 6 3 7 2 8 1 9 5 7 4 8 3 9 1 2 6 8 5 9 1 4 2 3 7 9 1 6 2 5 3 4 1 8 2 7 3 6 4 5
result:
ok Correct
Test #8:
score: 0
Accepted
time: 1ms
memory: 3476kb
input:
10
output:
1 10 2 9 3 8 4 7 5 6 2 10 1 3 4 9 5 8 6 7 3 10 2 4 1 5 6 9 7 8 4 10 3 5 2 6 1 7 8 9 5 10 4 6 3 7 2 8 1 9 6 10 5 7 4 8 3 9 1 2 7 10 6 8 5 9 1 4 2 3 8 10 7 9 1 6 2 5 3 4 9 10 1 8 2 7 3 6 4 5
result:
ok Correct
Test #9:
score: 0
Accepted
time: 2ms
memory: 3464kb
input:
11
output:
2 11 3 10 4 9 5 8 6 7 1 3 4 11 5 10 6 9 7 8 2 4 1 5 6 11 7 10 8 9 3 5 2 6 1 7 8 11 9 10 4 6 3 7 2 8 1 9 10 11 5 7 4 8 3 9 2 10 1 11 6 8 5 9 4 10 3 11 1 2 7 9 6 10 5 11 1 4 2 3 8 10 7 11 1 6 2 5 3 4 9 11 1 8 2 7 3 6 4 5 1 10 2 9 3 8 4 7 5 6
result:
ok Correct
Test #10:
score: 0
Accepted
time: 2ms
memory: 3476kb
input:
12
output:
1 12 2 11 3 10 4 9 5 8 6 7 2 12 1 3 4 11 5 10 6 9 7 8 3 12 2 4 1 5 6 11 7 10 8 9 4 12 3 5 2 6 1 7 8 11 9 10 5 12 4 6 3 7 2 8 1 9 10 11 6 12 5 7 4 8 3 9 2 10 1 11 7 12 6 8 5 9 4 10 3 11 1 2 8 12 7 9 6 10 5 11 1 4 2 3 9 12 8 10 7 11 1 6 2 5 3 4 10 12 9 11 1 8 2 7 3 6 4 5 11 12 1 10 2 9 3 8 4 7 5 6
result:
ok Correct
Test #11:
score: 0
Accepted
time: 2ms
memory: 3484kb
input:
13
output:
2 13 3 12 4 11 5 10 6 9 7 8 1 3 4 13 5 12 6 11 7 10 8 9 2 4 1 5 6 13 7 12 8 11 9 10 3 5 2 6 1 7 8 13 9 12 10 11 4 6 3 7 2 8 1 9 10 13 11 12 5 7 4 8 3 9 2 10 1 11 12 13 6 8 5 9 4 10 3 11 2 12 1 13 7 9 6 10 5 11 4 12 3 13 1 2 8 10 7 11 6 12 5 13 1 4 2 3 9 11 8 12 7 13 1 6 2 5 3 4 10 12 9 13 1 8 2 7 3 ...
result:
ok Correct
Test #12:
score: 0
Accepted
time: 1ms
memory: 3452kb
input:
14
output:
1 14 2 13 3 12 4 11 5 10 6 9 7 8 2 14 1 3 4 13 5 12 6 11 7 10 8 9 3 14 2 4 1 5 6 13 7 12 8 11 9 10 4 14 3 5 2 6 1 7 8 13 9 12 10 11 5 14 4 6 3 7 2 8 1 9 10 13 11 12 6 14 5 7 4 8 3 9 2 10 1 11 12 13 7 14 6 8 5 9 4 10 3 11 2 12 1 13 8 14 7 9 6 10 5 11 4 12 3 13 1 2 9 14 8 10 7 11 6 12 5 13 1 4 2 3 10 ...
result:
ok Correct
Test #13:
score: 0
Accepted
time: 1ms
memory: 3408kb
input:
15
output:
2 15 3 14 4 13 5 12 6 11 7 10 8 9 1 3 4 15 5 14 6 13 7 12 8 11 9 10 2 4 1 5 6 15 7 14 8 13 9 12 10 11 3 5 2 6 1 7 8 15 9 14 10 13 11 12 4 6 3 7 2 8 1 9 10 15 11 14 12 13 5 7 4 8 3 9 2 10 1 11 12 15 13 14 6 8 5 9 4 10 3 11 2 12 1 13 14 15 7 9 6 10 5 11 4 12 3 13 2 14 1 15 8 10 7 11 6 12 5 13 4 14 3 1...
result:
ok Correct
Test #14:
score: 0
Accepted
time: 2ms
memory: 3520kb
input:
16
output:
1 16 2 15 3 14 4 13 5 12 6 11 7 10 8 9 2 16 1 3 4 15 5 14 6 13 7 12 8 11 9 10 3 16 2 4 1 5 6 15 7 14 8 13 9 12 10 11 4 16 3 5 2 6 1 7 8 15 9 14 10 13 11 12 5 16 4 6 3 7 2 8 1 9 10 15 11 14 12 13 6 16 5 7 4 8 3 9 2 10 1 11 12 15 13 14 7 16 6 8 5 9 4 10 3 11 2 12 1 13 14 15 8 16 7 9 6 10 5 11 4 12 3 1...
result:
ok Correct
Test #15:
score: 0
Accepted
time: 0ms
memory: 3492kb
input:
17
output:
2 17 3 16 4 15 5 14 6 13 7 12 8 11 9 10 1 3 4 17 5 16 6 15 7 14 8 13 9 12 10 11 2 4 1 5 6 17 7 16 8 15 9 14 10 13 11 12 3 5 2 6 1 7 8 17 9 16 10 15 11 14 12 13 4 6 3 7 2 8 1 9 10 17 11 16 12 15 13 14 5 7 4 8 3 9 2 10 1 11 12 17 13 16 14 15 6 8 5 9 4 10 3 11 2 12 1 13 14 17 15 16 7 9 6 10 5 11 4 12 3...
result:
ok Correct
Test #16:
score: 0
Accepted
time: 0ms
memory: 3452kb
input:
18
output:
1 18 2 17 3 16 4 15 5 14 6 13 7 12 8 11 9 10 2 18 1 3 4 17 5 16 6 15 7 14 8 13 9 12 10 11 3 18 2 4 1 5 6 17 7 16 8 15 9 14 10 13 11 12 4 18 3 5 2 6 1 7 8 17 9 16 10 15 11 14 12 13 5 18 4 6 3 7 2 8 1 9 10 17 11 16 12 15 13 14 6 18 5 7 4 8 3 9 2 10 1 11 12 17 13 16 14 15 7 18 6 8 5 9 4 10 3 11 2 12 1 ...
result:
ok Correct
Test #17:
score: 0
Accepted
time: 2ms
memory: 3496kb
input:
19
output:
2 19 3 18 4 17 5 16 6 15 7 14 8 13 9 12 10 11 1 3 4 19 5 18 6 17 7 16 8 15 9 14 10 13 11 12 2 4 1 5 6 19 7 18 8 17 9 16 10 15 11 14 12 13 3 5 2 6 1 7 8 19 9 18 10 17 11 16 12 15 13 14 4 6 3 7 2 8 1 9 10 19 11 18 12 17 13 16 14 15 5 7 4 8 3 9 2 10 1 11 12 19 13 18 14 17 15 16 6 8 5 9 4 10 3 11 2 12 1...
result:
ok Correct
Test #18:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
20
output:
1 20 2 19 3 18 4 17 5 16 6 15 7 14 8 13 9 12 10 11 2 20 1 3 4 19 5 18 6 17 7 16 8 15 9 14 10 13 11 12 3 20 2 4 1 5 6 19 7 18 8 17 9 16 10 15 11 14 12 13 4 20 3 5 2 6 1 7 8 19 9 18 10 17 11 16 12 15 13 14 5 20 4 6 3 7 2 8 1 9 10 19 11 18 12 17 13 16 14 15 6 20 5 7 4 8 3 9 2 10 1 11 12 19 13 18 14 17 ...
result:
ok Correct
Test #19:
score: 0
Accepted
time: 2ms
memory: 3416kb
input:
21
output:
2 21 3 20 4 19 5 18 6 17 7 16 8 15 9 14 10 13 11 12 1 3 4 21 5 20 6 19 7 18 8 17 9 16 10 15 11 14 12 13 2 4 1 5 6 21 7 20 8 19 9 18 10 17 11 16 12 15 13 14 3 5 2 6 1 7 8 21 9 20 10 19 11 18 12 17 13 16 14 15 4 6 3 7 2 8 1 9 10 21 11 20 12 19 13 18 14 17 15 16 5 7 4 8 3 9 2 10 1 11 12 21 13 20 14 19 ...
result:
ok Correct
Test #20:
score: 0
Accepted
time: 2ms
memory: 3492kb
input:
22
output:
1 22 2 21 3 20 4 19 5 18 6 17 7 16 8 15 9 14 10 13 11 12 2 22 1 3 4 21 5 20 6 19 7 18 8 17 9 16 10 15 11 14 12 13 3 22 2 4 1 5 6 21 7 20 8 19 9 18 10 17 11 16 12 15 13 14 4 22 3 5 2 6 1 7 8 21 9 20 10 19 11 18 12 17 13 16 14 15 5 22 4 6 3 7 2 8 1 9 10 21 11 20 12 19 13 18 14 17 15 16 6 22 5 7 4 8 3 ...
result:
ok Correct
Test #21:
score: 0
Accepted
time: 2ms
memory: 3476kb
input:
23
output:
2 23 3 22 4 21 5 20 6 19 7 18 8 17 9 16 10 15 11 14 12 13 1 3 4 23 5 22 6 21 7 20 8 19 9 18 10 17 11 16 12 15 13 14 2 4 1 5 6 23 7 22 8 21 9 20 10 19 11 18 12 17 13 16 14 15 3 5 2 6 1 7 8 23 9 22 10 21 11 20 12 19 13 18 14 17 15 16 4 6 3 7 2 8 1 9 10 23 11 22 12 21 13 20 14 19 15 18 16 17 5 7 4 8 3 ...
result:
ok Correct
Test #22:
score: 0
Accepted
time: 2ms
memory: 3432kb
input:
24
output:
1 24 2 23 3 22 4 21 5 20 6 19 7 18 8 17 9 16 10 15 11 14 12 13 2 24 1 3 4 23 5 22 6 21 7 20 8 19 9 18 10 17 11 16 12 15 13 14 3 24 2 4 1 5 6 23 7 22 8 21 9 20 10 19 11 18 12 17 13 16 14 15 4 24 3 5 2 6 1 7 8 23 9 22 10 21 11 20 12 19 13 18 14 17 15 16 5 24 4 6 3 7 2 8 1 9 10 23 11 22 12 21 13 20 14 ...
result:
ok Correct
Test #23:
score: 0
Accepted
time: 0ms
memory: 3416kb
input:
25
output:
2 25 3 24 4 23 5 22 6 21 7 20 8 19 9 18 10 17 11 16 12 15 13 14 1 3 4 25 5 24 6 23 7 22 8 21 9 20 10 19 11 18 12 17 13 16 14 15 2 4 1 5 6 25 7 24 8 23 9 22 10 21 11 20 12 19 13 18 14 17 15 16 3 5 2 6 1 7 8 25 9 24 10 23 11 22 12 21 13 20 14 19 15 18 16 17 4 6 3 7 2 8 1 9 10 25 11 24 12 23 13 22 14 2...
result:
ok Correct
Test #24:
score: 0
Accepted
time: 2ms
memory: 3452kb
input:
26
output:
1 26 2 25 3 24 4 23 5 22 6 21 7 20 8 19 9 18 10 17 11 16 12 15 13 14 2 26 1 3 4 25 5 24 6 23 7 22 8 21 9 20 10 19 11 18 12 17 13 16 14 15 3 26 2 4 1 5 6 25 7 24 8 23 9 22 10 21 11 20 12 19 13 18 14 17 15 16 4 26 3 5 2 6 1 7 8 25 9 24 10 23 11 22 12 21 13 20 14 19 15 18 16 17 5 26 4 6 3 7 2 8 1 9 10 ...
result:
ok Correct
Test #25:
score: 0
Accepted
time: 2ms
memory: 3488kb
input:
27
output:
2 27 3 26 4 25 5 24 6 23 7 22 8 21 9 20 10 19 11 18 12 17 13 16 14 15 1 3 4 27 5 26 6 25 7 24 8 23 9 22 10 21 11 20 12 19 13 18 14 17 15 16 2 4 1 5 6 27 7 26 8 25 9 24 10 23 11 22 12 21 13 20 14 19 15 18 16 17 3 5 2 6 1 7 8 27 9 26 10 25 11 24 12 23 13 22 14 21 15 20 16 19 17 18 4 6 3 7 2 8 1 9 10 2...
result:
ok Correct
Test #26:
score: 0
Accepted
time: 2ms
memory: 3428kb
input:
28
output:
1 28 2 27 3 26 4 25 5 24 6 23 7 22 8 21 9 20 10 19 11 18 12 17 13 16 14 15 2 28 1 3 4 27 5 26 6 25 7 24 8 23 9 22 10 21 11 20 12 19 13 18 14 17 15 16 3 28 2 4 1 5 6 27 7 26 8 25 9 24 10 23 11 22 12 21 13 20 14 19 15 18 16 17 4 28 3 5 2 6 1 7 8 27 9 26 10 25 11 24 12 23 13 22 14 21 15 20 16 19 17 18 ...
result:
ok Correct
Test #27:
score: 0
Accepted
time: 2ms
memory: 3592kb
input:
29
output:
2 29 3 28 4 27 5 26 6 25 7 24 8 23 9 22 10 21 11 20 12 19 13 18 14 17 15 16 1 3 4 29 5 28 6 27 7 26 8 25 9 24 10 23 11 22 12 21 13 20 14 19 15 18 16 17 2 4 1 5 6 29 7 28 8 27 9 26 10 25 11 24 12 23 13 22 14 21 15 20 16 19 17 18 3 5 2 6 1 7 8 29 9 28 10 27 11 26 12 25 13 24 14 23 15 22 16 21 17 20 18...
result:
ok Correct
Test #28:
score: 0
Accepted
time: 2ms
memory: 3492kb
input:
30
output:
1 30 2 29 3 28 4 27 5 26 6 25 7 24 8 23 9 22 10 21 11 20 12 19 13 18 14 17 15 16 2 30 1 3 4 29 5 28 6 27 7 26 8 25 9 24 10 23 11 22 12 21 13 20 14 19 15 18 16 17 3 30 2 4 1 5 6 29 7 28 8 27 9 26 10 25 11 24 12 23 13 22 14 21 15 20 16 19 17 18 4 30 3 5 2 6 1 7 8 29 9 28 10 27 11 26 12 25 13 24 14 23 ...
result:
ok Correct
Test #29:
score: 0
Accepted
time: 3ms
memory: 3560kb
input:
90
output:
1 90 2 89 3 88 4 87 5 86 6 85 7 84 8 83 9 82 10 81 11 80 12 79 13 78 14 77 15 76 16 75 17 74 18 73 19 72 20 71 21 70 22 69 23 68 24 67 25 66 26 65 27 64 28 63 29 62 30 61 31 60 32 59 33 58 34 57 35 56 36 55 37 54 38 53 39 52 40 51 41 50 42 49 43 48 44 47 45 46 2 90 1 3 4 89 5 88 6 87 7 86 8 85 9 84 ...
result:
ok Correct
Test #30:
score: 0
Accepted
time: 3ms
memory: 3660kb
input:
91
output:
2 91 3 90 4 89 5 88 6 87 7 86 8 85 9 84 10 83 11 82 12 81 13 80 14 79 15 78 16 77 17 76 18 75 19 74 20 73 21 72 22 71 23 70 24 69 25 68 26 67 27 66 28 65 29 64 30 63 31 62 32 61 33 60 34 59 35 58 36 57 37 56 38 55 39 54 40 53 41 52 42 51 43 50 44 49 45 48 46 47 1 3 4 91 5 90 6 89 7 88 8 87 9 86 10 8...
result:
ok Correct
Test #31:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
92
output:
1 92 2 91 3 90 4 89 5 88 6 87 7 86 8 85 9 84 10 83 11 82 12 81 13 80 14 79 15 78 16 77 17 76 18 75 19 74 20 73 21 72 22 71 23 70 24 69 25 68 26 67 27 66 28 65 29 64 30 63 31 62 32 61 33 60 34 59 35 58 36 57 37 56 38 55 39 54 40 53 41 52 42 51 43 50 44 49 45 48 46 47 2 92 1 3 4 91 5 90 6 89 7 88 8 87...
result:
ok Correct
Test #32:
score: 0
Accepted
time: 4ms
memory: 3592kb
input:
93
output:
2 93 3 92 4 91 5 90 6 89 7 88 8 87 9 86 10 85 11 84 12 83 13 82 14 81 15 80 16 79 17 78 18 77 19 76 20 75 21 74 22 73 23 72 24 71 25 70 26 69 27 68 28 67 29 66 30 65 31 64 32 63 33 62 34 61 35 60 36 59 37 58 38 57 39 56 40 55 41 54 42 53 43 52 44 51 45 50 46 49 47 48 1 3 4 93 5 92 6 91 7 90 8 89 9 8...
result:
ok Correct
Test #33:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
94
output:
1 94 2 93 3 92 4 91 5 90 6 89 7 88 8 87 9 86 10 85 11 84 12 83 13 82 14 81 15 80 16 79 17 78 18 77 19 76 20 75 21 74 22 73 23 72 24 71 25 70 26 69 27 68 28 67 29 66 30 65 31 64 32 63 33 62 34 61 35 60 36 59 37 58 38 57 39 56 40 55 41 54 42 53 43 52 44 51 45 50 46 49 47 48 2 94 1 3 4 93 5 92 6 91 7 9...
result:
ok Correct
Test #34:
score: 0
Accepted
time: 4ms
memory: 3720kb
input:
95
output:
2 95 3 94 4 93 5 92 6 91 7 90 8 89 9 88 10 87 11 86 12 85 13 84 14 83 15 82 16 81 17 80 18 79 19 78 20 77 21 76 22 75 23 74 24 73 25 72 26 71 27 70 28 69 29 68 30 67 31 66 32 65 33 64 34 63 35 62 36 61 37 60 38 59 39 58 40 57 41 56 42 55 43 54 44 53 45 52 46 51 47 50 48 49 1 3 4 95 5 94 6 93 7 92 8 ...
result:
ok Correct
Test #35:
score: 0
Accepted
time: 4ms
memory: 3656kb
input:
96
output:
1 96 2 95 3 94 4 93 5 92 6 91 7 90 8 89 9 88 10 87 11 86 12 85 13 84 14 83 15 82 16 81 17 80 18 79 19 78 20 77 21 76 22 75 23 74 24 73 25 72 26 71 27 70 28 69 29 68 30 67 31 66 32 65 33 64 34 63 35 62 36 61 37 60 38 59 39 58 40 57 41 56 42 55 43 54 44 53 45 52 46 51 47 50 48 49 2 96 1 3 4 95 5 94 6 ...
result:
ok Correct
Test #36:
score: 0
Accepted
time: 4ms
memory: 3620kb
input:
97
output:
2 97 3 96 4 95 5 94 6 93 7 92 8 91 9 90 10 89 11 88 12 87 13 86 14 85 15 84 16 83 17 82 18 81 19 80 20 79 21 78 22 77 23 76 24 75 25 74 26 73 27 72 28 71 29 70 30 69 31 68 32 67 33 66 34 65 35 64 36 63 37 62 38 61 39 60 40 59 41 58 42 57 43 56 44 55 45 54 46 53 47 52 48 51 49 50 1 3 4 97 5 96 6 95 7...
result:
ok Correct
Test #37:
score: 0
Accepted
time: 4ms
memory: 3608kb
input:
98
output:
1 98 2 97 3 96 4 95 5 94 6 93 7 92 8 91 9 90 10 89 11 88 12 87 13 86 14 85 15 84 16 83 17 82 18 81 19 80 20 79 21 78 22 77 23 76 24 75 25 74 26 73 27 72 28 71 29 70 30 69 31 68 32 67 33 66 34 65 35 64 36 63 37 62 38 61 39 60 40 59 41 58 42 57 43 56 44 55 45 54 46 53 47 52 48 51 49 50 2 98 1 3 4 97 5...
result:
ok Correct
Test #38:
score: 0
Accepted
time: 4ms
memory: 3620kb
input:
99
output:
2 99 3 98 4 97 5 96 6 95 7 94 8 93 9 92 10 91 11 90 12 89 13 88 14 87 15 86 16 85 17 84 18 83 19 82 20 81 21 80 22 79 23 78 24 77 25 76 26 75 27 74 28 73 29 72 30 71 31 70 32 69 33 68 34 67 35 66 36 65 37 64 38 63 39 62 40 61 41 60 42 59 43 58 44 57 45 56 46 55 47 54 48 53 49 52 50 51 1 3 4 99 5 98 ...
result:
ok Correct
Test #39:
score: 0
Accepted
time: 4ms
memory: 3624kb
input:
100
output:
1 100 2 99 3 98 4 97 5 96 6 95 7 94 8 93 9 92 10 91 11 90 12 89 13 88 14 87 15 86 16 85 17 84 18 83 19 82 20 81 21 80 22 79 23 78 24 77 25 76 26 75 27 74 28 73 29 72 30 71 31 70 32 69 33 68 34 67 35 66 36 65 37 64 38 63 39 62 40 61 41 60 42 59 43 58 44 57 45 56 46 55 47 54 48 53 49 52 50 51 2 100 1 ...
result:
ok Correct
Test #40:
score: 0
Accepted
time: 214ms
memory: 7016kb
input:
490
output:
1 490 2 489 3 488 4 487 5 486 6 485 7 484 8 483 9 482 10 481 11 480 12 479 13 478 14 477 15 476 16 475 17 474 18 473 19 472 20 471 21 470 22 469 23 468 24 467 25 466 26 465 27 464 28 463 29 462 30 461 31 460 32 459 33 458 34 457 35 456 36 455 37 454 38 453 39 452 40 451 41 450 42 449 43 448 44 447 4...
result:
ok Correct
Test #41:
score: 0
Accepted
time: 211ms
memory: 6984kb
input:
491
output:
2 491 3 490 4 489 5 488 6 487 7 486 8 485 9 484 10 483 11 482 12 481 13 480 14 479 15 478 16 477 17 476 18 475 19 474 20 473 21 472 22 471 23 470 24 469 25 468 26 467 27 466 28 465 29 464 30 463 31 462 32 461 33 460 34 459 35 458 36 457 37 456 38 455 39 454 40 453 41 452 42 451 43 450 44 449 45 448 ...
result:
ok Correct
Test #42:
score: 0
Accepted
time: 222ms
memory: 7048kb
input:
492
output:
1 492 2 491 3 490 4 489 5 488 6 487 7 486 8 485 9 484 10 483 11 482 12 481 13 480 14 479 15 478 16 477 17 476 18 475 19 474 20 473 21 472 22 471 23 470 24 469 25 468 26 467 27 466 28 465 29 464 30 463 31 462 32 461 33 460 34 459 35 458 36 457 37 456 38 455 39 454 40 453 41 452 42 451 43 450 44 449 4...
result:
ok Correct
Test #43:
score: 0
Accepted
time: 215ms
memory: 7052kb
input:
493
output:
2 493 3 492 4 491 5 490 6 489 7 488 8 487 9 486 10 485 11 484 12 483 13 482 14 481 15 480 16 479 17 478 18 477 19 476 20 475 21 474 22 473 23 472 24 471 25 470 26 469 27 468 28 467 29 466 30 465 31 464 32 463 33 462 34 461 35 460 36 459 37 458 38 457 39 456 40 455 41 454 42 453 43 452 44 451 45 450 ...
result:
ok Correct
Test #44:
score: 0
Accepted
time: 220ms
memory: 6976kb
input:
494
output:
1 494 2 493 3 492 4 491 5 490 6 489 7 488 8 487 9 486 10 485 11 484 12 483 13 482 14 481 15 480 16 479 17 478 18 477 19 476 20 475 21 474 22 473 23 472 24 471 25 470 26 469 27 468 28 467 29 466 30 465 31 464 32 463 33 462 34 461 35 460 36 459 37 458 38 457 39 456 40 455 41 454 42 453 43 452 44 451 4...
result:
ok Correct
Test #45:
score: 0
Accepted
time: 215ms
memory: 7048kb
input:
495
output:
2 495 3 494 4 493 5 492 6 491 7 490 8 489 9 488 10 487 11 486 12 485 13 484 14 483 15 482 16 481 17 480 18 479 19 478 20 477 21 476 22 475 23 474 24 473 25 472 26 471 27 470 28 469 29 468 30 467 31 466 32 465 33 464 34 463 35 462 36 461 37 460 38 459 39 458 40 457 41 456 42 455 43 454 44 453 45 452 ...
result:
ok Correct
Test #46:
score: 0
Accepted
time: 228ms
memory: 6924kb
input:
496
output:
1 496 2 495 3 494 4 493 5 492 6 491 7 490 8 489 9 488 10 487 11 486 12 485 13 484 14 483 15 482 16 481 17 480 18 479 19 478 20 477 21 476 22 475 23 474 24 473 25 472 26 471 27 470 28 469 29 468 30 467 31 466 32 465 33 464 34 463 35 462 36 461 37 460 38 459 39 458 40 457 41 456 42 455 43 454 44 453 4...
result:
ok Correct
Test #47:
score: 0
Accepted
time: 223ms
memory: 6984kb
input:
497
output:
2 497 3 496 4 495 5 494 6 493 7 492 8 491 9 490 10 489 11 488 12 487 13 486 14 485 15 484 16 483 17 482 18 481 19 480 20 479 21 478 22 477 23 476 24 475 25 474 26 473 27 472 28 471 29 470 30 469 31 468 32 467 33 466 34 465 35 464 36 463 37 462 38 461 39 460 40 459 41 458 42 457 43 456 44 455 45 454 ...
result:
ok Correct
Test #48:
score: 0
Accepted
time: 227ms
memory: 6968kb
input:
498
output:
1 498 2 497 3 496 4 495 5 494 6 493 7 492 8 491 9 490 10 489 11 488 12 487 13 486 14 485 15 484 16 483 17 482 18 481 19 480 20 479 21 478 22 477 23 476 24 475 25 474 26 473 27 472 28 471 29 470 30 469 31 468 32 467 33 466 34 465 35 464 36 463 37 462 38 461 39 460 40 459 41 458 42 457 43 456 44 455 4...
result:
ok Correct
Test #49:
score: 0
Accepted
time: 230ms
memory: 6964kb
input:
499
output:
2 499 3 498 4 497 5 496 6 495 7 494 8 493 9 492 10 491 11 490 12 489 13 488 14 487 15 486 16 485 17 484 18 483 19 482 20 481 21 480 22 479 23 478 24 477 25 476 26 475 27 474 28 473 29 472 30 471 31 470 32 469 33 468 34 467 35 466 36 465 37 464 38 463 39 462 40 461 41 460 42 459 43 458 44 457 45 456 ...
result:
ok Correct
Test #50:
score: 0
Accepted
time: 229ms
memory: 6988kb
input:
500
output:
1 500 2 499 3 498 4 497 5 496 6 495 7 494 8 493 9 492 10 491 11 490 12 489 13 488 14 487 15 486 16 485 17 484 18 483 19 482 20 481 21 480 22 479 23 478 24 477 25 476 26 475 27 474 28 473 29 472 30 471 31 470 32 469 33 468 34 467 35 466 36 465 37 464 38 463 39 462 40 461 41 460 42 459 43 458 44 457 4...
result:
ok Correct