QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#783354#9640. 格雷码zjy0001100 ✓172ms234316kbC++179.7kb2024-11-26 08:56:342024-11-26 08:56:34

Judging History

你现在查看的是最新测评结果

  • [2024-11-26 08:56:34]
  • 评测
  • 测评结果:100
  • 用时:172ms
  • 内存:234316kb
  • [2024-11-26 08:56:34]
  • 提交

answer

#include<bits/stdc++.h>
#define LL long long
#define LLL __int128
#define uint unsigned
#define ldb long double
#define uLL unsigned long long
using namespace std;
#ifndef FASTIO
#define FASTIO
namespace FastIO
{
// ------------------------------
// #define DISABLE_MMAP
// ------------------------------
#if ( defined(LOCAL) || defined(_WIN32) ) && !defined(DISABLE_MMAP)
#define DISABLE_MMAP
#endif
#ifdef LOCAL
	inline void _chk_i() {}
	inline char _gc_nochk() { return getchar(); }
	inline char _gc() { return getchar(); }
	inline void _chk_o() {}
	inline void _pc_nochk(char c) { putchar(c); }
	inline void _pc(char c) { putchar(c); }
	template < int n > inline void _pnc_nochk(const char *c) { for ( int i = 0 ; i < n ; i++ ) putchar(c[i]); }
#else
#ifdef DISABLE_MMAP
	inline constexpr int _READ_SIZE = 1 << 18; inline static char _read_buffer[_READ_SIZE + 40], *_read_ptr = nullptr, *_read_ptr_end = nullptr; static inline bool _eof = false;
	inline void _chk_i() { if ( __builtin_expect(!_eof, true) && __builtin_expect(_read_ptr_end - _read_ptr < 40, false) ) { int sz = _read_ptr_end - _read_ptr; if ( sz ) memcpy(_read_buffer, _read_ptr, sz); char *beg = _read_buffer + sz; _read_ptr = _read_buffer, _read_ptr_end = beg + fread(beg, 1, _READ_SIZE, stdin); if ( __builtin_expect(_read_ptr_end != beg + _READ_SIZE, false) ) _eof = true, *_read_ptr_end = EOF; } }
	inline char _gc_nochk() { return __builtin_expect(_eof && _read_ptr == _read_ptr_end, false) ? EOF : *_read_ptr++; }
	inline char _gc() { _chk_i(); return _gc_nochk(); }
#else
#include<sys/mman.h>
#include<sys/stat.h>
	inline static char *_read_ptr = (char *)mmap(nullptr, [] { struct stat s; return fstat(0, &s), s.st_size; } (), 1, 2, 0, 0);
	inline void _chk_i() {}
	inline char _gc_nochk() { return *_read_ptr++; }
	inline char _gc() { return *_read_ptr++; }
#endif
	inline constexpr int _WRITE_SIZE = 1 << 18; inline static char _write_buffer[_WRITE_SIZE + 40], *_write_ptr = _write_buffer;
	inline void _chk_o() { if ( __builtin_expect(_write_ptr - _write_buffer > _WRITE_SIZE, false) ) fwrite(_write_buffer, 1, _write_ptr - _write_buffer, stdout), _write_ptr = _write_buffer; }
	inline void _pc_nochk(char c) { *_write_ptr++ = c; }
	inline void _pc(char c) { *_write_ptr++ = c, _chk_o(); }
	template < int n > inline void _pnc_nochk(const char *c) { memcpy(_write_ptr, c, n), _write_ptr += n; }
	inline struct _auto_flush { inline ~_auto_flush() { fwrite(_write_buffer, 1, _write_ptr - _write_buffer, stdout); } } _auto_flush;
#endif
#define println println_ // don't use C++23 std::println
	template < class T > inline constexpr bool _is_signed = numeric_limits < T >::is_signed;
	template < class T > inline constexpr bool _is_unsigned = numeric_limits < T >::is_integer && !_is_signed < T >;
#if __SIZEOF_LONG__ == 64
	template <> inline constexpr bool _is_signed < __int128 > = true;
	template <> inline constexpr bool _is_unsigned < __uint128_t > = true;
#endif
	inline bool _isgraph(char c) { return c >= 33; }
	inline bool _isdigit(char c) { return 48 <= c && c <= 57; } // or faster, remove c <= 57
	constexpr struct _table {
#ifndef LOCAL
	int i[65536];
#endif
	char o[40000]; constexpr _table() :
#ifndef LOCAL
	i{},
#endif
	o{} {
#ifndef LOCAL
	for ( int x = 0 ; x < 65536 ; x++ ) i[x] = -1; for ( int x = 0 ; x <= 9 ; x++ ) for ( int y = 0 ; y <= 9 ; y++ ) i[x + y * 256 + 12336] = x * 10 + y;
#endif
	for ( int x = 0 ; x < 10000 ; x++ ) for ( int y = 3, z = x ; ~y ; y-- ) o[x * 4 + y] = z % 10 + 48, z /= 10; } } _table;
	template < class T, int digit > inline constexpr T _pw10 = 10 * _pw10 < T, digit - 1 >;
	template < class T > inline constexpr T _pw10 < T, 0 > = 1;
	inline void read(char &c) { do c = _gc(); while ( !_isgraph(c) ); }
	inline void read_cstr(char *s) { char c = _gc(); while ( !_isgraph(c) ) c = _gc(); while ( _isgraph(c) ) *s++ = c, c = _gc(); *s = 0; }
	inline void read(string &s) { char c = _gc(); s.clear(); while ( !_isgraph(c) ) c = _gc(); while ( _isgraph(c) ) s.push_back(c), c = _gc(); }
	template < class T, bool neg >
#ifndef LOCAL
	__attribute__((no_sanitize("undefined")))
#endif
	inline void _read_int_suf(T &x) { _chk_i(); char c; while
#ifndef LOCAL
	( ~_table.i[*reinterpret_cast < unsigned short *& >(_read_ptr)] ) if constexpr ( neg ) x = x * 100 - _table.i[*reinterpret_cast < unsigned short *& >(_read_ptr)++]; else x = x * 100 + _table.i[*reinterpret_cast < unsigned short *& >(_read_ptr)++]; if
#endif
	( _isdigit(c = _gc_nochk()) ) if constexpr ( neg ) x = x * 10 - ( c & 15 ); else x = x * 10 + ( c & 15 ); }
	template < class T, enable_if_t < _is_signed < T >, int > = 0 > inline void read(T &x) { char c; while ( !_isdigit(c = _gc()) ) if ( c == 45 ) { _read_int_suf < T, true >(x = -( _gc_nochk() & 15 )); return; } _read_int_suf < T, false >(x = c & 15); }
	template < class T, enable_if_t < _is_unsigned < T >, int > = 0 > inline void read(T &x) { char c; while ( !_isdigit(c = _gc()) ); _read_int_suf < T, false >(x = c & 15); }
	inline void write(bool x) { _pc(x | 48); }
	inline void write(char c) { _pc(c); }
	inline void write_cstr(const char *s) { while ( *s ) _pc(*s++); }
	inline void write(const string &s) { for ( char c : s ) _pc(c); }
	template < class T, bool neg, int digit > inline void _write_int_suf(T x) { if constexpr ( digit == 4 ) _pnc_nochk < 4 >(_table.o + ( neg ? -x : x ) * 4); else _write_int_suf < T, neg, digit / 2 >(x / _pw10 < T, digit / 2 >), _write_int_suf < T, neg, digit / 2 >(x % _pw10 < T, digit / 2 >); }
	template < class T, bool neg, int digit > inline void _write_int_pre(T x) { if constexpr ( digit <= 4 ) if ( digit >= 3 && ( neg ? x <= -100 : x >= 100 ) ) if ( digit >= 4 && ( neg ? x <= -1000 : x >= 1000 ) ) _pnc_nochk < 4 >(_table.o + ( neg ? -x : x ) * 4); else _pnc_nochk < 3 >(_table.o + ( neg ? -x : x ) * 4 + 1); else if ( digit >= 2 && ( neg ? x <= -10 : x >= 10 ) ) _pnc_nochk < 2 >(_table.o + ( neg ? -x : x ) * 4 + 2); else _pc_nochk(( neg ? -x : x ) | 48); else { constexpr int cur = 1 << __lg(digit - 1); if ( neg ? x <= -_pw10 < T, cur > : x >= _pw10 < T, cur > ) _write_int_pre < T, neg, digit - cur >(x / _pw10 < T, cur >), _write_int_suf < T, neg, cur >(x % _pw10 < T, cur >); else _write_int_pre < T, neg, cur >(x); } }
	template < class T, enable_if_t < _is_signed < T >, int > = 0 > inline void write(T x) { if ( x >= 0 ) _write_int_pre < T, false, numeric_limits < T >::digits10 + 1 >(x); else _pc_nochk(45), _write_int_pre < T, true, numeric_limits < T >::digits10 + 1 >(x); _chk_o(); }
	template < class T, enable_if_t < _is_unsigned < T >, int > = 0 > inline void write(T x) { _write_int_pre < T, false, numeric_limits < T >::digits10 + 1 >(x), _chk_o(); }
	template < size_t N, class ...T > inline void _read_tuple(tuple < T... > &x) { read(get < N >(x)); if constexpr ( N + 1 != sizeof...(T) ) _read_tuple < N + 1, T... >(x); }
	template < size_t N, class ...T > inline void _write_tuple(const tuple < T... > &x) { write(get < N >(x)); if constexpr ( N + 1 != sizeof...(T) ) _pc(32), _write_tuple < N + 1, T... >(x); }
	template < class ...T > inline void read(tuple < T... > &x) { _read_tuple < 0, T... >(x); }
	template < class ...T > inline void write(const tuple < T... > &x) { _write_tuple < 0, T... >(x); }
	template < class T1, class T2 > inline void read(pair < T1, T2 > &x) { read(x.first), read(x.second); }
	template < class T1, class T2 > inline void write(const pair < T1, T2 > &x) { write(x.first), _pc(32), write(x.second); }
	template < class T > inline auto read(T &x) -> decltype(x.read(), void()) { x.read(); }
	template < class T > inline auto write(const T &x) -> decltype(x.write(), void()) { x.write(); }
	template < class T1, class ...T2 > inline void read(T1 &x, T2 &...y) { read(x), read(y...); }
	template < class ...T > inline void read_cstr(char *x, T *...y) { read_cstr(x), read_cstr(y...); }
	template < class T1, class ...T2 > inline void write(const T1 &x, const T2 &...y) { write(x), write(y...); }
	template < class ...T > inline void write_cstr(const char *x, const T *...y) { write_cstr(x), write_cstr(y...); }
	template < class T > inline void print(const T &x) { write(x); }
	inline void print_cstr(const char *x) { write_cstr(x); }
	template < class T1, class ...T2 > inline void print(const T1 &x, const T2 &...y) { write(x), _pc(32), print(y...); }
	template < class ...T > inline void print_cstr(const char *x, const T *...y) { write_cstr(x), _pc(32), print_cstr(y...); }
	inline void println() { _pc(10); }
	inline void println_cstr() { _pc(10); }
	template < class ...T > inline void println(const T &...x) { print(x...), _pc(10); }
	template < class ...T > inline void println_cstr(const T *...x) { print_cstr(x...), _pc(10); }
}	using FastIO::read, FastIO::read_cstr, FastIO::write, FastIO::write_cstr, FastIO::println, FastIO::println_cstr;
#endif
inline vector<int>solve(int n){
    if(n==1)return {0,0};
    if(n==2)return {0,1,0,1};
    if(n==3)return {1,0,2,0,1,0,2,0};
    vector<int>b(solve(n-2));
    int u=(1<<(n-1))/n,v=(1<<(n-1))%n;
    if(v>=2)v-=2;
    vector<int>cnt(n-2);
    for(int i:b)++cnt[i];
    --cnt[b.back()];
    for(int i=0;i<n-2;++i)cnt[i]=cnt[i]*2-u-(i<v);
    vector<int>c(1<<(n-2)),z;
    for(int i=0;i<(1<<(n-2))-1;++i)if(cnt[b[i]])--cnt[b[i]],c[i]=1;
    c.back()=1;
    for(int l=0,r,t=0;l<(1<<(n-2));l=r+1){
        for(r=l;!c[r];++r);
        for(int i=l;i<r;++i)z.emplace_back(b[i]);
        z.emplace_back(n-t-1);
        for(int i=r-1;i>=l;--i)z.emplace_back(b[i]);
        t=1-t,z.emplace_back(n-t-1);
        for(int i=l;i<=r;++i)z.emplace_back(b[i]);
    }
    z.back()=n-1;
    for(int i=(1<<(n-2))-1;i--;)z.emplace_back(b[i]);
    z.emplace_back(n-2);
    return z;
}
signed main(){
    cin.tie(0)->sync_with_stdio(0);
	int n;read(n);
    for(int i:solve(n))write(i+1,' ');
    return 0;
}
/*

*/

Details

Tip: Click on the bar to expand more detailed information

Pretests


Final Tests

Test #1:

score: 4
Accepted
time: 0ms
memory: 3624kb

input:

1

output:

1 1 

result:

ok Correct

Test #2:

score: 4
Accepted
time: 0ms
memory: 3736kb

input:

2

output:

1 2 1 2 

result:

ok Correct

Test #3:

score: 4
Accepted
time: 0ms
memory: 3612kb

input:

3

output:

2 1 3 1 2 1 3 1 

result:

ok Correct

Test #4:

score: 4
Accepted
time: 0ms
memory: 3688kb

input:

4

output:

4 3 1 2 3 2 4 2 1 4 3 4 1 2 1 3 

result:

ok Correct

Test #5:

score: 4
Accepted
time: 0ms
memory: 3884kb

input:

5

output:

5 4 2 4 5 1 5 4 3 4 5 1 2 1 3 5 3 1 2 4 2 1 3 5 3 1 2 1 3 1 2 4 

result:

ok Correct

Test #6:

score: 4
Accepted
time: 0ms
memory: 3868kb

input:

6

output:

6 5 4 5 6 3 6 5 1 5 6 2 3 6 3 5 3 2 5 6 4 6 5 2 5 6 1 6 5 4 3 4 5 4 3 6 3 4 1 2 1 6 1 2 5 2 1 6 1 2 1 4 3 4 1 2 4 2 3 2 1 3 4 5 

result:

ok Correct

Test #7:

score: 4
Accepted
time: 0ms
memory: 3596kb

input:

7

output:

7 6 5 6 7 4 7 6 2 4 6 4 7 4 5 7 6 1 6 7 5 4 7 4 6 4 3 4 5 6 5 4 7 4 5 1 7 6 2 6 7 1 7 6 3 5 6 5 7 5 3 7 6 1 6 7 2 4 2 7 2 4 6 4 2 1 3 5 3 6 3 5 3 7 3 5 3 1 2 1 3 1 2 7 2 1 3 1 2 6 2 1 3 1 2 7 2 1 3 1 2 1 3 5 3 1 2 4 2 1 3 5 3 1 2 1 5 4 3 4 5 1 5 4 2 4 5 6 

result:

ok Correct

Test #8:

score: 4
Accepted
time: 0ms
memory: 3608kb

input:

8

output:

8 7 6 7 8 5 8 7 4 7 8 5 8 7 6 7 8 3 8 7 6 7 8 5 8 7 1 7 8 5 8 7 6 7 8 2 8 7 3 7 8 6 8 7 3 7 8 5 8 7 3 7 8 2 8 7 5 7 8 6 8 7 4 7 8 6 5 8 5 7 5 2 5 7 5 8 5 6 8 7 1 6 5 7 5 6 8 6 5 4 3 8 3 7 3 4 5 4 3 6 3 4 7 4 3 6 3 4 5 8 5 4 3 6 3 4 1 8 7 2 7 8 1 6 1 2 5 2 1 6 1 2 1 4 3 4 1 2 4 2 3 2 1 3 4 8 4 3 1 2 ...

result:

ok Correct

Test #9:

score: 4
Accepted
time: 0ms
memory: 3732kb

input:

9

output:

9 8 7 8 9 6 9 8 5 8 9 6 9 8 7 8 9 4 9 8 7 8 9 6 9 8 2 8 9 4 9 8 6 8 9 4 9 8 7 8 9 4 9 8 5 8 9 7 9 8 6 8 9 1 9 8 6 8 9 7 9 8 5 8 9 4 9 8 7 8 9 4 6 9 6 8 6 4 8 9 3 9 8 4 8 9 5 6 9 6 8 6 5 4 8 4 9 4 7 4 9 4 8 4 5 8 9 1 7 6 9 6 7 8 7 6 2 6 7 8 7 6 9 6 7 1 7 6 9 6 7 8 7 6 3 8 9 5 6 9 6 8 6 5 7 5 8 5 7 9 ...

result:

ok Correct

Test #10:

score: 4
Accepted
time: 0ms
memory: 3992kb

input:

10

output:

10 9 8 9 10 7 10 9 6 9 10 7 10 9 8 9 10 5 10 9 8 9 10 7 10 9 4 9 10 7 10 9 8 9 10 5 10 9 8 9 10 7 10 9 6 9 10 7 10 9 8 9 10 3 10 9 8 9 10 7 10 9 6 9 10 7 10 9 8 9 10 5 10 9 8 9 10 7 10 9 1 9 10 7 10 9 8 9 10 5 10 9 8 9 10 7 10 9 6 7 9 7 10 7 8 10 9 2 9 10 8 7 10 7 9 7 3 7 8 9 8 7 10 7 8 6 8 7 10 7 8...

result:

ok Correct

Test #11:

score: 4
Accepted
time: 0ms
memory: 3748kb

input:

11

output:

11 10 9 10 11 8 11 10 7 10 11 8 11 10 9 10 11 6 11 10 9 10 11 8 11 10 5 10 11 8 11 10 9 10 11 6 11 10 9 10 11 8 11 10 7 10 11 8 11 10 9 10 11 4 11 10 9 10 11 8 11 10 7 10 11 8 11 10 9 10 11 6 11 10 9 10 11 8 11 10 2 10 11 8 11 10 9 10 11 4 11 10 9 10 11 8 11 10 6 10 11 8 11 10 9 10 11 4 11 10 9 10 1...

result:

ok Correct

Test #12:

score: 4
Accepted
time: 0ms
memory: 3988kb

input:

12

output:

12 11 10 11 12 9 12 11 8 11 12 9 12 11 10 11 12 7 12 11 10 11 12 9 12 11 6 11 12 9 12 11 10 11 12 7 12 11 10 11 12 9 12 11 8 11 12 9 12 11 10 11 12 5 12 11 10 11 12 9 12 11 8 11 12 9 12 11 10 11 12 7 12 11 10 11 12 9 12 11 4 11 12 9 12 11 10 11 12 7 12 11 10 11 12 9 12 11 8 11 12 9 12 11 10 11 12 5 ...

result:

ok Correct

Test #13:

score: 4
Accepted
time: 0ms
memory: 4052kb

input:

13

output:

13 12 11 12 13 10 13 12 9 12 13 10 13 12 11 12 13 8 13 12 11 12 13 10 13 12 7 12 13 10 13 12 11 12 13 8 13 12 11 12 13 10 13 12 9 12 13 10 13 12 11 12 13 6 13 12 11 12 13 10 13 12 9 12 13 10 13 12 11 12 13 8 13 12 11 12 13 10 13 12 5 12 13 10 13 12 11 12 13 8 13 12 11 12 13 10 13 12 9 12 13 10 13 12...

result:

ok Correct

Test #14:

score: 4
Accepted
time: 1ms
memory: 3920kb

input:

14

output:

14 13 12 13 14 11 14 13 10 13 14 11 14 13 12 13 14 9 14 13 12 13 14 11 14 13 8 13 14 11 14 13 12 13 14 9 14 13 12 13 14 11 14 13 10 13 14 11 14 13 12 13 14 7 14 13 12 13 14 11 14 13 10 13 14 11 14 13 12 13 14 9 14 13 12 13 14 11 14 13 6 13 14 11 14 13 12 13 14 9 14 13 12 13 14 11 14 13 10 13 14 11 1...

result:

ok Correct

Test #15:

score: 4
Accepted
time: 1ms
memory: 3964kb

input:

15

output:

15 14 13 14 15 12 15 14 11 14 15 12 15 14 13 14 15 10 15 14 13 14 15 12 15 14 9 14 15 12 15 14 13 14 15 10 15 14 13 14 15 12 15 14 11 14 15 12 15 14 13 14 15 8 15 14 13 14 15 12 15 14 11 14 15 12 15 14 13 14 15 10 15 14 13 14 15 12 15 14 7 14 15 12 15 14 13 14 15 10 15 14 13 14 15 12 15 14 11 14 15 ...

result:

ok Correct

Test #16:

score: 4
Accepted
time: 1ms
memory: 3940kb

input:

16

output:

16 15 14 15 16 13 16 15 12 15 16 13 16 15 14 15 16 11 16 15 14 15 16 13 16 15 10 15 16 13 16 15 14 15 16 11 16 15 14 15 16 13 16 15 12 15 16 13 16 15 14 15 16 9 16 15 14 15 16 13 16 15 12 15 16 13 16 15 14 15 16 11 16 15 14 15 16 13 16 15 8 15 16 13 16 15 14 15 16 11 16 15 14 15 16 13 16 15 12 15 16...

result:

ok Correct

Test #17:

score: 4
Accepted
time: 2ms
memory: 4152kb

input:

17

output:

17 16 15 16 17 14 17 16 13 16 17 14 17 16 15 16 17 12 17 16 15 16 17 14 17 16 11 16 17 14 17 16 15 16 17 12 17 16 15 16 17 14 17 16 13 16 17 14 17 16 15 16 17 10 17 16 15 16 17 14 17 16 13 16 17 14 17 16 15 16 17 12 17 16 15 16 17 14 17 16 9 16 17 14 17 16 15 16 17 12 17 16 15 16 17 14 17 16 13 16 1...

result:

ok Correct

Test #18:

score: 4
Accepted
time: 3ms
memory: 4816kb

input:

18

output:

18 17 16 17 18 15 18 17 14 17 18 15 18 17 16 17 18 13 18 17 16 17 18 15 18 17 12 17 18 15 18 17 16 17 18 13 18 17 16 17 18 15 18 17 14 17 18 15 18 17 16 17 18 11 18 17 16 17 18 15 18 17 14 17 18 15 18 17 16 17 18 13 18 17 16 17 18 15 18 17 10 17 18 15 18 17 16 17 18 13 18 17 16 17 18 15 18 17 14 17 ...

result:

ok Correct

Test #19:

score: 4
Accepted
time: 3ms
memory: 6764kb

input:

19

output:

19 18 17 18 19 16 19 18 15 18 19 16 19 18 17 18 19 14 19 18 17 18 19 16 19 18 13 18 19 16 19 18 17 18 19 14 19 18 17 18 19 16 19 18 15 18 19 16 19 18 17 18 19 12 19 18 17 18 19 16 19 18 15 18 19 16 19 18 17 18 19 14 19 18 17 18 19 16 19 18 11 18 19 16 19 18 17 18 19 14 19 18 17 18 19 16 19 18 15 18 ...

result:

ok Correct

Test #20:

score: 4
Accepted
time: 3ms
memory: 10080kb

input:

20

output:

20 19 18 19 20 17 20 19 16 19 20 17 20 19 18 19 20 15 20 19 18 19 20 17 20 19 14 19 20 17 20 19 18 19 20 15 20 19 18 19 20 17 20 19 16 19 20 17 20 19 18 19 20 13 20 19 18 19 20 17 20 19 16 19 20 17 20 19 18 19 20 15 20 19 18 19 20 17 20 19 12 19 20 17 20 19 18 19 20 15 20 19 18 19 20 17 20 19 16 19 ...

result:

ok Correct

Test #21:

score: 4
Accepted
time: 16ms
memory: 19468kb

input:

21

output:

21 20 19 20 21 18 21 20 17 20 21 18 21 20 19 20 21 16 21 20 19 20 21 18 21 20 15 20 21 18 21 20 19 20 21 16 21 20 19 20 21 18 21 20 17 20 21 18 21 20 19 20 21 14 21 20 19 20 21 18 21 20 17 20 21 18 21 20 19 20 21 16 21 20 19 20 21 18 21 20 13 20 21 18 21 20 19 20 21 16 21 20 19 20 21 18 21 20 17 20 ...

result:

ok Correct

Test #22:

score: 4
Accepted
time: 12ms
memory: 29236kb

input:

22

output:

22 21 20 21 22 19 22 21 18 21 22 19 22 21 20 21 22 17 22 21 20 21 22 19 22 21 16 21 22 19 22 21 20 21 22 17 22 21 20 21 22 19 22 21 18 21 22 19 22 21 20 21 22 15 22 21 20 21 22 19 22 21 18 21 22 19 22 21 20 21 22 17 22 21 20 21 22 19 22 21 14 21 22 19 22 21 20 21 22 17 22 21 20 21 22 19 22 21 18 21 ...

result:

ok Correct

Test #23:

score: 4
Accepted
time: 58ms
memory: 60940kb

input:

23

output:

23 22 21 22 23 20 23 22 19 22 23 20 23 22 21 22 23 18 23 22 21 22 23 20 23 22 17 22 23 20 23 22 21 22 23 18 23 22 21 22 23 20 23 22 19 22 23 20 23 22 21 22 23 16 23 22 21 22 23 20 23 22 19 22 23 20 23 22 21 22 23 18 23 22 21 22 23 20 23 22 15 22 23 20 23 22 21 22 23 18 23 22 21 22 23 20 23 22 19 22 ...

result:

ok Correct

Test #24:

score: 4
Accepted
time: 65ms
memory: 103752kb

input:

24

output:

24 23 22 23 24 21 24 23 20 23 24 21 24 23 22 23 24 19 24 23 22 23 24 21 24 23 18 23 24 21 24 23 22 23 24 19 24 23 22 23 24 21 24 23 20 23 24 21 24 23 22 23 24 17 24 23 22 23 24 21 24 23 20 23 24 21 24 23 22 23 24 19 24 23 22 23 24 21 24 23 16 23 24 21 24 23 22 23 24 19 24 23 22 23 24 21 24 23 20 23 ...

result:

ok Correct

Test #25:

score: 4
Accepted
time: 172ms
memory: 234316kb

input:

25

output:

25 24 23 24 25 22 25 24 21 24 25 22 25 24 23 24 25 20 25 24 23 24 25 22 25 24 19 24 25 22 25 24 23 24 25 20 25 24 23 24 25 22 25 24 21 24 25 22 25 24 23 24 25 18 25 24 23 24 25 22 25 24 21 24 25 22 25 24 23 24 25 20 25 24 23 24 25 22 25 24 17 24 25 22 25 24 23 24 25 20 25 24 23 24 25 22 25 24 21 24 ...

result:

ok Correct