QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#811531#5687. 速战速决thupc_team#AC ✓85ms22500kbC++203.7kb2024-12-12 20:26:302024-12-12 20:26:30

Judging History

This is the latest submission verdict.

  • [2024-12-12 20:26:30]
  • Judged
  • Verdict: AC
  • Time: 85ms
  • Memory: 22500kb
  • [2024-12-12 20:26:30]
  • Submitted

answer

#include <iostream>
#include <sstream>
#include <cstring>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <vector>
#include <queue> 
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <ctime>
#include <assert.h>
#include <deque>
#include <list>
#include <stack>


using namespace std;

#define is_mul_overflow(a, b) \
    ((b != 0) && (a > LLONG_MAX / b || a < LLONG_MIN / b))
 
typedef pair<long long, int> pli;
typedef pair<int, long long> pil;
typedef pair<long long , long long> pll;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<int, pii> piii;
typedef pair<int, long long > pil;
typedef pair<long long, pii> plii;
typedef pair<double, int> pdi;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ull, ull> puu;
typedef long double ld;
const int N = 2000086, MOD = 998244353, INF = 0x3f3f3f3f, MID = 333;
const double EPS = 1e-5;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
// int dx[8] = {1, 1, 0, -1, -1, -1, 0, 1}, dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
// int dx[8] = {2, 1, -1, -2, -2, -1, 1, 2}, dy[8] = {1, 2, 2, 1, -1, -2, -2, -1};
int n, m, cnt;
int w[N];
vector<ll> num;
ll res;

ll lowbit(ll x) { return x & -x; }
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
inline double rand(double l, double r) { return (double)rand() / RAND_MAX * (r - l) + l; }
inline ll qmi(ll a, ll b, ll c) { ll res = 1; while (b) { if (b & 1) res = res * a % c; a = a * a % c; b >>= 1; } return res; }
inline ll qmi(ll a, ll b) { ll res = 1; while (b) { if (b & 1) res *= a; a *= a; b >>= 1; } return res; }
inline double qmi(double a, ll b) { double res = 1; while (b) { if (b & 1) res *= a; a *= a; b >>= 1; } return res; } 
// inline ll C(ll a, ll b) { if (a < b) return 0; if (b > a - b) b = a - b; ll res = 1; for (ll i = 1, j = a; i <= b; i++, j--) { res = res * (j % MOD) % MOD; res = res * qmi(i, MOD - 2, MOD) % MOD; } return res; }
inline ll C(ll a, ll b, int* c) { if (a < b) return 0; ll res = 1; for (ll j = a, i = 1; i < b + 1; i++, j--) res *= j; for (ll j = a, i = 1; i < b + 1; i++, j--) res /= i; return res; }
inline int find(int x) { return lower_bound(num.begin(), num.end(), x) - num.begin(); }

int c[N];
multiset<int> c1, c2;
set<int> pre;

inline void solve() {
    if (c2.size()) {
        int t = *c2.begin();
        c2.erase(c2.begin());
        printf("%d\n%d ", n, t);
        c[w[1]]--;

        bool flag = 1;
        for (int i = 2; i < n + 1; i++) {
            if (i == 2 && c1.count(w[1])) {
                printf("%d ", w[1]);
                c2.insert(w[1]);
                c[w[2]]--;
                continue;
            }

            if (!flag) {
                flag = 1;
                printf("%d ", t);
                c[w[i]]--;
            } else if (c[w[i]] == 1) {
                printf("%d ", t);
                flag = 0;
            } else if (c[w[i]] == 2) {
                assert(c2.size());
                printf("%d ", *c2.begin());
                c2.erase(c2.begin());
                c[w[i]]--;
            } else assert(0);
        }
    } else {
        printf("%d\n", n + 2);
        printf("%d ", w[n]);
        for (int i = 1; i < n; i++) printf("%d ", w[i]);
        printf("%d %d\n", w[1], w[1]);
    }
}

int main() {
    cin >> n;
    if (n == 1) { puts("-1"); return 0; }

    for (int i = 1; i < n + 1; i++) scanf("%d", w + i), c[w[i]]++;
    for (int i = 1; i < n + 1; i++) {
        if (!c[i]) c2.insert(i);
        else if (c[i] == 1) c1.insert(i);
    }

    solve();
    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 52ms
memory: 19296kb

input:

249665
195633 37425 205189 128330 159707 98406 111454 30346 158516 121742 107964 50039 201395 16843 182333 60177 195166 188257 172666 71779 157060 237654 123572 145065 57507 152240 187931 5706 191077 214174 70950 71272 172767 61529 85258 74139 44633 181186 223348 222711 19237 239887 20487 84130 1392...

output:

249665
2 195633 2 2 4 2 2 2 2 7 2 2 8 2 2 10 2 2 2 2 2 2 18 2 2 2 2 2 2 2 2 20 26 2 2 2 2 2 2 2 2 29 2 2 2 2 30 2 2 38 2 2 40 42 2 2 44 2 2 2 2 45 2 2 48 51 52 2 2 59 62 67 2 2 2 2 2 2 2 2 68 69 73 75 2 2 79 80 81 2 2 2 2 85 2 2 2 2 88 2 2 95 2 2 97 2 2 99 100 2 2 2 2 101 2 2 107 108 2 2 2 2 110 115...

result:

ok Correct.

Test #2:

score: 0
Accepted
time: 85ms
memory: 22500kb

input:

289892
233602 170432 186700 23520 1359 74354 61778 97676 141808 279091 86618 107162 187289 270874 5771 92359 256248 59758 201034 111974 157736 29506 210946 178606 275526 119662 142498 119239 245490 9443 240901 72345 207797 759 91770 131534 189757 72201 5921 152878 237072 146758 101282 50083 61126 26...

output:

289892
245154 233602 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154 245154...

result:

ok Correct.

Test #3:

score: 0
Accepted
time: 65ms
memory: 16832kb

input:

292190
145417 283887 12115 4326 45188 164129 14638 269369 233283 201793 241021 17606 90840 34917 16328 180328 261955 172583 181417 7942 223673 262641 28684 237776 243658 74833 205577 122527 28528 249819 73252 270152 117871 31565 204148 216504 192924 29203 143059 154759 104752 69112 166848 232567 962...

output:

292190
2 3 5 7 8 9 10 13 15 16 17 20 21 23 24 25 26 30 31 34 37 38 39 40 44 45 47 52 53 55 60 61 63 66 69 70 71 72 78 81 83 85 89 91 95 97 98 100 102 105 106 109 110 113 117 118 122 123 125 126 127 130 132 133 134 135 136 143 144 147 148 149 150 151 153 155 159 160 161 162 163 164 169 171 173 175 17...

result:

ok Correct.

Test #4:

score: 0
Accepted
time: 60ms
memory: 17460kb

input:

289638
179249 177210 122624 75928 106218 13899 249362 245081 212282 3125 52160 49231 77788 143892 158982 277667 242837 199352 19097 201259 164534 261237 201825 180668 58106 141543 286211 251784 6410 112507 51157 93955 107491 250456 58875 36203 234469 45239 283807 106103 197348 238937 162203 287869 1...

output:

289638
1 2 3 5 6 8 11 13 15 17 20 23 25 26 27 29 30 31 34 35 36 38 39 42 47 48 50 51 52 53 54 56 57 58 59 60 62 63 64 67 68 69 70 74 76 77 78 82 84 85 86 88 90 91 93 94 95 98 99 102 103 105 106 107 108 109 110 111 112 113 116 120 122 125 128 130 132 134 135 138 140 141 145 146 149 150 151 157 159 16...

result:

ok Correct.

Test #5:

score: 0
Accepted
time: 52ms
memory: 16644kb

input:

261175
113751 113751 247389 247389 106728 106728 249714 249714 128388 128388 216271 216271 163974 163974 245217 245217 246248 246248 51361 51361 176423 176423 19217 19217 197524 197524 251874 251874 112335 112335 160213 160213 60037 60037 250967 250967 187608 187608 214950 214950 208541 208541 25669...

output:

261175
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 4 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 5 8 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2...

result:

ok Correct.

Test #6:

score: 0
Accepted
time: 56ms
memory: 17844kb

input:

235687
63799 71109 20584 139647 35537 3706 218536 48564 213438 186010 156300 113267 147774 194058 51317 150706 90938 10941 6713 175756 29369 170762 71917 56104 19923 152417 157391 24269 651 205117 57134 130459 204707 14596 183539 32848 219225 58014 162840 153464 135755 16381 91308 77955 176504 66784...

output:

235687
200863 63799 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 200863 ...

result:

ok Correct.

Test #7:

score: 0
Accepted
time: 64ms
memory: 20764kb

input:

286065
210717 98065 272406 215134 231139 267285 38811 254951 247150 55368 273010 247371 85937 256408 11755 96321 53159 66358 234133 68621 160218 285535 185357 247070 261590 43071 54158 13202 281537 21836 3621 234524 109158 188905 62618 144070 211133 129125 262129 85892 198535 174556 2297 62475 19242...

output:

286065
21 210717 25 36 45 48 55 21 21 21 21 21 21 21 21 21 21 56 59 21 21 21 21 21 21 63 65 66 21 21 21 21 67 21 21 68 21 21 69 21 21 21 21 21 21 71 78 21 21 79 21 21 21 21 21 21 21 21 81 85 91 92 21 21 94 21 21 21 21 99 21 21 104 110 21 21 112 115 21 21 116 21 21 118 121 21 21 21 21 130 21 21 21 21...

result:

ok Correct.

Test #8:

score: 0
Accepted
time: 62ms
memory: 16036kb

input:

296716
132049 132049 256044 256044 110447 110447 263700 263700 36769 36769 171894 171894 60205 60205 227616 227616 286799 286799 281611 281611 124684 124684 284840 284840 213378 213378 140028 140028 7425 7425 154415 154415 71482 71482 156517 156517 295706 295706 142794 142794 10192 10192 132364 1323...

output:

296716
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

result:

ok Correct.

Test #9:

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

input:

1
1

output:

-1

result:

ok Correct.

Test #10:

score: 0
Accepted
time: 1ms
memory: 5936kb

input:

2
1 1

output:

2
2 2 

result:

ok Correct.

Test #11:

score: 0
Accepted
time: 1ms
memory: 5936kb

input:

4
1 1 4 2

output:

4
3 3 3 3 

result:

ok Correct.

Test #12:

score: 0
Accepted
time: 1ms
memory: 6004kb

input:

5
2 4 3 4 3

output:

5
1 2 2 1 1 

result:

ok Correct.

Test #13:

score: 0
Accepted
time: 1ms
memory: 5928kb

input:

170
170 120 157 41 148 30 14 132 155 139 91 72 110 74 112 52 68 69 106 62 141 123 70 53 129 96 134 167 87 48 28 12 37 96 118 127 119 110 128 5 51 38 60 98 23 112 137 11 73 74 47 35 105 101 67 129 10 28 46 10 20 138 36 97 44 63 162 109 168 5 80 66 100 168 124 25 121 98 103 53 22 73 21 84 44 164 12 12...

output:

170
3 3 3 4 3 3 6 8 3 3 3 3 15 16 18 19 3 3 3 3 3 3 3 3 24 26 3 3 3 3 27 29 3 3 3 3 31 3 3 32 3 3 33 34 3 3 43 3 3 3 3 3 3 50 3 3 55 3 3 3 3 3 3 3 3 56 3 3 64 3 3 65 71 3 3 82 83 3 3 3 3 3 3 3 3 3 3 3 3 85 3 3 3 3 86 3 3 89 3 3 3 3 3 3 3 3 3 3 3 3 3 3 93 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3...

result:

ok Correct.

Test #14:

score: 0
Accepted
time: 69ms
memory: 19620kb

input:

298282
111238 21426 241947 111803 215806 257154 180196 187662 265628 113962 69090 19116 218515 256928 214215 246498 208920 166101 33496 99919 228275 241615 680 47148 193116 62529 290930 107840 27286 163363 140988 112469 35229 87471 231114 282993 90834 143707 256766 641 40265 127700 233599 188382 258...

output:

298282
1 111238 1 1 1 1 1 1 8 14 15 16 1 1 1 1 1 1 1 1 21 26 35 38 1 1 40 1 1 41 52 1 1 1 1 1 1 1 1 1 1 1 1 54 58 60 63 65 1 1 1 1 1 1 66 69 1 1 1 1 71 1 1 84 89 1 1 1 1 1 1 91 1 1 94 1 1 1 1 99 102 106 1 1 109 1 1 111 117 122 1 1 126 1 1 1 1 1 1 139 1 1 1 1 1 1 145 147 1 1 1 1 1 1 156 157 1 1 1 1 1...

result:

ok Correct.

Test #15:

score: 0
Accepted
time: 0ms
memory: 6172kb

input:

7028
890 4919 5516 4507 881 1936 1250 6879 4020 5347 3632 2088 5719 6828 551 5743 3912 6283 4373 3916 3021 5444 433 604 2506 6891 4206 287 3619 3247 1250 3358 1476 917 1539 2040 5753 2814 1672 5945 6116 1111 1466 6149 4596 2993 3646 3255 4591 1004 4842 2980 1872 4229 5947 6638 5634 3936 4390 6775 79...

output:

7028
3 890 3 3 5 3 3 8 3 3 3 3 3 3 9 10 12 18 22 24 3 3 3 3 26 3 3 3 3 28 3 3 30 35 3 3 3 3 3 3 3 3 3 3 42 44 3 3 46 53 3 3 54 58 3 3 60 62 64 3 3 65 67 71 73 76 3 3 77 79 3 3 80 81 82 3 3 87 88 3 3 93 104 108 115 3 3 116 3 3 121 128 137 139 144 3 3 3 3 146 152 3 3 3 3 154 3 3 3 3 166 169 3 3 3 3 17...

result:

ok Correct.

Test #16:

score: 0
Accepted
time: 7ms
memory: 7144kb

input:

32718
16672 3857 28075 31442 14228 19512 993 27269 22217 2896 23349 9568 19344 3385 7921 12538 17485 22980 27110 24464 12290 15835 22520 3365 13285 31694 5529 27028 21009 19947 9552 5335 19363 17106 17913 7719 27902 25714 23157 7832 29338 13282 28188 10767 9027 11009 12352 20744 3915 8839 5517 9251 ...

output:

32718
2 2 2 2 2 6 7 8 11 12 2 2 2 2 2 2 15 2 2 16 19 27 29 33 2 2 2 2 50 51 2 2 52 2 2 2 2 55 2 2 56 57 2 2 2 2 60 2 2 2 2 61 66 68 2 2 69 2 2 2 2 2 2 78 2 2 2 2 79 2 2 83 2 2 84 2 2 2 2 2 2 89 105 112 113 2 2 114 2 2 2 2 2 2 2 2 119 121 2 2 123 124 2 2 2 2 2 2 2 2 2 2 125 2 2 131 132 133 135 2 2 2 ...

result:

ok Correct.

Test #17:

score: 0
Accepted
time: 74ms
memory: 18552kb

input:

249939
116706 120073 87891 238536 248923 178942 236407 175545 209802 92808 226143 235269 231651 150564 19412 193312 9344 201164 177304 66666 141887 219987 202707 120853 204395 46154 215762 14059 119025 174198 230364 145992 235982 84009 202274 123063 134691 54501 126175 1720 182402 196639 82163 23284...

output:

249941
155443 116706 120073 87891 238536 248923 178942 236407 175545 209802 92808 226143 235269 231651 150564 19412 193312 9344 201164 177304 66666 141887 219987 202707 120853 204395 46154 215762 14059 119025 174198 230364 145992 235982 84009 202274 123063 134691 54501 126175 1720 182402 196639 8216...

result:

ok Correct.

Test #18:

score: 0
Accepted
time: 78ms
memory: 22420kb

input:

262408
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 99 100 1...

output:

262410
122857 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 9...

result:

ok Correct.

Test #19:

score: 0
Accepted
time: 1ms
memory: 6056kb

input:

1168
632 604 584 718 309 868 1075 26 798 350 661 882 118 608 1098 941 820 849 43 1072 586 831 156 1091 1026 1095 153 705 1162 190 233 406 334 840 1111 455 628 591 181 510 271 836 619 205 783 804 790 148 927 931 218 489 802 452 258 805 96 1157 555 759 440 434 617 127 735 755 685 137 794 771 973 785 1...

output:

1170
454 632 604 584 718 309 868 1075 26 798 350 661 882 118 608 1098 941 820 849 43 1072 586 831 156 1091 1026 1095 153 705 1162 190 233 406 334 840 1111 455 628 591 181 510 271 836 619 205 783 804 790 148 927 931 218 489 802 452 258 805 96 1157 555 759 440 434 617 127 735 755 685 137 794 771 973 7...

result:

ok Correct.

Test #20:

score: 0
Accepted
time: 55ms
memory: 14548kb

input:

300000
104295 48676 395 395 273643 68529 62334 62334 146939 291394 182029 146939 219449 130707 130707 225020 198772 282573 38527 190585 282573 9721 9721 78157 78157 44428 77693 44428 187455 76599 187455 239996 239996 230137 202169 230137 269585 269585 257894 257894 177938 134861 95517 134861 246402 ...

output:

300000
4 104295 7 4 4 4 4 4 4 4 4 4 4 13 4 4 4 4 4 4 4 4 4 4 4 4 4 4 14 4 4 15 4 4 4 4 17 4 4 4 4 18 4 4 19 4 4 4 4 20 4 4 4 4 23 4 4 4 4 4 4 4 4 4 4 26 4 4 33 4 4 4 4 4 4 4 4 34 4 4 37 4 4 4 4 4 4 4 4 39 4 4 40 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 41 4 4 4 4 4 4 4 4 4 4 44 4 4 45 4 4 47 4 4 48 4 4 4 4 4...

result:

ok Correct.

Test #21:

score: 0
Accepted
time: 56ms
memory: 16428kb

input:

300000
87002 285451 161600 161600 285451 290676 288087 166754 288087 290676 54689 54689 219596 115692 115692 42659 93485 93485 147006 140572 59474 140572 147006 219300 176128 99511 176128 219300 117804 172670 172670 117804 189707 91911 179972 91911 254263 281118 281118 268480 268480 290250 13021 130...

output:

300000
2 87002 3 2 2 5 7 2 2 2 2 2 2 8 2 2 10 2 2 11 2 2 2 2 13 2 2 2 2 14 2 2 2 2 2 2 2 2 2 2 2 2 15 2 2 2 2 16 2 2 2 2 2 2 18 2 2 2 2 19 2 2 2 2 2 2 2 2 20 2 2 2 2 2 2 2 2 2 2 21 2 2 2 2 22 2 2 2 2 23 25 2 2 26 2 2 29 2 2 2 2 2 2 2 2 31 2 2 2 2 34 35 2 2 2 2 2 2 2 2 2 2 2 2 36 2 2 2 2 2 2 41 2 2 2...

result:

ok Correct.

Test #22:

score: 0
Accepted
time: 53ms
memory: 17452kb

input:

300000
112999 72586 108286 72586 112999 20881 20881 224942 172419 170284 170284 172419 88064 86223 86223 88064 153765 170621 213836 213836 170621 153765 98041 98041 61745 28149 5574 61745 28149 5574 90390 162637 194064 194064 2592 234404 90390 142072 173605 267231 267231 68638 173605 142072 197824 3...

output:

300000
2 7 2 2 2 2 2 2 11 13 2 2 14 15 2 2 17 18 20 2 2 2 2 2 2 22 23 2 2 2 2 2 2 2 2 2 2 26 28 29 2 2 2 2 2 2 31 2 2 32 2 2 2 2 2 2 33 35 2 2 2 2 36 2 2 37 38 39 2 2 2 2 2 2 42 2 2 2 2 43 2 2 2 2 2 2 44 2 2 2 2 46 2 2 2 2 2 2 2 2 2 2 47 48 2 2 2 2 2 2 49 52 2 2 2 2 2 2 54 58 2 2 2 2 59 2 2 60 2 2 6...

result:

ok Correct.

Test #23:

score: 0
Accepted
time: 54ms
memory: 17920kb

input:

300000
212412 202528 109689 219686 219686 202528 212412 298389 215032 215032 48782 253326 212566 212566 253326 48782 181793 181793 85358 85358 107085 152733 131633 134140 107085 243759 152733 131633 134140 240845 45475 234872 242812 242812 234872 45475 240845 187548 51249 187548 51249 137738 277850 ...

output:

300000
1 5 1 1 1 1 1 1 7 1 1 11 12 1 1 1 1 1 1 1 1 13 15 16 1 1 1 1 1 1 18 20 25 1 1 1 1 28 29 1 1 30 31 32 1 1 1 1 33 34 40 1 1 1 1 41 43 44 45 1 1 1 1 46 1 1 47 48 49 1 1 1 1 50 54 57 58 60 1 1 1 1 1 1 62 63 66 67 1 1 1 1 1 1 1 1 1 1 69 70 71 1 1 1 1 73 75 1 1 1 1 76 1 1 79 1 1 80 1 1 81 1 1 1 1 8...

result:

ok Correct.

Test #24:

score: 0
Accepted
time: 45ms
memory: 14160kb

input:

300000
112542 130897 148582 5771 5771 148582 130897 232285 78322 60911 233311 254507 299395 152670 200813 232285 78322 60911 233311 254507 299395 152670 200813 69442 69442 201471 69034 270365 225839 131571 225839 270365 69034 188076 96199 50969 208116 4324 143204 124928 215229 132229 188076 96199 50...

output:

300000
2 112542 5 6 2 2 2 2 11 12 13 14 20 22 23 2 2 2 2 2 2 2 2 25 2 2 26 30 32 2 2 2 2 33 34 35 39 42 45 50 51 52 2 2 2 2 2 2 2 2 2 2 53 54 57 61 65 67 2 2 2 2 2 2 2 2 70 71 2 2 2 2 74 2 2 2 2 2 2 76 78 79 80 83 86 87 89 91 2 2 2 2 2 2 2 2 2 2 2 2 94 95 98 101 104 2 2 2 2 2 2 113 2 2 2 2 115 118 1...

result:

ok Correct.

Test #25:

score: 0
Accepted
time: 55ms
memory: 15832kb

input:

300000
179741 243130 281430 74491 13391 223051 192090 128383 153327 137170 198445 210063 224906 83630 23956 201656 28271 277409 179741 243130 281430 74491 13391 223051 192090 128383 153327 137170 198445 210063 224906 83630 23956 201656 28271 277409 271734 87773 269885 13663 30764 88206 91123 124511 ...

output:

300000
2 3 5 7 8 9 10 11 12 13 15 18 22 23 26 27 30 32 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 34 37 40 44 46 49 50 51 58 59 61 65 2 2 2 2 2 2 2 2 2 2 2 2 66 71 74 77 78 81 84 86 2 2 87 89 92 94 95 96 97 98 99 101 102 103 106 108 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 114 116 2 2 2 2 119 121 12...

result:

ok Correct.

Test #26:

score: 0
Accepted
time: 50ms
memory: 17376kb

input:

300000
139446 61864 68262 149230 149373 279654 17726 230439 297464 142781 167021 124753 91655 290220 59543 16277 52572 271693 278606 49886 184692 180209 214393 276580 59459 46417 142105 23181 59049 66183 220591 184915 171415 112565 125304 155622 117616 229964 57093 254362 113285 202551 200476 185347...

output:

300000
1 3 5 7 10 13 19 21 22 23 25 26 31 33 35 36 37 38 39 44 1 1 46 48 49 51 54 55 57 58 62 63 65 67 68 70 72 73 74 75 79 82 83 87 89 90 92 93 94 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 97 98 99 101 102 103 105 1 1 1 1 1 1 1 1 106 107 108 109...

result:

ok Correct.

Test #27:

score: 0
Accepted
time: 59ms
memory: 14052kb

input:

300000
146270 82100 178709 216673 243441 48813 85256 178122 50067 292908 21770 238549 237442 3666 36724 36896 36896 36724 3666 237442 238549 21770 292908 50067 178122 85256 48813 243441 216673 178709 82100 146270 131878 99772 287809 178518 62603 262348 115777 55322 226610 274742 233620 136818 289446...

output:

300000
1 4 5 8 9 10 11 14 15 22 24 26 27 28 31 32 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 33 36 38 41 44 45 46 48 49 50 52 53 58 60 61 62 70 73 74 79 80 81 82 84 85 86 89 93 94 95 96 97 98 100 102 104 105 107 108 110 111 113 115 117 119 120 124 127 130 132 135 137 145 147 148 150 154 156 157 158 160 162 166...

result:

ok Correct.

Test #28:

score: 0
Accepted
time: 60ms
memory: 17372kb

input:

300000
110731 96171 106010 274368 65451 282684 150154 154863 86678 82340 192026 28631 111490 87537 282850 293573 109287 234161 114226 198876 222954 269690 71677 295044 171910 69378 2018 149024 268028 49018 260414 18125 119076 293176 1401 4168 30842 43974 127995 83144 129178 16744 196739 289093 20671...

output:

300000
1 2 3 5 6 7 11 13 14 17 21 22 23 24 26 28 31 32 34 37 40 45 46 48 49 50 53 54 55 56 58 62 65 69 70 71 72 73 81 82 83 84 85 88 92 93 97 99 100 102 104 105 107 109 111 114 115 116 117 119 121 122 125 127 130 131 136 137 140 147 148 150 152 153 154 155 159 161 162 164 165 167 168 171 175 176 178...

result:

ok Correct.

Test #29:

score: 0
Accepted
time: 65ms
memory: 15812kb

input:

300000
117340 164310 228941 59929 237075 132796 74500 119548 257687 159245 275273 80604 274625 160131 251183 296436 295760 261689 261722 30567 78952 115057 169224 262964 123745 295097 44645 115835 68392 208097 251172 269656 206631 212262 225567 69391 30532 150991 204868 289913 68581 65524 269749 226...

output:

300000
1 3 4 5 6 7 9 10 11 13 14 18 20 24 25 28 31 32 34 35 36 37 40 41 42 43 44 46 47 52 58 59 63 65 68 71 75 77 78 79 80 81 86 87 88 90 91 94 95 98 99 100 101 102 103 104 105 106 107 108 109 111 113 118 120 122 127 128 129 130 131 132 133 135 139 142 144 149 151 158 159 161 164 165 166 167 174 175...

result:

ok Correct.

Test #30:

score: 0
Accepted
time: 61ms
memory: 17556kb

input:

300000
77216 220675 295264 63122 6416 23297 51573 277084 9199 122718 254742 291056 278759 283686 188924 106312 104415 178991 187715 187842 268917 12556 289206 19697 169649 108051 34277 235627 62667 186920 141327 134122 73807 123311 276920 91403 270180 224464 126439 129366 124951 52620 236470 51568 2...

output:

300000
1 4 7 8 11 12 14 16 25 26 27 30 33 34 35 36 37 39 43 44 46 53 56 60 63 64 66 68 72 73 75 76 78 80 82 83 85 88 90 91 92 94 95 96 97 98 100 101 102 103 108 109 111 113 116 117 118 121 122 124 127 129 131 134 136 137 138 139 140 141 146 149 150 151 152 153 155 156 157 158 161 162 163 167 169 171...

result:

ok Correct.

Test #31:

score: 0
Accepted
time: 66ms
memory: 17336kb

input:

300000
69435 276305 282600 72533 5595 43926 8159 32663 166037 140551 182918 262539 91727 152596 87673 115269 234444 2064 196526 154369 257447 1718 160251 217956 175780 72827 259805 270978 85755 290185 265631 176805 250468 11778 230030 103813 92069 159527 50435 166481 281508 143280 241306 286223 2067...

output:

300000
7 10 12 13 16 18 19 20 23 24 26 30 31 32 35 36 38 40 42 43 44 46 47 48 49 50 51 53 56 59 60 62 65 66 67 71 74 75 78 80 81 82 84 86 87 88 89 90 94 95 101 102 103 104 105 106 107 108 109 110 116 119 122 123 124 129 132 135 139 141 142 144 146 147 148 149 150 151 154 161 162 165 168 169 172 175 ...

result:

ok Correct.

Test #32:

score: 0
Accepted
time: 64ms
memory: 14104kb

input:

300000
7853 31576 143740 234534 249276 155910 30243 176859 137139 217249 114263 115321 92819 120238 165379 297566 253326 56876 35804 243226 139973 129810 130504 225845 85157 74352 8254 190823 91009 176512 24014 197598 183052 249393 47971 50594 25419 167090 115187 178927 236088 192639 35626 110419 44...

output:

300000
1 2 3 7 8 10 11 16 18 20 25 29 30 31 32 33 44 45 46 50 51 52 53 55 57 61 63 66 67 68 71 77 80 83 84 87 88 90 91 93 94 102 108 109 110 111 113 114 115 116 117 124 126 128 130 133 139 142 143 145 148 153 155 158 164 165 167 168 169 170 171 172 173 175 179 180 181 182 185 186 187 188 190 191 193...

result:

ok Correct.

Test #33:

score: 0
Accepted
time: 69ms
memory: 16060kb

input:

300000
210519 215064 27536 130938 205393 237716 56324 205305 53414 180660 232743 113165 205162 279753 131419 109634 272098 230080 267341 80729 17970 231980 25101 191866 10904 227704 232085 98687 3458 80568 74803 195202 183328 86446 289829 238400 112166 290179 186375 151597 156556 31981 38614 10386 5...

output:

300000
1 2 3 4 8 9 10 11 12 13 15 16 18 22 23 28 31 33 34 35 36 38 39 41 45 46 50 52 55 59 60 61 63 65 66 69 72 75 77 79 82 83 85 86 89 91 94 96 101 102 104 105 107 111 112 116 117 118 120 121 132 134 136 139 142 146 149 150 152 155 161 169 170 172 173 175 176 177 178 179 182 183 184 185 188 189 190...

result:

ok Correct.

Test #34:

score: 0
Accepted
time: 52ms
memory: 15908kb

input:

300000
106853 172663 79240 269125 92322 264619 78326 24974 89874 186660 260690 289912 48683 227423 170283 184949 30266 291878 243517 68126 245756 26864 46929 258879 3954 63520 266659 191506 262682 13887 201560 88033 82464 217113 100939 26888 192659 76146 255311 234245 33872 246373 285912 125393 2397...

output:

300000
1 3 4 5 6 9 17 18 20 23 25 27 31 32 34 39 40 43 44 47 48 49 50 51 53 54 55 56 57 58 59 71 74 76 77 80 83 85 89 92 93 96 98 101 105 106 107 108 109 111 113 117 120 122 124 125 126 128 129 130 132 133 137 139 140 141 143 148 149 150 153 155 158 159 160 162 163 164 165 168 169 170 171 172 174 17...

result:

ok Correct.

Test #35:

score: 0
Accepted
time: 61ms
memory: 14012kb

input:

300000
174057 170300 127967 188195 297107 239176 86934 110664 58756 117772 263470 88238 79584 102229 51562 191283 179587 208265 231071 228223 159988 22135 31929 219854 295292 209495 110702 140954 43380 201827 180246 217621 16872 95634 24962 72260 32223 274853 166960 284066 94545 43583 269303 137265 ...

output:

300000
1 2 3 5 9 11 14 15 18 19 20 25 27 28 29 30 31 32 34 35 36 37 38 40 43 44 48 49 50 52 53 55 57 58 60 62 64 65 69 70 71 72 77 79 82 84 88 93 94 96 97 98 101 102 104 107 110 111 116 124 125 127 128 129 130 134 140 141 145 146 147 148 151 152 154 156 160 161 163 167 168 170 171 174 175 176 177 17...

result:

ok Correct.