QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#614215#957. Assignment Problemship2077AC ✓2521ms4016kbC++23920b2024-10-05 15:55:262024-10-05 15:55:26

Judging History

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

  • [2024-10-05 15:55:26]
  • 评测
  • 测评结果:AC
  • 用时:2521ms
  • 内存:4016kb
  • [2024-10-05 15:55:26]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
constexpr int M=1005;
int n,m,a[M][M],p[M],tmp[M];
bool vis[M],res[M];vector<int>ans;
int read(){
    int x=0;char ch=getchar();
    while (!isdigit(ch)) ch=getchar();
    while (isdigit(ch)) x=x*10+ch-48,ch=getchar();
    return x;
}
int main(){
    n=read();m=read();
    for (int i=1;i<=m;i++)
        for (int j=1;j<=n;j++)
            a[i][j]=read();
    iota(p+1,p+m+1,1);
    while (1){
        for (int i=1;i<=m;i++)
            for (int j=1;j<=n;j++)
                if (!vis[tmp[i]=a[p[i]][j]]){
                    vis[tmp[i]]=res[tmp[i]]=1;break;
                }
        for (int i=1;i<=m;i++) vis[tmp[i]]=0;
        if (!next_permutation(p+1,p+m+1)) break;
    }
    for (int i=1;i<=n;i++)
        if (res[i]) ans.emplace_back(i);
    printf("%d\n",(int)ans.size());
    for (auto x:ans) printf("%d ",x);puts("");
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3784kb

input:

4 2
1 2 4 3
1 3 4 2

output:

3
1 2 3 

result:

ok 4 number(s): "3 1 2 3"

Test #2:

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

input:

4 2
1 4 3 2
2 3 4 1

output:

2
1 2 

result:

ok 3 number(s): "2 1 2"

Test #3:

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

input:

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

output:

6
2 3 4 5 6 10 

result:

ok 7 numbers

Test #4:

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

input:

1000 5
890 508 800 793 148 422 569 817 41 303 52 946 691 273 719 918 920 464 640 596 905 187 425 483 292 290 987 343 145 888 754 348 894 454 818 654 225 688 369 616 785 784 294 485 551 272 798 668 451 565 534 122 809 329 168 772 282 467 112 886 66 965 926 521 836 297 305 386 288 717 255 151 568 43 9...

output:

5
255 279 360 643 890 

result:

ok 6 numbers

Test #5:

score: 0
Accepted
time: 6ms
memory: 3860kb

input:

15 9
11 8 7 15 4 10 12 1 2 3 6 9 14 5 13
15 8 1 3 4 12 10 6 13 7 11 2 5 14 9
10 2 1 8 14 5 12 9 3 4 6 15 11 7 13
6 15 3 8 12 14 1 13 10 11 7 2 5 9 4
9 6 14 10 11 8 2 12 3 7 1 15 4 5 13
8 6 14 13 11 10 9 2 5 3 15 12 4 1 7
8 1 7 6 9 3 11 10 12 14 15 2 5 4 13
6 15 7 9 2 13 1 11 14 4 5 3 10 12 8
2 9 15 ...

output:

11
1 2 3 6 7 8 9 10 11 14 15 

result:

ok 12 numbers

Test #6:

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

input:

1000 9
2 700 292 58 153 387 688 770 589 533 94 442 35 706 75 300 881 898 10 70 377 892 433 313 983 12 494 733 53 179 502 495 44 606 539 647 646 672 520 69 997 239 403 426 944 18 979 81 782 133 671 792 336 327 630 38 821 775 456 25 852 656 711 16 529 169 935 318 140 550 759 471 250 546 742 951 440 35...

output:

9
2 185 383 431 439 728 852 921 983 

result:

ok 10 numbers

Test #7:

score: 0
Accepted
time: 94ms
memory: 3820kb

input:

15 10
12 8 15 3 7 1 5 10 11 2 13 6 4 9 14
3 12 14 9 4 8 2 10 13 7 6 15 5 1 11
10 12 15 7 11 2 6 8 13 9 14 5 1 4 3
6 1 4 8 7 5 9 10 14 2 13 3 12 15 11
4 6 2 10 1 11 9 14 13 7 5 15 8 3 12
12 10 7 5 6 11 1 13 14 15 4 8 3 9 2
15 5 4 7 9 2 1 13 11 12 3 10 14 8 6
1 8 2 15 9 4 14 5 10 7 3 6 12 13 11
7 11 9...

output:

14
1 2 3 4 5 6 7 8 9 10 11 12 13 15 

result:

ok 15 numbers

Test #8:

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

input:

1000 10
22 671 550 260 689 981 935 62 270 596 224 202 156 937 715 520 812 378 400 702 546 517 344 236 235 949 109 282 294 106 652 956 994 380 366 830 810 283 95 304 231 750 728 189 495 388 170 348 64 462 522 674 307 309 752 371 919 384 430 313 377 39 35 237 941 310 976 497 234 683 817 525 989 514 73...

output:

10
22 247 521 534 590 658 671 682 763 820 

result:

ok 11 numbers

Test #9:

score: 0
Accepted
time: 1357ms
memory: 3816kb

input:

15 11
12 2 3 6 15 10 8 1 7 5 13 14 11 4 9
14 9 10 8 3 5 15 13 1 7 11 6 2 4 12
13 10 14 6 12 3 11 7 5 15 2 9 4 1 8
2 7 1 8 10 5 12 15 13 6 3 9 4 11 14
2 15 11 12 3 6 5 8 9 7 4 14 13 1 10
15 2 5 4 1 14 3 9 13 8 11 6 12 10 7
6 3 5 7 10 13 9 2 11 15 4 14 1 8 12
9 15 1 13 4 3 2 5 8 7 12 14 11 10 6
7 13 1...

output:

15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 

result:

ok 16 numbers

Test #10:

score: 0
Accepted
time: 758ms
memory: 4016kb

input:

1000 11
780 479 30 770 201 920 302 972 558 420 542 251 706 46 232 559 713 222 477 633 791 957 740 202 314 837 353 928 724 265 589 357 458 673 332 910 429 946 714 697 110 206 561 855 22 216 994 423 882 830 564 149 987 930 921 409 1000 329 551 708 878 993 33 480 67 787 700 826 412 927 735 854 829 229 ...

output:

11
111 224 285 384 431 508 516 708 780 803 955 

result:

ok 12 numbers

Test #11:

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

input:

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

output:

5
1 2 3 4 5 

result:

ok 6 numbers

Test #12:

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

input:

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

output:

5
1 2 3 4 5 

result:

ok 6 numbers

Test #13:

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

input:

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

output:

7
1 2 4 5 8 9 10 

result:

ok 8 numbers

Test #14:

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

input:

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

output:

5
2 3 7 9 10 

result:

ok 6 numbers

Test #15:

score: 0
Accepted
time: 13ms
memory: 3896kb

input:

20 9
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1...

output:

9
1 2 3 4 5 6 7 8 9 

result:

ok 10 numbers

Test #16:

score: 0
Accepted
time: 13ms
memory: 3820kb

input:

20 9
2 3 4 1 5 9 8 6 7 10 11 12 13 14 15 16 17 18 19 20
1 2 9 6 5 8 3 7 4 10 11 12 13 14 15 16 17 18 19 20
9 2 8 5 6 3 4 1 7 10 11 12 13 14 15 16 17 18 19 20
8 5 4 3 9 1 2 7 6 10 11 12 13 14 15 16 17 18 19 20
2 6 7 4 8 9 3 1 5 10 11 12 13 14 15 16 17 18 19 20
7 6 1 8 9 3 4 2 5 10 11 12 13 14 15 16 1...

output:

9
1 2 3 4 5 6 7 8 9 

result:

ok 10 numbers

Test #17:

score: 0
Accepted
time: 9ms
memory: 3828kb

input:

20 9
1 2 3 15 16 11 6 8 7 10 4 9 13 17 12 5 14 18 19 20
1 19 3 2 5 6 16 18 9 10 11 13 4 8 15 7 14 12 20 17
10 5 18 4 13 6 12 3 14 1 20 11 2 9 7 16 17 8 19 15
7 8 10 4 5 9 20 2 6 16 11 12 15 14 3 18 1 13 19 17
1 12 8 13 5 6 4 3 14 17 20 2 10 9 15 16 18 19 7 11
6 14 3 20 5 7 1 8 2 10 18 11 13 9 12 16 ...

output:

10
1 2 3 6 7 9 10 12 18 19 

result:

ok 11 numbers

Test #18:

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

input:

20 9
12 5 2 19 3 1 7 13 16 6 11 14 9 4 15 10 17 18 8 20
16 8 20 6 7 15 19 3 1 12 4 9 13 10 14 18 17 5 2 11
14 16 8 3 12 1 15 4 7 9 11 6 13 5 20 2 17 18 19 10
1 6 8 17 3 15 7 9 18 10 4 5 12 14 2 11 16 13 19 20
1 17 4 6 9 20 3 2 7 14 8 11 16 10 15 13 5 18 19 12
13 5 8 3 17 2 7 10 11 1 20 18 14 12 6 16...

output:

14
1 2 3 4 5 6 7 8 12 13 14 16 17 20 

result:

ok 15 numbers

Test #19:

score: 0
Accepted
time: 196ms
memory: 3796kb

input:

20 10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ...

output:

10
1 2 3 4 5 6 7 8 9 10 

result:

ok 11 numbers

Test #20:

score: 0
Accepted
time: 275ms
memory: 3836kb

input:

20 10
6 8 4 7 9 3 10 1 2 5 11 12 13 14 15 16 17 18 19 20
8 6 2 10 1 5 3 9 7 4 11 12 13 14 15 16 17 18 19 20
6 3 8 1 2 9 5 10 4 7 11 12 13 14 15 16 17 18 19 20
3 10 8 9 2 6 7 4 5 1 11 12 13 14 15 16 17 18 19 20
8 4 6 2 9 7 5 10 1 3 11 12 13 14 15 16 17 18 19 20
6 8 1 2 4 5 9 10 3 7 11 12 13 14 15 16 ...

output:

10
1 2 3 4 5 6 7 8 9 10 

result:

ok 11 numbers

Test #21:

score: 0
Accepted
time: 79ms
memory: 3936kb

input:

20 10
1 2 10 14 5 12 7 8 9 15 11 6 19 18 4 16 17 20 13 3
1 15 9 4 5 2 14 8 3 16 18 12 13 7 6 17 19 11 10 20
13 2 3 9 18 14 1 5 4 10 8 7 12 6 15 16 17 11 19 20
15 2 17 5 20 6 7 3 9 4 11 12 13 14 8 16 10 18 19 1
12 11 9 4 6 1 15 10 13 8 2 3 17 14 7 16 5 18 19 20
5 12 4 9 16 15 7 6 3 10 1 2 8 14 17 11 ...

output:

12
1 2 3 4 5 8 9 10 12 13 15 17 

result:

ok 13 numbers

Test #22:

score: 0
Accepted
time: 81ms
memory: 3888kb

input:

20 10
8 1 9 13 12 15 6 3 4 2 14 18 20 7 5 11 17 16 19 10
8 7 18 4 11 2 5 20 12 1 9 6 3 14 15 16 19 13 10 17
20 14 16 9 2 13 10 3 8 6 12 5 1 7 15 19 17 18 4 11
14 4 5 6 10 12 7 18 9 2 11 8 1 13 15 20 17 19 16 3
2 1 19 18 8 3 10 14 7 17 11 5 13 6 16 15 12 4 9 20
20 18 2 1 14 4 3 6 9 8 11 15 13 17 16 1...

output:

14
1 2 4 5 7 8 9 10 11 12 14 16 18 20 

result:

ok 15 numbers

Test #23:

score: 0
Accepted
time: 196ms
memory: 3896kb

input:

100 10
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:

10
1 2 3 4 5 6 7 8 9 10 

result:

ok 11 numbers

Test #24:

score: 0
Accepted
time: 209ms
memory: 3836kb

input:

100 10
4 9 5 10 3 7 8 6 1 2 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
8...

output:

10
1 2 3 4 5 6 7 8 9 10 

result:

ok 11 numbers

Test #25:

score: 0
Accepted
time: 180ms
memory: 3864kb

input:

100 10
1 2 3 4 5 6 7 8 9 89 11 12 13 14 15 16 17 18 19 20 21 71 23 24 25 26 27 28 29 100 31 32 33 34 35 36 37 38 39 70 41 42 43 44 45 74 47 48 50 49 51 52 82 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 78 22 72 73 46 75 76 77 40 79 80 81 53 93 84 85 86 87 88 10 90 83 92 91 94 95 96 97 98 99 30
1...

output:

17
1 2 3 4 5 6 7 8 9 24 28 39 46 54 62 77 80 

result:

ok 18 numbers

Test #26:

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

input:

100 10
3 9 8 1 6 10 4 2 59 49 50 12 31 14 15 16 17 18 19 86 21 13 23 24 25 26 22 28 29 30 27 32 33 34 35 36 89 38 39 40 41 42 43 44 45 65 47 48 7 11 51 52 85 54 55 56 57 58 5 60 61 62 63 64 46 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 53 20 87 88 37 90 91 92 93 94 95 96 97 98 99 100
5...

output:

13
1 3 5 6 7 8 9 10 13 24 34 64 92 

result:

ok 14 numbers

Test #27:

score: 0
Accepted
time: 67ms
memory: 3880kb

input:

100 10
89 99 13 33 31 56 100 44 22 88 14 62 66 94 57 16 74 71 86 20 70 9 10 24 26 11 4 53 40 65 49 17 29 12 78 36 58 69 39 90 41 42 34 5 93 60 97 27 23 50 96 8 43 67 37 28 47 85 2 92 51 61 95 7 68 80 46 54 18 64 75 83 84 25 15 76 98 82 19 72 81 35 3 73 79 59 87 55 38 1 91 30 45 77 6 63 21 32 52 48
9...

output:

11
1 5 14 21 38 41 65 79 89 98 99 

result:

ok 12 numbers

Test #28:

score: 0
Accepted
time: 57ms
memory: 3820kb

input:

100 10
48 96 11 31 37 24 30 98 8 25 74 12 84 64 4 36 23 46 93 91 35 100 26 89 45 58 34 69 80 50 63 56 94 13 7 15 38 19 62 51 77 81 57 65 55 41 47 1 49 71 92 20 90 54 28 22 39 99 83 60 61 72 87 9 68 29 53 66 21 70 79 17 40 16 75 76 82 5 33 2 42 67 52 78 85 86 14 88 73 43 6 44 18 32 95 3 97 10 59 27
8...

output:

10
4 8 18 19 48 58 61 80 83 94 

result:

ok 11 numbers

Test #29:

score: 0
Accepted
time: 63ms
memory: 3896kb

input:

100 10
90 77 6 20 11 67 22 82 27 80 19 75 92 71 48 12 36 1 49 66 25 50 86 43 37 99 34 8 26 93 79 55 95 13 33 10 4 85 98 7 69 9 16 78 81 59 52 68 2 31 88 21 97 42 35 87 73 61 57 74 62 5 17 38 58 54 32 40 47 39 18 30 65 24 15 63 44 51 60 89 83 70 84 3 72 94 23 91 56 76 28 100 41 14 96 64 29 53 46 45
9...

output:

11
1 2 19 39 40 41 53 69 85 90 94 

result:

ok 12 numbers

Test #30:

score: 0
Accepted
time: 68ms
memory: 3876kb

input:

100 10
68 45 21 94 25 91 54 3 11 37 98 1 64 52 7 97 99 61 5 49 53 79 56 84 26 41 29 73 88 71 19 100 40 13 55 15 4 36 14 87 57 48 12 44 43 89 34 74 17 27 42 78 35 28 77 22 6 47 63 67 83 85 59 20 18 50 96 51 39 10 33 82 90 62 46 31 70 95 81 8 80 75 60 76 32 72 38 2 16 58 30 69 86 24 23 93 65 9 66 92
7...

output:

11
5 10 19 24 66 68 69 73 74 75 98 

result:

ok 12 numbers

Test #31:

score: 0
Accepted
time: 2350ms
memory: 3948kb

input:

20 11
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ...

output:

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

result:

ok 12 numbers

Test #32:

score: 0
Accepted
time: 2303ms
memory: 4012kb

input:

20 11
1 11 2 5 8 9 7 4 3 6 10 12 13 14 15 16 17 18 19 20
4 6 1 5 9 11 2 10 3 7 8 12 13 14 15 16 17 18 19 20
9 1 3 2 4 6 10 5 7 11 8 12 13 14 15 16 17 18 19 20
10 7 6 1 2 9 4 8 11 3 5 12 13 14 15 16 17 18 19 20
5 4 7 6 1 2 10 11 8 9 3 12 13 14 15 16 17 18 19 20
5 3 9 6 2 4 10 11 7 1 8 12 13 14 15 16 ...

output:

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

result:

ok 12 numbers

Test #33:

score: 0
Accepted
time: 2245ms
memory: 3880kb

input:

20 11
17 2 6 16 5 3 20 7 9 10 11 19 13 14 15 4 1 18 12 8
3 2 4 1 13 9 7 8 12 10 20 15 5 11 14 16 17 6 19 18
1 19 17 4 10 13 7 15 9 14 11 8 2 12 6 16 3 18 5 20
1 11 3 13 16 6 7 18 9 10 14 12 17 2 15 8 5 4 19 20
17 2 3 4 5 7 11 20 13 16 14 12 15 18 10 9 1 6 19 8
1 2 3 10 4 6 7 11 9 5 13 12 8 14 15 20 ...

output:

18
1 2 3 4 5 6 7 9 10 11 12 13 14 16 17 18 19 20 

result:

ok 19 numbers

Test #34:

score: 0
Accepted
time: 1168ms
memory: 3904kb

input:

20 11
4 14 9 12 7 17 11 5 6 8 2 3 18 1 15 16 10 13 19 20
20 3 4 1 18 19 14 5 9 17 8 12 13 6 15 16 11 2 7 10
18 9 4 1 11 7 10 5 20 14 8 19 13 15 3 16 17 2 12 6
5 13 12 6 10 1 8 3 15 9 2 4 18 7 11 16 17 14 19 20
16 13 2 1 17 11 7 6 10 9 5 12 3 14 15 4 8 18 20 19
19 4 12 13 20 11 1 7 10 14 6 3 8 9 15 1...

output:

15
2 3 4 5 7 8 9 11 12 13 14 16 18 19 20 

result:

ok 16 numbers

Test #35:

score: 0
Accepted
time: 2337ms
memory: 3812kb

input:

100 11
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:

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

result:

ok 12 numbers

Test #36:

score: 0
Accepted
time: 2521ms
memory: 3892kb

input:

100 11
5 7 10 6 11 1 8 4 2 3 9 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
9...

output:

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

result:

ok 12 numbers

Test #37:

score: 0
Accepted
time: 1975ms
memory: 3888kb

input:

100 11
1 2 77 4 5 91 7 8 9 10 11 12 13 14 15 16 17 3 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 40 35 36 37 38 39 34 41 42 43 93 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 92 94 84 64 65 66 67 68 69 70 71 72 73 74 75 76 18 78 79 95 81 82 83 63 85 61 87 88 89 90 6 86 44 62 80 96 97 98 99 100
1...

output:

16
1 2 3 4 5 6 11 12 24 40 50 57 61 77 93 98 

result:

ok 17 numbers

Test #38:

score: 0
Accepted
time: 1500ms
memory: 3896kb

input:

100 11
3 7 1 10 2 8 88 11 9 89 4 12 13 14 15 16 17 18 19 20 21 47 5 24 25 26 27 28 29 30 31 32 33 34 22 36 37 38 39 40 41 42 43 44 45 46 35 48 49 50 80 52 98 54 55 56 57 58 59 60 61 62 99 51 65 66 67 68 69 70 71 72 73 74 75 76 77 6 79 64 81 82 83 84 85 86 87 23 78 90 91 92 93 94 95 96 97 53 63 100
2...

output:

16
1 2 3 4 5 7 8 9 10 11 55 72 74 88 89 94 

result:

ok 17 numbers

Test #39:

score: 0
Accepted
time: 822ms
memory: 3828kb

input:

100 11
2 87 95 49 39 44 45 26 34 4 8 19 40 55 10 57 99 50 94 16 79 78 5 69 25 23 81 27 29 91 31 64 62 96 53 9 74 15 20 13 72 42 85 22 38 46 47 75 63 66 52 65 18 54 37 58 88 98 68 89 90 33 77 11 61 6 67 100 24 70 71 93 36 32 60 28 73 17 86 43 14 84 41 59 80 1 35 12 56 83 30 92 21 97 7 3 51 48 76 82
6...

output:

13
1 2 16 18 21 22 32 41 62 71 72 81 87 

result:

ok 14 numbers

Test #40:

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

input:

100 11
36 41 31 39 19 82 56 65 45 17 18 89 13 14 96 74 12 40 76 20 97 6 34 77 57 8 60 3 29 50 53 32 44 15 10 72 21 63 23 79 38 2 75 55 42 84 16 48 61 52 4 59 86 80 92 64 54 24 30 46 83 62 22 1 51 66 67 68 69 70 11 43 73 35 47 25 27 78 94 26 81 37 5 99 85 98 9 88 58 90 91 28 93 95 71 87 49 33 7 100
5...

output:

11
5 13 19 36 39 57 58 74 75 87 91 

result:

ok 12 numbers

Test #41:

score: 0
Accepted
time: 757ms
memory: 3944kb

input:

100 11
34 45 39 27 5 63 38 74 100 79 21 30 80 7 47 84 96 11 83 67 16 59 57 94 62 58 10 89 20 43 82 66 23 85 42 25 75 98 35 51 88 44 86 40 54 28 46 95 17 77 64 48 91 18 92 97 52 41 61 4 53 36 90 13 76 14 65 81 73 2 8 24 49 87 70 26 99 9 15 37 60 69 33 55 22 93 71 78 68 29 32 19 12 50 56 31 1 3 6 72
4...

output:

11
11 23 31 34 40 49 63 65 88 96 99 

result:

ok 12 numbers

Test #42:

score: 0
Accepted
time: 788ms
memory: 3904kb

input:

100 11
46 7 34 12 75 33 99 92 41 45 10 1 47 78 8 84 3 36 16 18 17 6 49 35 5 25 65 80 86 37 48 97 90 4 58 19 77 54 67 98 82 79 23 94 100 27 95 81 43 51 91 87 32 70 31 85 53 83 39 61 11 73 57 93 69 64 20 40 28 50 22 62 88 24 9 21 2 76 42 56 15 13 52 44 68 30 71 29 60 38 63 96 66 72 74 59 55 89 14 26
2...

output:

12
1 2 4 7 19 25 39 46 49 88 96 97 

result:

ok 13 numbers