QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#55213 | #1756. Feeding Seals | Mostafa_Moharram# | AC ✓ | 19ms | 4032kb | C++17 | 526b | 2022-10-12 18:54:03 | 2022-10-12 18:54:04 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 100005;
int n, c, a[N];
int main() {
ios::sync_with_stdio(false); cout.tie(nullptr); cin.tie(nullptr);
cin >> n >> c;
for (int i = 0; i < n; ++i)
cin >> a[i];
sort(a, a + n);
int i = 0, j = n - 1, ans = 0;
while (i <= j) {
if (a[i] + a[j] > c) {
--j; ++ans;
continue;
}
++i; --j; ++ans;
}
cout << ans << '\n';
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 19ms
memory: 4032kb
input:
100000 1000000000 573066743 549461930 910260356 714615085 451112750 586231549 710034693 371298423 674954756 559990545 511823992 793317774 503178926 748853611 419919548 957756990 661619420 487193894 640025039 425147560 571429538 838844491 334689171 571365951 488059983 751252046 848903739 850832280 78...
output:
74998
result:
ok single line: '74998'
Test #2:
score: 0
Accepted
time: 6ms
memory: 3920kb
input:
65460 214482340 143510544 38485043 164673460 45424790 20437232 174166875 173566858 51672975 21099180 110290428 187556083 201734178 132447947 121970582 64868225 5057944 202256231 90081179 170526840 8134375 202306058 183763769 133581948 85518839 1095204 16813306 212024405 204736058 212122480 169102149...
output:
32821
result:
ok single line: '32821'
Test #3:
score: 0
Accepted
time: 6ms
memory: 3844kb
input:
51911 43844582 8419757 9993352 2382495 17470419 36578239 18712000 30022801 9318138 4310069 15938570 38809473 20485835 1497413 8342645 36587236 36594213 36438288 29758054 15075040 25432995 14535142 22721231 26177551 28415750 30922269 42234739 22830208 39588094 30480405 37734439 10223013 4700438 10224...
output:
26070
result:
ok single line: '26070'
Test #4:
score: 0
Accepted
time: 10ms
memory: 3784kb
input:
47764 599693337 479142766 264793791 331594745 518145093 154807708 216436304 42722059 475853607 67179894 108019222 553864913 478478578 269166101 208310647 551938731 142886667 563384183 9157692 256183285 461770539 490655635 460433423 188569903 149235366 43559296 432287540 148010119 448401966 277917804...
output:
23907
result:
ok single line: '23907'
Test #5:
score: 0
Accepted
time: 8ms
memory: 3780kb
input:
35051 515117443 293158372 9329911 120810257 379972087 114343115 136226399 144469275 306931052 168286512 9692506 239754845 186720996 60717607 191576836 445360767 139097764 70038475 447485642 383974724 357811606 172822782 272094504 230654323 145862530 332705312 26489774 196635600 321271834 507397321 2...
output:
17662
result:
ok single line: '17662'
Test #6:
score: 0
Accepted
time: 8ms
memory: 3812kb
input:
58834 731101034 473836387 63329037 512780957 578584580 271630135 653516869 69464041 511302062 403421470 141722453 93703710 330430756 493443394 622551009 553665452 271164697 193857036 85976793 674244611 548440983 51083154 567269445 71687638 271150922 561724324 325540318 362697522 680615806 312633481 ...
output:
29467
result:
ok single line: '29467'
Test #7:
score: 0
Accepted
time: 4ms
memory: 3796kb
input:
12021 184563956 156968663 172580876 164536693 111562542 48704860 165204815 160664477 53486339 109949267 184071889 22465869 173548498 33066653 109832485 157412447 16331579 161659208 99405394 121170502 36000329 130463431 108064609 42042437 135743161 106087958 59170314 138875369 72621221 106132651 1647...
output:
6021
result:
ok single line: '6021'
Test #8:
score: 0
Accepted
time: 14ms
memory: 3872kb
input:
67610 723492918 689920363 121227088 343695569 97803257 524020287 817734 523114773 582790808 233292863 524496885 664176966 418551595 21818036 153259627 266277856 138787034 437350601 29436659 507279699 408453981 654024539 717177876 10344431 114131209 146487005 682571121 246751115 361404093 56572855 23...
output:
33996
result:
ok single line: '33996'
Test #9:
score: 0
Accepted
time: 13ms
memory: 3904kb
input:
67366 317759147 266930507 237449872 291293857 135273872 53926032 282833646 316782315 157325544 196289173 274265900 193418070 12947280 263863609 61452171 9834571 78745648 105396448 37231368 184705928 69627098 256386522 281446999 292120870 158815450 226752236 310014195 268488422 235132951 297474092 26...
output:
33752
result:
ok single line: '33752'
Test #10:
score: 0
Accepted
time: 3ms
memory: 3764kb
input:
27231 468911303 358927414 342666669 233629771 27542444 398368247 195479160 54245837 434163019 401634634 363206850 64439275 233885089 44173203 436720738 156005221 461081618 191679274 142447876 459071177 65015111 6440315 229551122 251210085 295054455 299760388 139771549 462886272 97326260 130995149 10...
output:
13655
result:
ok single line: '13655'
Test #11:
score: 0
Accepted
time: 13ms
memory: 3732kb
input:
68422 801716215 341633164 559734064 517157459 745170175 233786994 165143402 140423409 329610745 695347530 496529427 798320187 206447592 187103661 188368874 277760018 512109956 500090770 190263862 97416216 68765484 670640060 281309543 783857516 799971621 154321392 520508272 124707932 540830057 528651...
output:
34323
result:
ok single line: '34323'
Test #12:
score: 0
Accepted
time: 14ms
memory: 3888kb
input:
74332 883807753 191020920 70107005 808977264 438762232 695140168 277993975 843802253 648593758 230053670 554547019 296360086 569699102 874962979 875141149 387003440 696056457 522371398 506200135 274921533 503620102 455406101 354964055 700663693 115445765 867102899 837377311 718592162 98793455 212395...
output:
37258
result:
ok single line: '37258'
Test #13:
score: 0
Accepted
time: 8ms
memory: 3964kb
input:
80878 708483340 436972007 396566700 25799664 130896520 449389080 380269522 386864125 53849105 496417202 185371874 491063507 545617199 359608072 107947974 64891088 623341392 538180305 653064620 570522733 146746231 239685474 257088219 468563235 408992718 104171691 434258338 586106382 221412243 2585228...
output:
40440
result:
ok single line: '40440'
Test #14:
score: 0
Accepted
time: 0ms
memory: 3508kb
input:
2459 131703200 18806682 87694382 62146849 118871531 101682546 49535164 130346641 123248269 79578757 20344034 116066571 62186695 75634106 43489249 85058305 128913219 23284153 1628992 40256466 55067847 12634455 100770852 114034941 109895205 6546614 16190663 90018775 1609138 88617857 4356074 98895325 8...
output:
1239
result:
ok single line: '1239'
Test #15:
score: 0
Accepted
time: 6ms
memory: 3856kb
input:
63173 776504215 65362488 404051373 180603816 523467528 61270290 333874225 388029295 761949354 540549843 394247286 109940725 432192714 767245307 384171237 183730596 336559047 732886207 569119554 676362883 670657867 190095859 604464967 283849746 535851172 28204748 750873151 592815982 170123013 6913519...
output:
31778
result:
ok single line: '31778'
Test #16:
score: 0
Accepted
time: 2ms
memory: 3744kb
input:
1 1 1
output:
1
result:
ok single line: '1'