QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#189320 | #7501. Simple Game | ucup-team1209# | AC ✓ | 33ms | 4344kb | C++20 | 586b | 2023-09-27 10:42:38 | 2023-09-27 10:42:39 |
Judging History
answer
#include<bits/stdc++.h>
using ll = long long;
using std::cin;
using std::cout;
const int N = 200005;
int a[N], b[N];
int main() {
std::ios::sync_with_stdio(false), cin.tie(0);
int t; cin >> t;
for(int i = 0;i < t;++i) {
int n;
cin >> n;
for(int i = 1;i <= n;++i) cin >> a[i];
for(int i = 1;i <= n;++i) cin >> b[i];
ll s0 = 0, s1 = 0, s2 = 0;
for(int i = 1;i <= n;++i) {
s0 += a[i];
if(i <= n / 2 + 1) {
s1 += a[i] + b[i];
}
if(i <= n / 2) {
s2 += a[i] + b[i];
}
}
cout << std::max(std::min(s0, s1), s2) << '\n';
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3472kb
input:
4 2 1 4 2 1 3 1 1 4 5 1 4 4 1 9 4 9 1 0 0 1 7 3 1 4 1 5 9 2 6 5 3 5 8 9 8
output:
5 6 15 25
result:
ok 4 number(s): "5 6 15 25"
Test #2:
score: 0
Accepted
time: 18ms
memory: 3440kb
input:
42433 3 417100972 410793626 16460156 310855598 294966258 483255444 1 957745962 947824037 1 445126120 888003539 1 580400325 275543008 1 754900842 891210463 10 998208800 656500425 488610806 666154179 263153117 196838149 441444097 6047510 848944483 189661679 599149426 756456402 979588669 522525295 6566...
output:
844354754 957745962 445126120 580400325 754900842 6587041421 5590449872 558267139 669469759 5159364163 119715292 75391642 1357091819 1618273431 989761305 1529438455 1869646563 7408247323 1335203346 917908198 2606803111 736868540 3235890337 989833401 203260994 26577370 1035529151 1902546245 701263910...
result:
ok 42433 numbers
Test #3:
score: 0
Accepted
time: 33ms
memory: 3616kb
input:
45300 21 667917825 337070715 32147398 786520985 808563372 844152991 371589539 995103574 467635068 596738290 681206576 111106652 701577955 211110149 263785607 113839148 259648216 685641898 574130316 901792507 605694526 42062366 268465900 842634635 665639647 34990149 400560443 102669484 225796070 8504...
output:
11016973307 10297838068 1782454180 5385979623 5189284439 267715686 715773675 4062878526 939568195 2039398800 1922672064 564282213 5046342511 823068130 3395900934 7523493484 1667690073 2095172183 1240415623 3141900990 427832575 632618391 1518337269 564128019 2334360350 836854157 678784646 3174102496 ...
result:
ok 45300 numbers
Test #4:
score: 0
Accepted
time: 27ms
memory: 3620kb
input:
28212 6 100777167 507019426 179312022 168715180 577915729 396404783 748988392 673067226 595004969 2791193 507501297 47252868 2 481587309 393895035 340975917 602069710 5 448360145 264646603 771636103 863053516 573334230 831674095 71315207 638127686 107960531 309541785 5 353522378 699610958 708147760 ...
output:
2804169202 875482344 2921030597 2529137815 4905018054 1370542719 704792676 11059325083 3919383055 10515808368 292092817 7350826731 3032814886 742442156 1193084542 5917740100 2396610785 1590349183 3876202298 1650711204 6669222578 896537185 3616267538 5252694430 1839493605 1081919871 16901119580 32797...
result:
ok 28212 numbers
Test #5:
score: 0
Accepted
time: 26ms
memory: 3576kb
input:
9802 3 474524804 638932246 347120165 107591209 866473836 219921552 29 671847598 332712137 227667367 813279649 803563571 984738352 482130602 512352341 861570525 968683983 508340502 842541112 575930690 947142189 905512829 297663559 317260960 356877921 513178671 911868146 830821230 119417783 915612128 ...
output:
1460577215 17061744541 9010636272 11559089862 20799211920 3187651380 7665483449 5438099791 9479085570 16697974277 13244538306 3910554394 6076685288 271994594 9795326707 30352689934 1540542335 7774009654 5672167641 1246015717 2323404780 2622433941 10197114042 20108820186 4493533040 15527814607 306703...
result:
ok 9802 numbers
Test #6:
score: 0
Accepted
time: 28ms
memory: 3408kb
input:
4948 85 674857245 11040852 350972618 958729210 866021307 772321627 57193360 237720330 322576249 398756042 382785261 732606275 594718622 312844840 740019370 346938354 95829301 152883710 725172082 644940741 241921253 577144306 982463007 266950840 667179160 253752592 325531919 168045058 989125844 18422...
output:
41621884043 29480405565 86823607778 2198211805 12331060176 2566188725 66923855832 11216942126 66718396820 3607635864 14281557644 11679731731 25474536669 13597106518 42774778533 12642929892 55826275352 28053117528 16634221383 27030512706 19010441462 7281743080 7322444992 13237081752 22295446657 27666...
result:
ok 4948 numbers
Test #7:
score: 0
Accepted
time: 24ms
memory: 3476kb
input:
1995 30 59557219 784847410 190229645 52495249 162297316 164994981 159503613 840394929 365624197 334317530 228835519 600499404 882690532 476564079 37484687 279986968 791204312 927437354 229939332 730180509 105529067 995374041 31098773 350945290 693889600 209104136 150738991 526963092 890573572 882759...
output:
13136060635 11949236508 13713435226 25418784300 70434707053 83818093936 69977675269 142966740510 73719195504 79045159528 107744104794 24757519822 27298162134 28998621788 126058073529 117136491918 32177825429 4109765123 90260908755 81602712736 47935063321 28335547795 70540983943 13936146066 352929122...
result:
ok 1995 numbers
Test #8:
score: 0
Accepted
time: 25ms
memory: 3608kb
input:
30 18895 320652713 847041373 780244989 534624139 652880849 644241145 558050289 283632305 499196048 818915910 553711424 207639235 535585042 869728105 316500033 13997614 826718529 242268652 585157490 178914126 518404241 309798106 851418917 667028860 70792543 130841256 915743266 184234492 238536088 666...
output:
9455192967589 13890395743888 725041979021 2226263709728 6143143698372 5512549364894 3672188914590 2738421009339 1945034622705 5840840071023 3063136288335 1597213778732 5252450819295 8273232932459 5630708494456 1657451501572 921423373800 3394987875116 9812102397037 918826520591 6556696063607 22841832...
result:
ok 30 numbers
Test #9:
score: 0
Accepted
time: 20ms
memory: 3740kb
input:
20 9537 168410188 668942628 898076245 748557930 387433717 608654057 903520509 44268996 440788302 619114588 995685600 789174645 6245612 830627429 39562649 215065909 63034512 263654527 335745554 455877694 909987528 623308752 273732541 479109400 174687881 704472175 155730816 160751818 108191676 6744931...
output:
4762083394692 2988494583325 5383830269027 6668467156192 8963817149944 2034524491099 5181753704089 4156057042843 16831017139005 3228273147151 1718111104357 7212077937957 3368554214625 5781040273529 1847127027027 12518731991805 5841139863777 347560304576 14335124784303 11994994414110
result:
ok 20 numbers
Test #10:
score: 0
Accepted
time: 21ms
memory: 4060kb
input:
10 692 36571881 371376742 251467492 909237561 602767745 526416838 516592928 339645410 849721077 563703755 664432866 581712754 84897782 168254034 574579428 459404607 111715648 170859396 607226025 585987700 990772502 192083201 742553320 832417446 816350323 209766420 324448618 870276385 175672461 21457...
output:
343471022535 4263991476373 12175273332782 2162886187084 18208332384875 2124978350294 24288611566792 27913972146473 5343332657983 28086709524259
result:
ok 10 numbers
Test #11:
score: 0
Accepted
time: 24ms
memory: 4080kb
input:
5 5412 716311487 888842909 711713283 241537343 218497871 549197426 335295248 37063358 263044254 967368994 520907528 720929328 209860410 828152192 134127222 849532094 999437980 892398580 791089213 978290968 717939443 641661459 211467640 450524656 886931515 438331420 516419561 607335497 269512332 3356...
output:
2688991029613 33761934486229 38737406273641 14282752012730 35448827194337
result:
ok 5 number(s): "2688991029613 33761934486229 3...1 14282752012730 35448827194337"
Test #12:
score: 0
Accepted
time: 20ms
memory: 4324kb
input:
5 4802 613322085 306650723 51824405 188726749 850630716 726863935 381233534 885911003 337809101 543076042 30676576 703933148 143043160 876710854 689198425 327735664 968016087 383629683 200822752 512249271 834251909 692705114 146283651 520229921 43773385 24856921 789391871 592229650 125748552 2113283...
output:
2383315194219 2241322070580 49960640599336 12194863074767 19462133623663
result:
ok 5 number(s): "2383315194219 2241322070580 49...6 12194863074767 19462133623663"
Test #13:
score: 0
Accepted
time: 27ms
memory: 4344kb
input:
5 100000 117224582 401000669 658910248 481529110 882413247 454996750 36912803 598824436 558638621 314199559 615249838 767022228 418577705 571565249 844669130 125389661 671505479 823623932 186425799 249224982 796330824 459877934 383192670 71055350 479059288 43832171 830358639 344807144 385624363 7368...
output:
50225214269745 12747473765372 6875561386060 103818424297 46210293712878
result:
ok 5 number(s): "50225214269745 12747473765372 ...060 103818424297 46210293712878"