QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#209009 | #5033. Y 君的序列 | hos_lyric# | 54 | 163ms | 3968kb | C++14 | 3.8kb | 2023-10-10 02:21:01 | 2024-07-04 02:17:36 |
Judging History
answer
#include "seq.h"
#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
using Int = long long;
template <class T1, class T2> ostream &operator<<(ostream &os, const pair<T1, T2> &a) { return os << "(" << a.first << ", " << a.second << ")"; };
template <class T> ostream &operator<<(ostream &os, const vector<T> &as) { const int sz = as.size(); os << "["; for (int i = 0; i < sz; ++i) { if (i >= 256) { os << ", ..."; break; } if (i > 0) { os << ", "; } os << as[i]; } return os << "]"; }
template <class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cerr << *i << " "; cerr << endl; }
template <class T> bool chmin(T &t, const T &f) { if (t > f) { t = f; return true; } return false; }
template <class T> bool chmax(T &t, const T &f) { if (t < f) { t = f; return true; } return false; }
#define COLOR(s) ("\x1b[" s "m")
constexpr int INF = 1001001001;
void SEQ(int N, int M) {
assert(N <= 5000);
vector<int> B(N + 1);
for (int i = 1; i <= N; ++i) B[i] = Get(i);
vector<int> ps(N + 1), qs(N + 1);
for (int i = 1; i <= N; ++i) ps[i] = qs[i] = i;
vector<int> es(2 * N + 1, 0);
for (int m = 3; m < 2 * N; m += 2) {
int two = 1;
for (int e = 1; ; ++e) {
(two *= 2) %= m;
if (two == 1) {
break;
}
if (two == m - 1) {
es[m] = e;
break;
}
}
}
// cerr<<"es = "<<es<<endl;
auto exch = [&](int i, int j) -> void {
int a = ps[i], b = ps[j];
// cerr<<" exch "<<i<<" "<<j<<"; "<<a<<" "<<b<<endl;
assert(es[a + b]);
for (; !(a == ps[j] && b == ps[i]); ) {
if (a % 2 == 0) {
add(i, j);
b += a / 2;
a -= a / 2;
} else if (b % 2 == 0) {
add(j, i);
a += b / 2;
b -= b / 2;
} else {
assert(false);
}
}
swap(qs[ps[i]], qs[ps[j]]);
swap(ps[i], ps[j]);
};
auto sw = [&](int i, int j) -> void {
const int a = ps[i], b = ps[j];
// cerr<<"sw "<<i<<" "<<j<<"; "<<a<<" "<<b<<endl;
if (es[a + b]) {
exch(i, j);
return;
}
if ((a + b) % 2 == 0) {
int mn = INF;
int cm = 0;
for (int c = 1; c <= N; ++c) if (es[a + c] && es[b + c]) {
if (chmin(mn, 2 * es[a + c] + es[b + c])) {
cm = c;
}
}
if (cm) {
// cerr<<" via "<<cm<<endl;
const int k = qs[cm];
exch(i, k);
exch(i, j);
exch(j, k);
return;
}
}
if ((a + b) % 2 != 0) {
int mn = INF;
int cm = 0, dm = 0;
for (int c = 1; c <= N; ++c) if (es[a + c]) {
for (int d = 1; d <= N; ++d) if (es[b + d] && es[c + d]) {
if (chmin(mn, es[a + c] + es[b + d] + es[c + d])) {
cm = c;
dm = d;
}
}
}
if (cm) {
// cerr<<" via "<<cm<<" "<<dm<<endl;
const int k = qs[cm], l = qs[dm];
exch(i, k);
exch(j, l);
exch(i, j);
exch(j, k);
exch(i, l);
return;
}
}
cerr << "FAIL N = " << N << ": " << a << " " << b << endl;
assert(false);
};
answer(1);
vector<int> vis(N + 1, 0);
for (int i = 1; i <= N; ++i) if (!vis[i]) {
vector<int> cyc;
for (int j = i; !vis[j]; j = B[j]) {
vis[j] = 1;
cyc.push_back(j);
}
for (int k = 0; k < (int)cyc.size() - 1; ++k) {
sw(cyc[k], cyc[k + 1]);
}
}
}
詳細信息
Subtask #1:
score: 17
Accepted
Test #1:
score: 17
Accepted
time: 0ms
memory: 3712kb
input:
1 10000000 1
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #2:
score: 0
Accepted
time: 0ms
memory: 3948kb
input:
8 10000000 7 6 5 2 8 1 4 3
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #3:
score: 0
Accepted
time: 0ms
memory: 3904kb
input:
9 10000000 9 8 3 1 7 5 4 2 6
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #4:
score: 0
Accepted
time: 0ms
memory: 3684kb
input:
4 10000000 1 4 3 2
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #5:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
6 10000000 2 3 4 5 6 1
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #6:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
7 10000000 1 6 7 3 4 5 2
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #7:
score: 0
Accepted
time: 0ms
memory: 3904kb
input:
9 10000000 1 7 2 6 3 8 5 9 4
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #8:
score: 0
Accepted
time: 0ms
memory: 3936kb
input:
6 10000000 1 6 5 2 3 4
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #9:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
9 10000000 6 2 4 9 5 1 3 8 7
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #10:
score: 0
Accepted
time: 0ms
memory: 3716kb
input:
2 10000000 1 2
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #11:
score: 0
Accepted
time: 0ms
memory: 3900kb
input:
5 10000000 5 3 1 4 2
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #12:
score: 0
Accepted
time: 0ms
memory: 3676kb
input:
10 10000000 3 9 10 6 4 2 8 7 5 1
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #13:
score: 0
Accepted
time: 0ms
memory: 3676kb
input:
6 10000000 3 6 4 1 2 5
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #14:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
4 10000000 4 1 3 2
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #15:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
3 10000000 2 3 1
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #16:
score: 0
Accepted
time: 0ms
memory: 3948kb
input:
10 10000000 9 8 6 1 7 10 2 5 3 4
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #17:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
7 10000000 1 7 3 4 5 6 2
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #18:
score: 0
Accepted
time: 0ms
memory: 3668kb
input:
8 10000000 3 6 7 1 4 8 5 2
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #19:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
7 10000000 3 5 7 1 2 4 6
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #20:
score: 0
Accepted
time: 0ms
memory: 3936kb
input:
5 10000000 2 4 3 5 1
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Subtask #2:
score: 7
Accepted
Test #21:
score: 7
Accepted
time: 1ms
memory: 3908kb
input:
121 1500000 121 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #22:
score: 0
Accepted
time: 0ms
memory: 3676kb
input:
57 1500000 57 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #23:
score: 0
Accepted
time: 1ms
memory: 3952kb
input:
147 1500000 147 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #24:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
53 1500000 53 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #25:
score: 0
Accepted
time: 0ms
memory: 3680kb
input:
76 1500000 76 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #26:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
146 1500000 146 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #27:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
70 1500000 70 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #28:
score: 0
Accepted
time: 0ms
memory: 3668kb
input:
22 1500000 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #29:
score: 0
Accepted
time: 0ms
memory: 3952kb
input:
149 1500000 149 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #30:
score: 0
Accepted
time: 0ms
memory: 3940kb
input:
24 1500000 24 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #31:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
56 1500000 56 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #32:
score: 0
Accepted
time: 1ms
memory: 3668kb
input:
142 1500000 142 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #33:
score: 0
Accepted
time: 1ms
memory: 3940kb
input:
97 1500000 97 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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 84 85 86 87 88 89 90 91 92 93 94 95 96
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #34:
score: 0
Accepted
time: 1ms
memory: 3712kb
input:
90 1500000 90 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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 84 85 86 87 88 89
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #35:
score: 0
Accepted
time: 1ms
memory: 3684kb
input:
150 1500000 150 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #36:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
82 1500000 82 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #37:
score: 0
Accepted
time: 0ms
memory: 3680kb
input:
9 1500000 9 1 2 3 4 5 6 7 8
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #38:
score: 0
Accepted
time: 0ms
memory: 3940kb
input:
144 1500000 144 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #39:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
89 1500000 89 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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 84 85 86 87 88
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #40:
score: 0
Accepted
time: 1ms
memory: 3676kb
input:
114 1500000 114 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Subtask #3:
score: 14
Accepted
Dependency #2:
100%
Accepted
Test #41:
score: 14
Accepted
time: 1ms
memory: 3680kb
input:
55 1500000 15 47 8 28 4 22 29 40 37 17 35 20 44 49 9 39 25 34 23 31 45 54 30 24 32 43 41 1 5 48 36 10 50 26 53 2 3 18 52 11 38 21 42 13 6 46 12 55 27 19 7 51 14 33 16
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #42:
score: 0
Accepted
time: 1ms
memory: 3668kb
input:
90 1500000 76 82 61 57 31 21 36 10 51 29 74 72 86 7 6 71 81 45 37 9 2 49 13 67 43 56 17 16 78 47 18 33 55 23 32 64 89 79 80 1 63 14 35 25 38 22 41 84 70 8 40 53 77 27 19 85 65 12 44 42 83 28 11 69 62 30 59 58 87 66 68 4 50 88 90 75 34 73 5 48 15 52 26 3 24 20 39 54 60 46
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #43:
score: 0
Accepted
time: 1ms
memory: 3656kb
input:
149 1500000 68 25 100 50 7 69 107 126 115 104 55 110 128 70 22 13 62 23 99 27 149 105 139 71 11 26 77 3 147 120 63 108 93 148 92 24 41 131 1 35 74 60 135 140 106 88 96 80 129 72 132 109 21 31 38 44 66 123 54 94 16 118 125 86 45 82 145 87 59 122 121 64 5 10 103 4 42 67 141 76 83 32 89 30 142 136 19 3...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #44:
score: 0
Accepted
time: 1ms
memory: 3648kb
input:
95 1500000 42 9 11 20 91 61 7 44 72 92 64 78 41 34 19 57 94 30 62 50 76 38 55 8 66 6 81 35 88 3 75 59 12 15 43 71 70 29 39 79 23 17 16 24 25 32 89 48 14 46 67 60 73 49 10 37 56 40 93 58 53 47 90 13 45 26 74 2 87 85 5 69 1 84 68 86 54 65 27 28 4 21 77 18 33 52 51 63 95 22 80 31 83 82 36
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #45:
score: 0
Accepted
time: 1ms
memory: 3948kb
input:
138 1500000 26 27 28 29 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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 11...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #46:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
147 1500000 31 110 63 124 96 1 106 142 97 126 147 51 80 93 7 4 77 136 143 141 123 5 76 95 128 81 15 29 72 30 71 121 33 82 145 39 8 20 50 75 127 94 11 90 47 68 115 129 49 101 14 36 3 144 130 13 16 131 119 60 103 24 42 2 111 62 28 89 19 67 88 58 125 117 54 56 146 61 41 140 109 23 105 21 26 37 52 102 1...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #47:
score: 0
Accepted
time: 1ms
memory: 3684kb
input:
138 1500000 8 13 62 60 27 109 106 104 68 41 82 52 26 116 136 11 63 108 124 86 101 102 135 118 2 138 57 15 76 64 43 81 127 89 132 133 9 36 24 1 4 85 128 35 99 84 58 6 12 69 88 94 123 97 38 14 134 72 51 130 122 28 39 79 95 91 5 117 66 83 100 40 67 115 55 31 20 61 107 121 53 114 77 105 46 78 48 17 92 9...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #48:
score: 0
Accepted
time: 1ms
memory: 3676kb
input:
92 1500000 25 70 58 76 63 26 34 36 33 4 72 66 85 12 42 89 60 13 45 3 49 27 47 74 38 92 31 19 17 82 54 65 8 81 44 68 18 80 7 9 20 37 73 57 1 2 75 86 6 24 32 50 46 78 90 51 43 61 29 10 15 35 62 88 55 21 22 69 28 67 79 59 14 40 23 41 87 5 52 56 53 77 16 83 64 11 91 39 30 71 84 48
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #49:
score: 0
Accepted
time: 1ms
memory: 3684kb
input:
146 1500000 100 55 108 124 68 120 36 102 31 47 96 81 86 126 113 76 54 142 10 41 49 39 44 69 73 78 106 138 70 125 58 110 144 14 123 112 51 72 62 82 26 118 101 130 132 66 104 136 93 128 5 67 23 52 57 119 22 61 16 141 79 109 139 63 56 53 50 46 84 9 20 18 140 8 27 115 42 94 75 1 122 34 95 65 37 116 30 9...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #50:
score: 0
Accepted
time: 1ms
memory: 3724kb
input:
136 1500000 79 118 6 58 51 111 106 71 126 93 129 63 101 13 73 53 45 108 128 3 21 7 65 117 100 35 54 123 52 1 17 44 127 81 26 34 134 16 96 112 92 120 135 136 60 41 83 14 32 5 99 97 24 107 38 33 20 102 74 113 64 8 130 22 84 27 28 19 91 49 82 105 116 31 109 94 114 124 85 29 75 121 66 37 77 90 122 10 95...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #51:
score: 0
Accepted
time: 0ms
memory: 3672kb
input:
22 1500000 5 8 12 21 18 20 9 11 14 1 6 13 16 15 4 22 3 17 19 2 7 10
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #52:
score: 0
Accepted
time: 1ms
memory: 3608kb
input:
140 1500000 140 69 98 58 47 115 112 133 132 131 130 129 45 27 126 125 124 123 55 121 120 119 139 117 118 113 114 135 73 41 61 75 108 122 60 105 109 103 102 44 21 99 138 97 96 95 94 110 92 91 65 89 88 77 86 85 84 83 78 81 80 79 82 104 17 87 56 128 42 71 70 101 26 33 66 90 51 63 59 93 8 62 137 57 74 1...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #53:
score: 0
Accepted
time: 0ms
memory: 3720kb
input:
46 1500000 7 27 15 9 21 33 40 42 30 28 39 35 41 31 17 38 3 1 45 10 24 34 18 26 20 36 8 22 25 5 2 44 19 13 4 11 12 32 46 6 16 29 23 43 14 37
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #54:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
5 1500000 2 3 5 4 1
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #55:
score: 0
Accepted
time: 0ms
memory: 3716kb
input:
149 1500000 55 115 8 146 145 144 143 116 41 140 70 103 137 87 135 17 43 76 21 130 110 128 62 39 125 28 123 122 51 120 61 72 142 96 148 114 75 90 59 89 56 108 107 64 34 117 47 63 101 52 99 98 97 141 95 94 26 104 44 119 1 88 37 86 85 66 136 82 81 100 57 78 68 132 124 74 73 118 134 112 9 5 67 131 65 13...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #56:
score: 0
Accepted
time: 1ms
memory: 3612kb
input:
136 1500000 77 120 3 11 34 121 63 81 9 10 4 57 13 14 15 16 35 18 19 104 21 22 28 62 98 8 27 60 52 30 31 32 33 103 17 117 54 99 128 72 42 41 82 44 1 46 47 48 49 50 51 40 53 37 73 56 12 58 39 108 61 24 100 135 65 125 67 68 66 70 71 96 55 136 75 23 80 7 79 45 26 123 6 84 85 86 102 88 110 90 91 92 93 11...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #57:
score: 0
Accepted
time: 0ms
memory: 3664kb
input:
25 1500000 13 14 20 17 19 10 5 2 23 15 18 24 3 22 21 16 6 8 9 11 1 12 25 7 4
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #58:
score: 0
Accepted
time: 1ms
memory: 3652kb
input:
145 1500000 1 86 3 25 5 6 4 97 39 10 11 138 13 117 15 16 51 136 131 20 21 22 23 27 139 26 94 105 119 30 31 32 50 79 143 57 34 38 135 54 40 145 33 44 134 46 42 48 49 43 129 7 81 41 87 28 76 98 59 60 61 62 63 68 65 77 67 55 29 102 71 126 85 74 93 47 72 114 37 64 83 82 128 84 73 112 80 88 89 92 91 90 1...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #59:
score: 0
Accepted
time: 1ms
memory: 3716kb
input:
121 1500000 37 18 3 49 48 6 105 90 4 121 113 12 13 14 35 16 95 86 10 62 76 22 23 26 25 24 27 39 15 63 31 80 69 34 29 36 81 11 32 101 40 42 44 20 45 89 114 17 9 50 51 97 87 82 58 56 57 118 59 60 120 53 30 64 112 66 41 109 33 117 47 72 96 88 38 54 84 5 1 8 100 65 83 106 85 2 21 115 46 75 91 92 93 94 7...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #60:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
24 1500000 18 24 16 4 11 6 15 2 21 20 1 23 17 7 13 9 10 8 19 5 3 22 14 12
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Subtask #4:
score: 16
Accepted
Dependency #3:
100%
Accepted
Test #61:
score: 16
Accepted
time: 105ms
memory: 3744kb
input:
938 15000000 683 133 390 701 819 645 533 742 83 579 864 53 457 762 203 727 489 497 610 46 895 162 307 44 498 526 511 684 801 513 364 486 269 656 826 931 458 189 178 890 286 34 756 875 150 928 636 855 394 786 220 837 353 799 848 191 387 422 14 669 30 708 348 459 868 148 49 707 694 520 611 267 110 264...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #62:
score: 0
Accepted
time: 47ms
memory: 3960kb
input:
723 15000000 264 42 584 245 417 36 191 318 548 172 512 333 29 547 467 136 490 275 79 413 123 148 392 43 338 343 258 472 622 717 435 188 252 516 448 217 1 428 279 300 720 468 260 721 659 85 427 362 266 699 662 129 635 449 285 203 613 186 384 647 707 395 633 353 175 115 639 58 443 493 290 155 220 102 ...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #63:
score: 0
Accepted
time: 131ms
memory: 3752kb
input:
998 15000000 597 257 921 428 380 684 476 611 36 336 675 682 305 185 505 800 433 973 23 459 287 662 219 466 43 680 659 155 251 63 141 30 757 499 390 240 992 924 704 323 841 824 825 847 351 651 716 894 603 28 92 85 616 391 322 24 384 168 118 429 759 578 857 791 442 379 218 430 91 708 96 902 281 274 8 ...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #64:
score: 0
Accepted
time: 5ms
memory: 3616kb
input:
329 15000000 101 298 227 5 12 60 212 145 67 105 241 2 267 91 323 317 95 39 262 279 289 233 133 46 272 196 195 160 144 131 114 318 164 201 307 225 246 325 112 102 34 98 94 28 158 1 51 78 36 222 140 141 174 54 146 84 169 295 243 82 306 297 73 128 260 75 74 135 234 239 58 193 142 299 21 4 326 254 263 1...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #65:
score: 0
Accepted
time: 7ms
memory: 3944kb
input:
359 15000000 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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 ...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #66:
score: 0
Accepted
time: 123ms
memory: 3684kb
input:
995 15000000 215 366 731 639 594 661 87 533 105 504 438 229 371 10 780 613 530 50 118 449 539 179 704 749 619 927 54 808 502 311 148 967 700 825 701 422 942 314 23 256 217 501 541 472 534 336 334 836 901 959 93 327 326 673 464 489 4 51 488 181 540 417 187 391 672 466 236 356 419 874 165 551 844 670 ...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #67:
score: 0
Accepted
time: 2ms
memory: 3724kb
input:
223 15000000 118 21 155 146 38 179 105 197 154 62 41 103 59 36 174 71 134 136 18 23 192 124 191 92 53 25 122 141 22 16 106 107 168 91 216 52 177 26 214 151 113 133 98 65 83 99 126 209 208 202 217 205 49 5 129 70 77 183 4 220 58 89 131 102 47 54 30 223 111 63 194 218 110 190 193 184 8 51 101 84 200 1...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #68:
score: 0
Accepted
time: 99ms
memory: 3740kb
input:
912 15000000 797 103 864 415 855 178 406 497 202 736 850 517 655 399 538 811 481 377 708 613 678 458 775 905 216 667 26 372 760 66 47 484 442 504 835 441 540 240 9 842 567 391 87 778 868 69 309 206 561 672 58 584 763 727 111 129 151 155 84 502 463 169 620 246 685 321 645 393 428 541 848 286 844 14 4...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #69:
score: 0
Accepted
time: 124ms
memory: 3708kb
input:
997 15000000 372 917 384 430 255 909 256 424 944 378 517 274 237 765 216 717 562 388 949 955 425 792 458 501 882 421 82 594 542 363 737 7 35 321 608 16 228 863 771 105 217 457 709 2 246 695 987 317 45 98 104 297 929 541 38 81 847 848 908 963 581 43 493 502 199 568 58 68 393 518 785 644 599 825 350 2...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #70:
score: 0
Accepted
time: 20ms
memory: 3684kb
input:
538 15000000 256 197 468 414 383 302 518 505 73 40 117 155 506 162 322 7 148 166 296 417 525 96 290 37 478 364 180 312 54 167 267 465 381 86 181 61 340 310 185 404 431 36 81 531 277 237 56 183 416 286 135 98 80 193 446 533 265 186 157 235 212 169 217 179 132 301 498 334 284 136 472 23 530 215 274 59...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #71:
score: 0
Accepted
time: 1ms
memory: 3608kb
input:
217 15000000 217 216 215 214 23 167 211 210 209 208 207 206 205 204 203 202 201 200 199 72 197 31 195 194 193 192 191 190 189 176 187 186 67 184 87 182 181 180 179 178 177 188 175 174 173 172 171 170 169 168 212 166 165 29 133 162 161 110 98 158 157 156 155 154 153 152 151 150 149 148 1 146 145 144 ...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #72:
score: 0
Accepted
time: 163ms
memory: 3660kb
input:
998 15000000 998 997 996 995 994 178 992 991 990 989 988 987 986 985 984 983 391 981 980 979 978 977 976 975 974 973 972 971 970 969 968 967 966 965 964 963 962 217 960 959 958 957 956 955 954 953 952 951 879 949 948 947 946 945 944 943 942 941 940 939 938 937 86 935 934 933 932 931 930 929 928 854 ...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #73:
score: 0
Accepted
time: 153ms
memory: 3692kb
input:
974 15000000 974 973 23 971 970 969 968 967 966 965 964 963 962 961 960 959 932 957 956 103 954 953 952 951 950 949 948 947 946 945 944 943 942 941 940 939 938 477 936 935 934 933 958 931 930 929 928 927 926 925 924 875 922 921 920 136 918 917 916 915 914 913 912 911 910 909 908 907 906 905 904 903 ...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #74:
score: 0
Accepted
time: 18ms
memory: 3688kb
input:
923 15000000 923 922 921 920 919 918 917 889 915 914 913 912 911 464 909 908 907 906 905 300 903 902 901 900 899 898 897 896 895 894 893 892 313 890 916 888 887 552 885 675 883 882 881 880 879 878 877 876 875 874 873 872 871 870 869 868 867 866 865 864 863 862 861 860 859 858 857 856 855 854 853 852...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #75:
score: 0
Accepted
time: 8ms
memory: 3968kb
input:
995 15000000 995 994 993 992 991 990 989 988 987 986 985 984 983 982 981 980 979 978 977 976 975 974 973 972 971 970 969 968 967 966 965 964 963 962 961 960 959 958 957 956 955 954 953 952 951 950 949 948 947 946 945 944 943 942 941 940 939 938 937 936 935 934 933 932 931 930 929 928 927 926 925 924...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #76:
score: 0
Accepted
time: 10ms
memory: 3960kb
input:
794 15000000 468 2 3 4 5 6 649 434 254 10 11 12 13 14 713 16 582 617 19 20 21 22 560 24 25 26 27 766 29 433 31 32 768 34 35 36 37 38 325 40 729 491 43 44 45 46 47 48 49 50 51 52 53 54 55 784 57 58 446 60 61 62 63 64 775 66 67 68 69 70 71 72 73 74 235 515 77 477 79 80 81 82 83 84 85 86 538 88 89 90 2...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #77:
score: 0
Accepted
time: 1ms
memory: 3904kb
input:
281 15000000 1 2 3 4 5 28 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 6 29 30 31 32 33 34 35 97 37 38 39 269 41 42 43 44 45 46 47 48 49 50 51 52 53 54 40 249 57 58 59 60 61 62 63 64 65 66 67 68 69 260 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 108 92 93 94 95 177 36 ...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #78:
score: 0
Accepted
time: 10ms
memory: 3748kb
input:
993 15000000 1 2 3 4 5 6 7 939 9 10 11 12 650 211 15 16 17 18 139 20 21 317 23 24 371 488 27 28 29 30 31 32 33 34 35 36 37 38 39 40 891 42 43 44 45 46 47 48 49 50 411 52 198 54 55 116 57 58 59 64 61 62 63 60 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #79:
score: 0
Accepted
time: 4ms
memory: 3688kb
input:
658 15000000 1 2 3 4 5 6 7 484 9 569 11 12 13 181 529 16 17 18 19 20 336 335 23 24 25 26 27 28 29 30 31 32 254 34 35 36 129 38 39 40 92 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 647 58 59 97 61 62 63 64 387 66 67 68 69 70 71 72 512 472 75 76 77 78 79 80 81 82 294 84 85 86 87 627 89 90 91 41 93 94...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #80:
score: 0
Accepted
time: 1ms
memory: 3688kb
input:
186 15000000 123 2 3 4 5 6 7 8 9 10 11 12 13 62 15 16 17 18 19 20 97 22 23 153 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 77 49 50 51 52 53 54 55 56 57 58 59 177 61 14 63 64 65 66 67 68 69 70 71 119 73 74 75 96 48 78 79 80 81 82 83 84 85 86 87 88 89 90 91 21 93 94 95 76 92 ...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Subtask #5:
score: 0
Time Limit Exceeded
Dependency #4:
100%
Accepted
Test #81:
score: 16
Accepted
time: 6ms
memory: 3948kb
input:
343 15000000 103 271 289 73 316 309 231 92 21 66 74 312 195 336 158 236 141 242 77 149 123 140 85 111 323 339 313 65 202 287 20 45 114 15 155 238 40 60 260 330 294 324 59 241 247 307 301 209 25 138 314 253 208 44 240 169 246 18 265 97 186 67 173 207 278 102 223 302 282 61 55 125 51 315 187 19 2 159 ...
output:
Correct Answer :) Congrats!
result:
ok 4 tokens
Test #82:
score: -16
Time Limit Exceeded
input:
3957 15000000 3059 1745 2290 497 648 3162 3894 1 649 1188 103 979 3151 800 2727 860 3616 273 1144 3252 2278 459 1383 3879 489 389 515 2600 2038 1148 1368 2058 989 758 1525 1248 3867 132 2673 3427 973 1284 901 203 1108 3332 3426 3000 1211 2748 907 2888 1240 937 1303 2219 2796 114 275 589 1843 2316 22...
output:
Unauthorized output
result:
Subtask #6:
score: 0
Skipped
Dependency #5:
0%