QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#275265#7255. Mirror Rice CakePetroTarnavskyi#AC ✓1ms3852kbC++17734b2023-12-04 15:57:212023-12-04 15:57:21

Judging History

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

  • [2023-12-04 15:57:21]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3852kb
  • [2023-12-04 15:57:21]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (a) - 1; i >= (b); i--)
#define SZ(a) int(a.size())
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair
#define F first
#define S second

typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef double db;

int main()
{
	ios::sync_with_stdio(0); 
	cin.tie(0);
	cout << fixed << setprecision(15);
	
	int n;
	cin >> n;
	VI a(n);
	FOR (i, 0, n)
		cin >> a[i];
	sort(ALL(a));
	int ans = 1;
	int w = a[0];
	FOR (i, 1, n)
	{
		if (a[i] > w)
		{
			ans++;
			w += a[i];
		}
	}
	cout << ans << '\n';
	
	return 0;
}

詳細信息

Test #1:

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

input:

5
3
20
5
8
6

output:

3

result:

ok 1 number(s): "3"

Test #2:

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

input:

1000
158260522
877914575
602436426
24979445
861648772
623690081
433933447
476190629
262703497
211047202
971407775
628894325
731963982
822804784
450968417
430302156
982631932
161735902
880895728
923078537
707723857
189330739
910286918
802329211
404539679
303238506
317063340
492686568
773361868
125660...

output:

10

result:

ok 1 number(s): "10"

Test #3:

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

input:

1000
45040819
396372436
192743672
274510571
294644795
555455549
103001554
591393967
276199215
381260289
94522925
166366019
598676141
352552583
383983969
803740119
332695015
465810281
453651993
16317200
82588835
449910518
111213781
583796616
864295865
108639920
600358504
837993545
411177881
311160783...

output:

12

result:

ok 1 number(s): "12"

Test #4:

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

input:

1000
867388127
567952131
284014204
219367823
743290350
790730849
46151798
557421806
968015100
639013783
92703079
168873244
143854382
978869074
12645167
199275284
841102015
911889783
270379521
338838593
888152443
257784218
637371622
466080515
105333573
448010120
523769912
983858481
433637009
77018258...

output:

10

result:

ok 1 number(s): "10"

Test #5:

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

input:

1000
918777630
829339828
327407446
59016652
24136495
937226054
444700946
11274347
272186018
814502780
806607116
440383531
648692899
143628108
91236267
994157516
298950772
583535841
952914090
922692995
598401515
336268058
654449562
799300472
597289970
112095752
573246046
375430215
854602502
655427444...

output:

9

result:

ok 1 number(s): "9"

Test #6:

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

input:

1000
146613794
717202305
567545928
645225161
261935056
560586662
28741001
740168304
904844049
997161610
296436766
494386647
121532187
473384301
669795062
143593865
519771192
518492865
915754325
148990591
539977285
150426797
20009810
573128877
623991603
895374220
298698330
266594166
748519306
4590669...

output:

11

result:

ok 1 number(s): "11"

Test #7:

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

input:

1000
531983835
919621442
788251475
120974064
897130208
39422840
729645820
988992901
880943226
639409370
206327006
853313227
436119528
3315182
88547954
628338962
876948603
796263792
690899586
971771424
800157720
83006670
240795568
236960173
597886905
153112235
95610094
487455717
664980972
47331164
23...

output:

12

result:

ok 1 number(s): "12"

Test #8:

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

input:

1000
506764666
208797457
675037624
666369513
606480049
950237687
799361482
944485747
90205263
98076100
850893004
23485678
672586651
860903496
760415422
53834355
693277422
940084359
861479924
288914574
178183222
288004405
720152468
642558144
861624692
88798014
386020379
156082174
272560446
819937857
...

output:

12

result:

ok 1 number(s): "12"

Test #9:

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

input:

1000
558851953
294181191
232279031
994277535
806230228
242356634
392569237
759077188
647382337
839451618
394957994
425569130
389580806
670699829
281803197
170898162
557747843
702500061
393150121
55222577
850854064
982768859
88301343
598659439
439001494
184670815
639196962
407488361
559045073
1038352...

output:

11

result:

ok 1 number(s): "11"

Test #10:

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

input:

1000
144565105
297082236
959945170
761436985
26703386
942397980
34444607
563830080
499260736
541430540
901877369
20531880
829327928
462769324
131721871
857770266
736552811
519584398
837938917
104255155
229551319
223954937
468101554
181717124
334388367
83249255
494300803
410445073
491594038
521952263...

output:

10

result:

ok 1 number(s): "10"

Test #11:

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

input:

1000
903228522
218269834
284790346
766727969
121187476
351913076
788725992
904838896
750978941
242761308
239150457
683280464
961808003
109322215
684725653
691478195
766974742
183595761
81063975
353263357
850172732
517541896
526901231
302888967
236356112
681508078
495884288
638416157
645334079
765848...

output:

10

result:

ok 1 number(s): "10"

Test #12:

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

input:

373
301
239
89
583
341
685
462
834
615
596
89
280
232
453
667
333
16
601
44
680
377
561
778
523
514
274
748
735
669
577
675
293
766
747
488
467
478
776
652
619
209
743
667
491
128
484
34
204
68
430
238
363
765
233
766
63
47
733
448
120
609
813
236
322
621
309
168
464
30
844
274
782
398
735
781
447
3...

output:

9

result:

ok 1 number(s): "9"

Test #13:

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

input:

108
345
232
1420
21
1082
503
1333
411
1583
548
523
620
862
484
1356
1566
117
1697
282
797
339
313
293
833
288
300
1325
821
1113
729
827
274
1045
378
113
1090
1490
987
1757
1685
1392
1519
979
1751
604
1547
496
272
591
489
311
1618
413
1055
464
167
1215
909
1380
1577
1553
731
787
504
1708
216
974
632
...

output:

8

result:

ok 1 number(s): "8"

Test #14:

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

input:

692
2985
621
1431
2965
2153
2447
2697
306
1043
725
247
182
1184
3152
2308
908
2045
1927
2649
837
3373
1621
672
2902
2357
1321
2169
247
2607
100
200
245
951
687
2325
1696
2257
450
986
1198
3521
30
937
1286
2689
2916
2468
1670
719
172
35
2462
444
319
2498
2483
2974
829
3343
1549
238
2504
464
3064
2811...

output:

11

result:

ok 1 number(s): "11"

Test #15:

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

input:

11
2564
6285
467
5928
4226
216
1615
872
2929
6858
2417

output:

5

result:

ok 1 number(s): "5"

Test #16:

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

input:

376
4952
9467
937
4169
1521
7221
5597
8003
364
12634
1188
5085
457
3835
4684
4038
7106
2242
4245
13951
10047
2794
10420
3423
5023
3969
1361
4110
12662
13997
1673
9226
905
6500
3692
485
13524
9394
12160
3716
5956
10231
10172
3425
8830
4390
10574
8331
7958
12616
11734
10529
12569
6455
3112
987
14147
9...

output:

10

result:

ok 1 number(s): "10"

Test #17:

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

input:

518
15428
2288
25306
17526
8730
11241
18540
26658
8586
19700
17051
7132
22273
3575
21998
1843
1853
15689
21503
3562
23763
17848
250
25463
24233
26244
14113
18821
6653
1121
7370
18930
15708
6521
9439
28370
12972
3816
28253
12522
6306
28094
11862
18357
25165
24449
20463
19043
17161
18600
482
10453
146...

output:

9

result:

ok 1 number(s): "9"

Test #18:

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

input:

372
33927
24034
22875
53110
24472
46931
20508
41324
31894
3033
4477
14062
8003
50570
56266
7084
13334
6987
11844
17510
53435
4952
22688
50033
39823
6851
51335
3641
4645
44780
9492
32953
3779
45838
35929
1796
18149
41651
1498
4032
10425
41530
36367
10150
32674
29016
24807
516
40374
38291
31552
57402
...

output:

9

result:

ok 1 number(s): "9"

Test #19:

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

input:

328
69537
91886
96088
2279
100327
28399
1910
98878
52763
112861
20844
83285
74069
54698
94252
19335
70658
4026
20796
63201
44129
84325
64308
109223
71941
36217
28227
30160
46934
90039
50347
67461
53775
15698
48961
59302
42945
883
7662
57669
37711
41911
101424
20776
50801
26799
101273
48203
10801
850...

output:

8

result:

ok 1 number(s): "8"

Test #20:

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

input:

927
170132
137522
192937
226821
217366
146389
37329
107838
40045
211882
204243
55083
85298
40842
39219
101024
114801
78819
222504
45379
146476
94518
23323
137745
85461
189082
217900
32730
35032
103478
79533
104384
139535
12746
79525
185276
75084
61735
111182
156953
37331
34994
3479
61175
107228
2104...

output:

11

result:

ok 1 number(s): "11"

Test #21:

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

input:

606
42720
292848
198021
247036
294142
341629
192453
314416
356915
314084
311602
410704
305206
442400
68205
383568
193332
25277
240077
37369
99407
135006
200157
29797
252954
291128
63451
390789
378142
137364
149051
90011
370265
178513
175907
274368
187834
325983
62188
28255
232102
442181
89767
20664
...

output:

10

result:

ok 1 number(s): "10"

Test #22:

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

input:

226
502190
800485
347762
207681
170291
879282
606733
240620
286044
778052
215626
340322
734888
361781
330754
899366
530925
736143
29090
299630
267984
723541
600493
86181
241229
834811
304439
921065
276789
142568
759403
236941
20139
658427
683783
245401
572071
352003
192219
249413
263283
194630
82388...

output:

8

result:

ok 1 number(s): "8"

Test #23:

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

input:

609
657102
891486
286553
379028
1066314
1485833
642563
1215956
57333
964722
747677
49370
1375665
273614
1637782
338547
557844
1215779
1220684
942978
496872
1448655
832404
156540
1002158
461567
541753
1375978
45334
1117497
1553269
1627626
580744
582099
1651065
512687
1117086
139385
493547
137213
9240...

output:

11

result:

ok 1 number(s): "11"

Test #24:

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

input:

783
2098434
2784982
3613503
2435454
2819130
3431579
2219556
3272388
3206642
50893
2331800
237075
3167094
2544665
334866
1730387
3335944
2271042
1033790
324544
3024475
368028
619385
769129
2970904
1428883
587094
274610
1951580
1627426
3571995
1109203
2505784
2062429
3535428
3522646
657456
1478631
339...

output:

11

result:

ok 1 number(s): "11"

Test #25:

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

input:

118
2766721
7070081
7233702
5365794
634321
3051375
1908475
1781211
4410756
224689
676714
4477292
6386102
5175621
1616441
734732
2539640
3536187
4740580
1694279
628046
3316025
2662809
2188925
3161008
6819834
5657530
6460258
1374604
1492426
2252895
3334268
1927618
1672972
4189137
5020329
2205351
23221...

output:

9

result:

ok 1 number(s): "9"

Test #26:

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

input:

146
3708984
791646
7807954
4199077
14383125
6157320
10076211
7329083
151888
3579147
5196956
8666766
5230243
4221595
12730339
4547708
12884639
257506
6732274
3571224
5244454
5519483
7148102
9459242
3538673
11138809
1422960
6852010
8803851
7691102
6314135
6860360
13391443
13031332
13004277
5311719
961...

output:

7

result:

ok 1 number(s): "7"

Test #27:

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

input:

870
11222971
26717428
17273204
16263835
25723790
13658218
5100077
15043962
6750564
19067106
18950306
12260426
8487276
27603902
15314252
11632324
9168649
28397231
2921239
24505909
1958737
247359
19890661
14877696
2062222
9964616
15909128
17518618
26298305
28923515
1061324
2559884
27049242
20956379
27...

output:

10

result:

ok 1 number(s): "10"

Test #28:

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

input:

981
2796044
20732369
8233748
52402103
15015250
9008262
46078097
38875621
53577681
42012791
44483491
38566988
38948279
44567706
9288115
33376940
21679941
45839386
37304699
22391865
11229009
39211221
47120779
45245981
33577413
16731614
5109448
7618036
13828638
48769532
42539752
20452430
55644654
45414...

output:

12

result:

ok 1 number(s): "12"

Test #29:

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

input:

542
898308
20465811
1370046
42586062
90943530
61910563
6221035
98962952
10300346
63618604
99188086
43578792
45545342
74033012
43152963
26155291
111506712
69054642
7737164
95890950
42827385
99861268
115845662
14139325
46898283
19121338
43905116
84980172
30117129
508728
63193659
117609074
47848002
108...

output:

11

result:

ok 1 number(s): "11"

Test #30:

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

input:

726
93482891
113130628
150082529
108549242
187399536
126989558
187094846
66965134
79343829
147614767
219020088
204208940
192438549
45072538
70479414
14913498
22166077
21747318
201099920
226103601
9805713
90898008
22421778
163914078
156491272
9661351
7951230
174136995
150613707
201931551
194068231
13...

output:

11

result:

ok 1 number(s): "11"

Test #31:

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

input:

964
42136863
282990515
283317962
408661407
234861374
146145286
51750210
433976502
40419081
335698801
142428176
30331361
340460586
144732873
80811992
45728893
322133470
352492179
100598290
181919451
368932215
467301771
123342729
40612030
210759898
24708895
289077981
272630241
316666113
357471730
1371...

output:

10

result:

ok 1 number(s): "10"