QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#61017#3890. Corrupted Contest SayedHassan#AC ✓39ms3548kbC++1000b2022-11-09 05:19:032022-11-09 05:19:05

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-11-09 05:19:05]
  • 评测
  • 测评结果:AC
  • 用时:39ms
  • 内存:3548kb
  • [2022-11-09 05:19:03]
  • 提交

answer


#pragma GCC optimize("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx,avx2,fma")
#include <iostream>
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define fi first
#define sc second

const int N=1e5+5;
int n,m;
int c[N],a[N],b[N],p[N];
int main()
{
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    /*cin>>n>>m;
    for(int i=0;i<m;i++)
    {
        cin>>c[i]>>a[i];
        p[c[i]]=a[i];
    }
    for(int i=0;i<n;i++)
    {
        cin>>b[i];
    }*/
    int x;
    cin>>n>>x;
    int a[n],b[n]={0},ans[n]={0},ch=0;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    if(a[n-1])ans[n-1]=1;
    for(int i=n-2;i>=0;i--)
    {
        if(a[i]>a[i+1])
        {
            ans[i]=1;
        }
        ans[i]+=ans[i+1];
        if(a[i]<=a[i+1])ch=1;
    }
    if(ans[0]!=x&&a[0]!=0)cout<<"ambiguous";
    else
    {
        for(int i=0;i<n;i++)cout<<ans[i]<<endl;
    }
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 2ms
memory: 3300kb

input:

9 3
140
75
101
120
30
70
200
0
0

output:

3
2
2
2
1
1
1
0
0

result:

ok 9 lines

Test #2:

score: 0
Accepted
time: 2ms
memory: 3432kb

input:

6 3
100
40
40
50
0
0

output:

ambiguous

result:

ok single line: 'ambiguous'

Test #3:

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

input:

3 3
120
90
100

output:

ambiguous

result:

ok single line: 'ambiguous'

Test #4:

score: 0
Accepted
time: 2ms
memory: 3392kb

input:

5 3
120
90
100
0
0

output:

ambiguous

result:

ok single line: 'ambiguous'

Test #5:

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

input:

10000 100
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
...

output:

ambiguous

result:

ok single line: 'ambiguous'

Test #6:

score: 0
Accepted
time: 18ms
memory: 3428kb

input:

10000 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
...

output:

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
1
1
1
...

result:

ok 10000 lines

Test #7:

score: 0
Accepted
time: 26ms
memory: 3544kb

input:

10000 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
...

output:

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
1
1
1
...

result:

ok 10000 lines

Test #8:

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

input:

10 1
0
0
0
0
0
0
0
0
0
0

output:

0
0
0
0
0
0
0
0
0
0

result:

ok 10 lines

Test #9:

score: 0
Accepted
time: 3ms
memory: 3296kb

input:

10 10
0
0
0
0
0
0
0
0
0
0

output:

0
0
0
0
0
0
0
0
0
0

result:

ok 10 lines

Test #10:

score: 0
Accepted
time: 2ms
memory: 3292kb

input:

10 623
0
0
0
0
0
0
0
0
0
0

output:

0
0
0
0
0
0
0
0
0
0

result:

ok 10 lines

Test #11:

score: 0
Accepted
time: 3ms
memory: 3304kb

input:

10 7843
0
0
0
0
0
0
0
0
0
0

output:

0
0
0
0
0
0
0
0
0
0

result:

ok 10 lines

Test #12:

score: 0
Accepted
time: 2ms
memory: 3244kb

input:

10 10000
0
0
0
0
0
0
0
0
0
0

output:

0
0
0
0
0
0
0
0
0
0

result:

ok 10 lines

Test #13:

score: 0
Accepted
time: 19ms
memory: 3544kb

input:

10000 1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 10000 lines

Test #14:

score: 0
Accepted
time: 32ms
memory: 3444kb

input:

10000 2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 10000 lines

Test #15:

score: 0
Accepted
time: 39ms
memory: 3424kb

input:

10000 10000
1000000
999900
999800
999700
999600
999500
999400
999300
999200
999100
999000
998900
998800
998700
998600
998500
998400
998300
998200
998100
998000
997900
997800
997700
997600
997500
997400
997300
997200
997100
997000
996900
996800
996700
996600
996500
996400
996300
996200
996100
996000
...

output:

10000
9999
9998
9997
9996
9995
9994
9993
9992
9991
9990
9989
9988
9987
9986
9985
9984
9983
9982
9981
9980
9979
9978
9977
9976
9975
9974
9973
9972
9971
9970
9969
9968
9967
9966
9965
9964
9963
9962
9961
9960
9959
9958
9957
9956
9955
9954
9953
9952
9951
9950
9949
9948
9947
9946
9945
9944
9943
9942
9941...

result:

ok 10000 lines

Test #16:

score: 0
Accepted
time: 3ms
memory: 3428kb

input:

10000 10000
100
200
300
400
500
600
700
800
900
1000
1100
1200
1300
1400
1500
1600
1700
1800
1900
2000
2100
2200
2300
2400
2500
2600
2700
2800
2900
3000
3100
3200
3300
3400
3500
3600
3700
3800
3900
4000
4100
4200
4300
4400
4500
4600
4700
4800
4900
5000
5100
5200
5300
5400
5500
5600
5700
5800
5900
60...

output:

ambiguous

result:

ok single line: 'ambiguous'

Test #17:

score: 0
Accepted
time: 16ms
memory: 3480kb

input:

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

output:

100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
...

result:

ok 10000 lines

Test #18:

score: 0
Accepted
time: 2ms
memory: 3312kb

input:

5 5
1
0
0
0
0

output:

ambiguous

result:

ok single line: 'ambiguous'

Test #19:

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

input:

100 10
219839
244348
888161
3455
313371
347073
382213
459260
521701
558334
609009
698988
763403
907120
940396
32868
78193
212702
375557
497856
553951
694880
761389
872057
878294
16742
17635
63475
262382
374557
446009
468191
469901
615924
622175
812998
882510
940041
710795
855850
856767
923862
941765...

output:

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

result:

ok 100 lines

Test #20:

score: 0
Accepted
time: 26ms
memory: 3428kb

input:

10000 100
19242
30844
35997
36109
50208
54064
58218
61881
63531
65651
82390
92636
100260
118046
122963
138488
156813
157026
162497
167170
200644
201471
227550
237620
238737
240073
255130
272698
285974
301755
339349
371231
395666
404941
408916
448220
449479
463772
465749
473523
480653
489574
507317
5...

output:

100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
...

result:

ok 10000 lines

Test #21:

score: 0
Accepted
time: 37ms
memory: 3452kb

input:

10000 100
2021
4410
28813
42286
48302
54140
69114
81856
81950
90271
101650
107042
139182
140002
172418
174632
182164
187656
192892
208405
210450
219067
221943
235745
252179
263915
289787
296923
298988
302088
318672
327177
354655
362641
363648
383868
389172
393206
394650
400535
409718
417583
422845
4...

output:

100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
...

result:

ok 10000 lines

Test #22:

score: 0
Accepted
time: 8ms
memory: 3548kb

input:

10000 1000
209026
228209
253615
405261
427855
741248
780496
932086
951253
978373
888
55460
135373
266605
326163
554430
579873
608204
725672
726938
112240
160372
343338
461006
471265
579534
623130
771223
843923
882266
890068
893491
8908
101662
128894
449385
651587
703827
735266
903344
911671
952873
1...

output:

1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
999
999
999
999
999
999
999
999
999
999
998
998
998
998
998
998
998
998
998
998
998
998
997
997
997
997
997
997
997
997
997
997
996
996
996
996
996
996
996
996
996
996
995
995
995
995
995
995
995
995
995
994
994
994
994
994
994
994
994
994
994
994
99...

result:

ok 10000 lines

Test #23:

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

input:

10000 1
133
280
336
535
594
605
649
672
852
1131
1438
1496
1622
1630
1663
1712
1746
1757
2023
2218
2230
2541
2566
2627
2695
2855
2882
2891
2914
3101
3121
3236
3369
3431
3442
3456
3467
3471
3495
3573
3592
3619
3845
3857
3880
3899
4083
4102
4120
4225
4320
4329
4344
4351
4413
4473
4542
4605
4611
4993
5...

output:

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
1
1
1
...

result:

ok 10000 lines

Test #24:

score: 0
Accepted
time: 14ms
memory: 3424kb

input:

10000 3
57
168
1096
1498
1634
1935
2347
2500
2756
3222
3588
4995
5047
5219
5763
5929
5964
6177
6875
6951
7008
7441
7550
7678
7928
8329
9144
9145
9804
9983
10130
10688
10786
10820
11942
12285
12530
12560
12686
12937
13597
13943
14965
15109
15520
15656
15732
15750
15783
16125
16420
16705
17061
17331
1...

output:

3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
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 10000 lines

Test #25:

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

input:

10000 4957
434888
605451
809982
838837
791189
645016
75986
801324
296787
514734
357114
535793
701115
858814
473509
678353
55784
253344
764567
363814
969201
839444
673513
992734
30144
150920
528297
988258
32481
58515
198264
632343
957336
463118
741149
102422
851274
232342
16161
892167
635258
717233
3...

output:

ambiguous

result:

ok single line: 'ambiguous'

Test #26:

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

input:

10000 4978
3659
5800
5203
3127
3797
3850
6312
7377
9521
1506
3231
1096
7053
5295
7220
3873
444
6639
7530
2444
2698
1499
9157
7673
8346
9905
8966
9044
8258
5499
3036
3030
3515
2
5568
5470
597
9810
4368
7360
1269
8633
664
1135
7765
9623
3950
6630
9342
2958
2284
858
5754
1016
5728
6013
9224
9256
8960
2...

output:

ambiguous

result:

ok single line: 'ambiguous'

Test #27:

score: 0
Accepted
time: 3ms
memory: 3424kb

input:

10000 4936
11
98
51
47
33
11
6
14
28
79
17
60
23
86
9
41
55
93
97
90
54
34
56
91
85
85
16
4
73
18
14
52
30
35
92
34
12
23
7
6
63
16
84
6
26
1
26
44
74
29
27
12
35
72
21
71
45
9
92
22
19
47
35
97
30
5
40
72
43
23
52
92
59
61
55
63
5
52
23
15
47
87
50
44
96
42
78
87
43
96
94
2
25
36
32
33
74
81
54
46
...

output:

ambiguous

result:

ok single line: 'ambiguous'

Test #28:

score: 0
Accepted
time: 3ms
memory: 3496kb

input:

10000 4969
121008
771343
867568
734253
828202
37290
706318
357612
528602
288035
319773
494219
182897
532600
233428
232376
12960
605487
931355
704683
413883
124954
802787
630018
957548
342673
954588
993701
515169
951199
176722
827337
855993
779263
257533
880827
3559
674248
956821
450610
104126
528104...

output:

ambiguous

result:

ok single line: 'ambiguous'

Test #29:

score: 0
Accepted
time: 29ms
memory: 3448kb

input:

10000 4968
277613
609670
590504
85677
289577
119164
117283
63442
653230
437305
81048
963527
48268
384349
493597
572738
738011
434908
735953
676764
677641
733238
752650
979816
735761
375699
259212
918164
37990
688841
381595
886514
164744
297943
697296
454188
671658
861478
317135
433821
491262
654242
...

output:

4968
4968
4967
4966
4966
4965
4964
4963
4963
4962
4961
4961
4960
4960
4960
4960
4960
4959
4959
4958
4958
4958
4958
4958
4957
4956
4955
4955
4954
4954
4953
4953
4952
4952
4952
4951
4951
4951
4950
4950
4950
4950
4949
4949
4948
4948
4947
4947
4946
4946
4945
4945
4944
4944
4943
4942
4942
4942
4941
4941
...

result:

ok 10000 lines

Test #30:

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

input:

10000 4979
207598
217708
764291
614349
583454
36997
572373
842012
144660
964949
150923
284201
802007
458229
575254
139263
815000
908977
723548
455664
568799
328595
540916
927045
893057
352533
378691
601413
531746
87477
640344
512467
276471
93308
602912
672110
381665
839124
439277
470533
550304
76528...

output:

ambiguous

result:

ok single line: 'ambiguous'

Test #31:

score: 0
Accepted
time: 2ms
memory: 3492kb

input:

10000 4952
569831
545036
887291
510332
267880
287278
405586
197272
265320
906718
764148
409975
613438
389583
742551
717722
977916
903712
217839
849352
805549
920042
126549
884195
173923
384551
483613
838987
892398
982846
704644
603837
168841
386409
948044
623040
83712
972467
68287
539494
587135
9437...

output:

ambiguous

result:

ok single line: 'ambiguous'

Test #32:

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

input:

10000 10000
330609
382236
539767
554277
91057
146218
96179
550753
773919
929519
551462
768692
856234
5942
185135
445427
825381
711007
94941
292487
191264
249487
457005
731576
746466
136779
267662
116350
17559
282990
293053
361378
436294
387525
699346
156487
756118
927191
448916
999305
382286
811625
...

output:

ambiguous

result:

ok single line: 'ambiguous'

Test #33:

score: 0
Accepted
time: 2ms
memory: 3300kb

input:

10 9
342
335
231
691
464
117
649
526
231
142

output:

ambiguous

result:

ok single line: 'ambiguous'

Test #34:

score: 0
Accepted
time: 2ms
memory: 3336kb

input:

10 5
288
934
66
383
836
960
501
599
509
624

output:

ambiguous

result:

ok single line: 'ambiguous'

Test #35:

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

input:

100 52
592
970
10
471
175
620
512
823
932
185
624
607
782
491
60
944
879
712
904
270
12
739
119
988
572
515
438
784
114
649
476
487
663
135
117
311
833
591
16
576
283
448
14
910
735
90
534
485
597
288
545
211
73
398
540
777
98
27
260
653
669
385
726
371
802
393
112
571
488
557
69
369
74
11
864
606
4...

output:

ambiguous

result:

ok single line: 'ambiguous'

Test #36:

score: 0
Accepted
time: 2ms
memory: 3304kb

input:

10 5
416
763
133
138
526
171
592
923
757
649

output:

5
5
4
4
4
3
3
3
2
1

result:

ok 10 lines

Test #37:

score: 0
Accepted
time: 2ms
memory: 3248kb

input:

10 5
170
581
450
37
275
323
515
398
358
660

output:

5
5
4
3
3
3
3
2
1
1

result:

ok 10 lines

Test #38:

score: 0
Accepted
time: 2ms
memory: 3364kb

input:

100 47
925
682
303
561
38
797
777
543
533
321
469
114
886
148
545
894
404
580
36
488
814
862
680
904
184
759
384
311
441
225
851
663
114
659
232
996
248
30
880
498
568
689
942
777
733
978
463
879
79
391
894
445
547
852
677
4
721
926
475
486
69
602
768
940
482
852
103
968
97
119
233
478
971
934
832
3...

output:

47
46
45
45
44
44
43
42
41
40
40
39
39
38
38
38
37
37
36
36
36
36
35
35
34
34
33
32
32
31
31
30
29
29
28
28
27
26
26
25
25
25
25
24
23
23
22
22
21
21
21
20
20
20
19
18
18
18
17
17
16
16
16
16
15
15
14
14
13
13
13
13
13
12
11
10
10
9
8
8
7
7
6
6
5
5
5
5
4
4
3
3
3
2
2
1
0
0
0
0

result:

ok 100 lines

Test #39:

score: 0
Accepted
time: 34ms
memory: 3424kb

input:

10000 4928
897879
25265
11526
838864
874781
484537
587240
422761
265554
408861
192156
864675
771481
95053
279780
62659
180685
999686
409816
534632
813186
233139
721848
410632
448185
846660
236972
645755
51919
550698
4950
727721
419879
168068
303887
785723
399970
525939
165127
137715
922808
517690
42...

output:

4928
4927
4926
4926
4926
4925
4925
4924
4923
4923
4922
4922
4921
4920
4920
4919
4919
4919
4918
4918
4918
4917
4917
4916
4916
4916
4915
4915
4914
4914
4913
4913
4912
4911
4911
4911
4910
4910
4909
4908
4908
4907
4906
4906
4906
4905
4904
4904
4904
4904
4903
4903
4902
4902
4901
4900
4899
4898
4898
4898
...

result:

ok 10000 lines

Test #40:

score: 0
Accepted
time: 8ms
memory: 3428kb

input:

10000 4965
3672
4465
6155
1793
8324
7903
38
180
2783
6228
5193
3151
9613
2642
9945
3965
8901
3402
936
9828
4938
468
8641
815
6827
1659
6757
8429
3911
5302
1643
8389
147
2005
7469
3445
1737
2649
5129
2265
1434
7457
8216
9362
2271
4036
2771
9212
7679
9042
490
2291
6995
776
2611
7997
5709
2138
4741
444...

output:

4965
4965
4965
4964
4964
4963
4962
4962
4962
4962
4961
4960
4960
4959
4959
4958
4958
4957
4956
4956
4955
4954
4954
4953
4953
4952
4952
4952
4951
4951
4950
4950
4949
4949
4949
4948
4947
4947
4947
4946
4945
4945
4945
4945
4944
4944
4943
4943
4942
4942
4941
4941
4941
4940
4940
4940
4939
4938
4938
4937
...

result:

ok 10000 lines

Test #41:

score: 0
Accepted
time: 22ms
memory: 3428kb

input:

10000 4918
76
84
78
85
7
38
66
73
16
65
72
19
50
17
77
45
46
71
44
10
36
66
48
29
11
97
4
2
64
88
98
45
2
70
90
10
84
30
12
82
87
33
94
67
75
71
5
68
52
4
38
35
97
70
66
64
75
98
66
29
24
94
48
2
73
6
27
3
41
75
69
26
85
43
93
57
9
84
34
84
62
56
44
93
51
75
70
86
15
31
69
28
3
22
77
71
26
68
65
18
...

output:

4918
4918
4917
4917
4916
4916
4916
4916
4915
4915
4915
4914
4914
4913
4913
4912
4912
4912
4911
4910
4910
4910
4909
4908
4907
4907
4906
4905
4905
4905
4905
4904
4903
4903
4903
4902
4902
4901
4900
4900
4900
4899
4899
4898
4898
4897
4896
4896
4895
4894
4894
4893
4893
4892
4891
4890
4890
4890
4889
4888
...

result:

ok 10000 lines

Test #42:

score: 0
Accepted
time: 3ms
memory: 3480kb

input:

10000 4875
491325
377702
155270
782142
554225
258505
839199
672986
369523
711674
239698
614897
326014
322662
173499
95272
397484
519488
82582
306499
399865
123753
224130
26672
418204
834625
596704
575859
815861
943978
209512
758184
349807
992933
418158
888873
924680
835726
738658
358159
815322
64151...

output:

ambiguous

result:

ok single line: 'ambiguous'

Test #43:

score: 0
Accepted
time: 3ms
memory: 3368kb

input:

10000 4108
801821
24443
570516
705247
36686
873847
94191
183065
388509
611907
697306
277658
601024
903526
583600
383622
545310
102384
355689
760142
646548
665514
70224
463038
758281
718814
417953
212848
892534
214834
933996
919880
46231
218848
30687
939503
496001
783830
706892
780047
912464
16528
73...

output:

ambiguous

result:

ok single line: 'ambiguous'

Test #44:

score: 0
Accepted
time: 8ms
memory: 3356kb

input:

10000 4944
963054
931223
148255
5112
60466
604159
952957
380509
957002
98056
688842
483584
244189
500228
943844
234123
837175
277161
727191
152127
106671
876402
649316
827579
827417
207606
941499
364063
566720
794770
389947
444933
952527
772790
664725
586017
844045
751878
862916
943630
406593
395674...

output:

4944
4943
4942
4941
4941
4941
4941
4940
4940
4939
4939
4938
4937
4937
4937
4936
4936
4935
4935
4934
4933
4933
4932
4932
4931
4930
4930
4929
4929
4929
4928
4928
4928
4927
4926
4925
4925
4924
4924
4924
4923
4922
4922
4921
4921
4920
4920
4919
4918
4918
4917
4917
4916
4916
4916
4915
4914
4914
4913
4913
...

result:

ok 10000 lines

Test #45:

score: 0
Accepted
time: 25ms
memory: 3424kb

input:

10000 1920
291531
762935
193373
380013
687699
198265
790528
656367
412806
78965
955663
193800
802966
548951
218373
276069
750305
499942
737299
614222
478141
202571
931373
773632
355723
777641
548670
809224
42664
696705
874927
141495
511091
168763
157278
107714
425870
253481
846781
501520
188529
7868...

output:

1920
1920
1919
1919
1919
1918
1918
1917
1916
1915
1915
1914
1914
1913
1912
1912
1912
1911
1911
1910
1909
1908
1908
1907
1906
1906
1905
1905
1904
1904
1904
1903
1903
1902
1901
1900
1900
1899
1899
1898
1897
1897
1896
1895
1895
1895
1894
1894
1893
1893
1893
1892
1892
1891
1890
1890
1889
1889
1889
1888
...

result:

ok 10000 lines

Test #46:

score: 0
Accepted
time: 21ms
memory: 3544kb

input:

10000 10000
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 10000 lines

Test #47:

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

input:

1 10
0

output:

0

result:

ok single line: '0'

Test #48:

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

input:

5 2
0
0
0
0
0

output:

0
0
0
0
0

result:

ok 5 lines