QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#544453#9178. All-You-Can-EatdsbdsbWA 46ms3776kbC++141.7kb2024-09-02 16:51:322024-09-02 16:51:32

Judging History

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

  • [2024-09-02 16:51:32]
  • 评测
  • 测评结果:WA
  • 用时:46ms
  • 内存:3776kb
  • [2024-09-02 16:51:32]
  • 提交

answer

#include<bits/stdc++.h>
#define cfl cout.flush()
#define pb push_back
#define N 1010
using namespace std;
int a[N*10],n,f[N],m=1000,pre[N],sum,used[N*10],ans;
vector<int> op;
vector<int>::iterator it;

int main(){
	int T;
	cin>>T;
	while(T--){
		cin>>n;
		memset(f,0,sizeof f);
		memset(used,0,sizeof used);
		ans=0;
		f[0]=1;
		sum=0;
		int fl=0,fz;
		for(int i=1;i<=n;i++){
			cin>>a[i];
			if(sum>=600&&sum<=1000) fl=1;
			if(fl){
				cout<<"0\nIGNORE\n";
				cfl;
				continue;
			}
			for(int j=m;j>=a[i];j--){
				if(f[j-a[i]]) f[j]=1;
				if(f[j]&&j>ans) ans=j;
			}
			sum+=a[i];
			if(sum>=600&&sum<=1000){
				fl=1;
				cout<<"0\nTAKE\n";
				cfl;
				continue;
			}
			used[i]=1;
			fz=(ans*605/1000)+1;
			fz=sum-fz;
			memset(pre,0,sizeof pre);
			pre[0]=n+1;
			int qfz=0;
			for(int j=1;j<=i;j++) if(used[j]){
				for(int k=fz;k>=a[j];k--) if(pre[k-a[j]]&&!pre[k]) pre[k]=j;
				if(pre[fz]){
					qfz=1;
					break;
				}
			}
//			printf("%d %d %d !!!\n",fz,qfz,sum);
			vector<int>().swap(op);
			if(qfz){
				int cur=fz;
				sum-=cur;
				while(cur){
//					printf("%d %d !\n",cur,pre[cur]);
					used[pre[cur]]=0;
					if(pre[cur]!=i) op.pb(pre[cur]);
					cur-=a[pre[cur]];
				}
			}
			else{
				for(int j=fz;j>=0;j--) if(pre[j]){
					int cur=j;
					sum-=cur;
					while(cur){
//						printf("%d %d !!\n",cur,pre[cur]);
						used[pre[cur]]=0;
						if(pre[cur]!=i) op.pb(pre[cur]);
						cur-=a[pre[cur]];
					}
					break;
				}
			}
			cout<<op.size()<<' ';
			for(auto tt:op) cout<<tt<<' ';
			if(used[i]) cout<<"\nTAKE\n";
			else cout<<"\nIGNORE\n";
			cfl;
		}
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

1
5
10
13
450
585
465

output:

0 
TAKE
0 
TAKE
2 2 1 
TAKE
0 
IGNORE
0
TAKE

result:

ok OK, worst = 0.975480 (1 test case)

Test #2:

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

input:

1
1
100

output:

0 
TAKE

result:

ok OK, worst = 1.000000 (1 test case)

Test #3:

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

input:

2000
5
535
529
536
588
558
5
515
525
599
507
549
5
561
567
504
557
596
5
592
503
549
549
536
5
590
572
589
540
544
5
524
553
545
555
543
5
523
571
577
506
594
5
519
527
521
587
539
5
561
569
573
552
587
5
571
515
585
525
589
5
512
572
565
516
527
5
573
579
564
514
557
5
518
595
509
518
549
5
549
541...

output:

0 
TAKE
1 1 
TAKE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
TAKE
0 
IGNORE
0 
IGNORE
1 1 
TAKE
0 
IGNORE
0 
TAKE
0 
IGNORE
1 1 
TAKE
0 
IGNORE
0 
IGNORE
0 
TAKE
1 1 
TAKE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
TAKE
1 1 
TAKE
0 
IGNORE
1 2 
TAKE
0 
IGNORE
0 
TAKE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
TAKE
0 
I...

result:

ok OK, worst = 0.836394 (2000 test cases)

Test #4:

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

input:

500
20
535
529
536
588
558
515
525
599
507
549
561
567
504
557
596
592
503
549
549
536
20
590
572
589
540
544
524
553
545
555
543
523
571
577
506
594
519
527
521
587
539
20
561
569
573
552
587
571
515
585
525
589
512
572
565
516
527
573
579
564
514
557
20
518
595
509
518
549
549
541
580
535
531
540
...

output:

0 
TAKE
1 1 
TAKE
0 
IGNORE
0 
IGNORE
0 
IGNORE
1 2 
TAKE
0 
IGNORE
0 
IGNORE
1 6 
TAKE
0 
IGNORE
0 
IGNORE
0 
IGNORE
1 9 
TAKE
0 
IGNORE
0 
IGNORE
0 
IGNORE
1 13 
TAKE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
TAKE
1 1 
TAKE
0 
IGNORE
1 2 
TAKE
0 
IGNORE
1 4 
TAKE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
1 6...

result:

ok OK, worst = 0.836394 (500 test cases)

Test #5:

score: 0
Accepted
time: 33ms
memory: 3672kb

input:

200
50
535
529
536
588
558
515
525
599
507
549
561
567
504
557
596
592
503
549
549
536
590
572
589
540
544
524
553
545
555
543
523
571
577
506
594
519
527
521
587
539
561
569
573
552
587
571
515
585
525
589
50
512
572
565
516
527
573
579
564
514
557
518
595
509
518
549
549
541
580
535
531
540
596
51...

output:

0 
TAKE
1 1 
TAKE
0 
IGNORE
0 
IGNORE
0 
IGNORE
1 2 
TAKE
0 
IGNORE
0 
IGNORE
1 6 
TAKE
0 
IGNORE
0 
IGNORE
0 
IGNORE
1 9 
TAKE
0 
IGNORE
0 
IGNORE
0 
IGNORE
1 13 
TAKE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0...

result:

ok OK, worst = 0.836394 (200 test cases)

Test #6:

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

input:

100
100
535
529
536
588
558
515
525
599
507
549
561
567
504
557
596
592
503
549
549
536
590
572
589
540
544
524
553
545
555
543
523
571
577
506
594
519
527
521
587
539
561
569
573
552
587
571
515
585
525
589
512
572
565
516
527
573
579
564
514
557
518
595
509
518
549
549
541
580
535
531
540
596
516
...

output:

0 
TAKE
1 1 
TAKE
0 
IGNORE
0 
IGNORE
0 
IGNORE
1 2 
TAKE
0 
IGNORE
0 
IGNORE
1 6 
TAKE
0 
IGNORE
0 
IGNORE
0 
IGNORE
1 9 
TAKE
0 
IGNORE
0 
IGNORE
0 
IGNORE
1 13 
TAKE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0...

result:

ok OK, worst = 0.836394 (100 test cases)

Test #7:

score: 0
Accepted
time: 35ms
memory: 3752kb

input:

10
1000
535
529
536
588
558
515
525
599
507
549
561
567
504
557
596
592
503
549
549
536
590
572
589
540
544
524
553
545
555
543
523
571
577
506
594
519
527
521
587
539
561
569
573
552
587
571
515
585
525
589
512
572
565
516
527
573
579
564
514
557
518
595
509
518
549
549
541
580
535
531
540
596
516
...

output:

0 
TAKE
1 1 
TAKE
0 
IGNORE
0 
IGNORE
0 
IGNORE
1 2 
TAKE
0 
IGNORE
0 
IGNORE
1 6 
TAKE
0 
IGNORE
0 
IGNORE
0 
IGNORE
1 9 
TAKE
0 
IGNORE
0 
IGNORE
0 
IGNORE
1 13 
TAKE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0...

result:

ok OK, worst = 0.836394 (10 test cases)

Test #8:

score: 0
Accepted
time: 46ms
memory: 3776kb

input:

1
10000
535
529
536
588
558
515
525
599
507
549
561
567
504
557
596
592
503
549
549
536
590
572
589
540
544
524
553
545
555
543
523
571
577
506
594
519
527
521
587
539
561
569
573
552
587
571
515
585
525
589
512
572
565
516
527
573
579
564
514
557
518
595
509
518
549
549
541
580
535
531
540
596
516
...

output:

0 
TAKE
1 1 
TAKE
0 
IGNORE
0 
IGNORE
0 
IGNORE
1 2 
TAKE
0 
IGNORE
0 
IGNORE
1 6 
TAKE
0 
IGNORE
0 
IGNORE
0 
IGNORE
1 9 
TAKE
0 
IGNORE
0 
IGNORE
0 
IGNORE
1 13 
TAKE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0 
IGNORE
0...

result:

ok OK, worst = 0.836394 (1 test case)

Test #9:

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

input:

1
2
2
999

output:

0 
TAKE
1 1 
TAKE

result:

ok OK, worst = 1.000000 (1 test case)

Test #10:

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

input:

100
3
551
450
550
3
552
449
551
3
553
448
552
3
554
447
553
3
555
446
554
3
556
445
555
3
557
444
556
3
558
443
557
3
559
442
558
3
560
441
559
3
561
440
560
3
562
439
561
3
563
438
562
3
564
437
563
3
565
436
564
3
566
435
565
3
567
434
566
3
568
433
567
3
569
432
568
3
570
431
569
3
571
430
570
3
...

output:

0 
TAKE
1 1 
TAKE
0
TAKE
0 
TAKE
1 1 
TAKE
0
TAKE
0 
TAKE
1 1 
TAKE
0
TAKE
0 
TAKE
1 1 
TAKE
0
TAKE
0 
TAKE
1 1 
TAKE
0
TAKE
0 
TAKE
1 1 
TAKE
0
TAKE
0 
TAKE
1 1 
TAKE
0
TAKE
0 
TAKE
1 1 
TAKE
0
TAKE
0 
TAKE
1 1 
TAKE
0
TAKE
0 
TAKE
1 1 
TAKE
0
TAKE
0 
TAKE
1 1 
TAKE
0
TAKE
0 
TAKE
1 1 
TAKE
0
TAKE
...

result:

ok OK, worst = 0.600000 (100 test cases)

Test #11:

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

input:

41
238
1
0
0
4
1
2
0
5
0
5
1
5
2
3
5
1
1
5
5
2
1
3
4
1
5
0
4
1
5
3
1
4
4
1
1
4
2
2
1
0
4
1
5
1
2
4
3
4
0
2
2
0
3
3
4
2
2
1
2
0
3
5
3
3
1
2
4
3
3
3
0
3
1
1
0
4
5
4
1
3
5
2
0
1
0
2
3
0
5
4
5
5
5
1
5
5
5
2
1
4
0
0
4
3
2
5
0
4
1
1
5
3
5
2
3
1
3
3
0
2
3
1
2
3
5
0
5
2
3
5
3
0
3
4
1
0
1
3
1
2
0
4
5
4
3
0
4...

output:

0 
TAKE
0 
TAKE
0 
TAKE
1 1 
TAKE
0 
IGNORE
0 
TAKE
0 
TAKE
1 6 
TAKE
0 
TAKE
0 
TAKE
0 
IGNORE
1 4 
TAKE
0 
TAKE
1 13 
TAKE
0 
TAKE
0 
IGNORE
0 
IGNORE
1 14 
TAKE
0 
TAKE
0 
IGNORE
0 
IGNORE
0 
TAKE
1 22 
TAKE
0 
TAKE
1 24 
TAKE
0 
TAKE
0 
TAKE
0 
IGNORE
1 23 
TAKE
0 
TAKE
0 
IGNORE
0 
TAKE
1 27 
T...

result:

ok OK, worst = 0.751579 (41 test cases)

Test #12:

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

input:

2000
5
174
966
564
649
8
5
58
211
929
70
340
5
481
864
73
407
722
5
181
417
607
419
28
5
429
40
935
257
913
5
387
532
505
446
80
5
187
486
713
23
81
5
61
330
611
918
736
5
939
19
164
889
679
5
847
644
540
944
848
5
618
224
362
561
336
5
504
875
211
808
227
5
104
528
433
537
106
5
997
485
442
729
421...

output:

0 
TAKE
1 1 
TAKE
0
IGNORE
0
IGNORE
0
IGNORE
0 
TAKE
1 1 
TAKE
1 2 
TAKE
0
IGNORE
0
IGNORE
0 
TAKE
1 1 
TAKE
0
IGNORE
0
IGNORE
0
IGNORE
0 
TAKE
1 1 
TAKE
1 2 
TAKE
0
IGNORE
0
IGNORE
0 
TAKE
0 
IGNORE
1 1 
TAKE
0
IGNORE
0
IGNORE
0 
TAKE
0
TAKE
0
IGNORE
0
IGNORE
0
IGNORE
0 
TAKE
0
TAKE
0
IGNORE
0
IGNO...

result:

ok OK, worst = 0.601805 (2000 test cases)

Test #13:

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

input:

500
20
257
850
484
19
260
795
649
823
847
785
883
806
760
527
836
398
717
793
505
920
20
602
270
83
569
324
821
160
88
863
241
365
659
169
329
289
544
486
993
18
131
20
91
3
531
209
146
382
603
943
649
951
599
740
700
668
33
953
491
567
431
124
20
413
889
893
880
489
241
977
840
588
76
499
965
550
1...

output:

0 
TAKE
1 1 
TAKE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
TAKE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGN...

result:

ok OK, worst = 0.601602 (500 test cases)

Test #14:

score: 0
Accepted
time: 11ms
memory: 3700kb

input:

200
50
765
60
167
6
14
909
568
956
634
989
680
921
775
440
340
86
164
753
490
330
489
956
469
611
818
727
668
868
265
772
309
785
478
43
246
707
683
54
53
21
785
999
295
142
836
170
855
273
239
199
50
807
203
169
579
61
866
899
885
826
463
315
416
570
960
724
140
203
583
657
209
81
403
278
829
184
9...

output:

0
TAKE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGN...

result:

ok OK, worst = 0.601000 (200 test cases)

Test #15:

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

input:

100
100
371
754
81
983
173
477
417
930
677
688
917
728
614
592
18
443
31
50
450
875
618
78
331
859
489
750
199
690
916
199
544
781
776
852
134
924
504
454
151
403
437
650
74
380
799
149
711
241
363
651
963
407
536
934
332
807
505
169
253
908
397
754
11
366
2
327
664
188
292
129
758
225
405
778
843
8...

output:

0 
TAKE
1 1 
TAKE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
I...

result:

ok OK, worst = 0.619000 (100 test cases)

Test #16:

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

input:

10
1000
553
578
500
171
123
425
569
562
982
423
854
460
650
46
602
10
608
92
335
209
527
351
70
878
180
393
853
337
384
129
605
156
616
95
108
571
217
289
720
519
415
908
96
572
829
237
556
692
352
544
681
377
543
576
674
496
857
330
817
757
542
995
399
165
54
319
950
456
56
479
62
427
68
723
838
61...

output:

0 
TAKE
0 
IGNORE
1 1 
TAKE
0
TAKE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IG...

result:

ok OK, worst = 0.671000 (10 test cases)

Test #17:

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

input:

1
10000
67
998
689
431
382
267
201
867
717
51
275
497
104
321
860
588
341
979
671
119
801
91
90
879
824
47
811
806
314
189
981
688
551
69
756
283
362
858
837
187
983
930
979
292
225
82
6
681
245
262
650
384
184
607
53
848
707
893
665
901
783
72
197
908
357
606
217
220
405
784
263
781
13
717
301
143
...

output:

0 
TAKE
1 1 
TAKE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
I...

result:

ok OK, worst = 0.998000 (1 test case)

Test #18:

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

input:

2000
5
697
794
850
796
920
5
476
830
763
703
763
5
815
925
804
645
734
5
927
587
888
668
874
5
904
673
978
979
624
5
1000
459
870
739
806
5
876
523
541
902
820
5
594
957
882
847
808
5
643
899
811
641
884
5
218
904
472
838
677
5
703
797
801
785
679
5
861
891
792
789
546
5
960
944
840
972
240
5
931
61...

output:

0
TAKE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0 
TAKE
1 1 
TAKE
0
IGNORE
0
IGNORE
0
IGNORE
0
TAKE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
TAKE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
TAKE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
TAKE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
TAKE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNO...

result:

ok OK, worst = 0.604230 (2000 test cases)

Test #19:

score: 0
Accepted
time: 15ms
memory: 3676kb

input:

500
20
914
849
781
666
924
693
916
765
964
602
988
705
506
798
648
887
991
939
450
771
20
939
678
879
990
905
484
910
914
923
812
705
826
486
924
912
437
794
812
607
853
20
952
891
760
823
653
583
989
534
916
242
959
703
470
714
816
834
882
391
993
915
20
606
987
613
371
443
965
558
678
957
823
743
...

output:

0
TAKE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
TAKE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNOR...

result:

ok OK, worst = 0.605000 (500 test cases)

Test #20:

score: 0
Accepted
time: 11ms
memory: 3668kb

input:

200
50
990
836
878
781
799
968
900
499
839
159
901
945
704
867
401
448
939
851
858
253
615
913
906
764
901
752
975
967
737
753
552
323
746
665
376
884
792
967
970
955
890
944
601
929
788
682
888
979
827
867
50
890
948
832
825
868
702
971
943
676
651
239
618
176
948
287
594
973
742
623
628
893
982
53...

output:

0
TAKE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGN...

result:

ok OK, worst = 0.600000 (200 test cases)

Test #21:

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

input:

100
100
904
904
922
898
769
834
860
790
636
948
610
550
647
942
953
863
390
868
774
554
879
694
918
486
699
653
770
617
674
642
643
901
335
783
955
650
678
954
849
846
979
692
668
888
727
894
922
774
841
125
877
627
527
812
789
362
999
1000
982
702
1000
707
772
942
894
253
456
954
953
907
967
400
97...

output:

0
TAKE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGN...

result:

ok OK, worst = 0.607000 (100 test cases)

Test #22:

score: -100
Wrong Answer
time: 6ms
memory: 3748kb

input:

10
1000
917
931
226
879
806
411
745
895
820
596
505
524
907
121
831
924
706
847
816
919
713
996
615
724
643
850
991
906
696
426
818
528
610
800
446
525
590
960
958
973
739
976
930
991
799
667
761
932
679
911
299
730
886
342
854
894
593
862
309
850
578
480
703
899
803
665
760
876
751
720
662
914
983
...

output:

0
TAKE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGNORE
0
IGN...

result:

wrong output format Unexpected end of file - int32 expected (test case 3)