QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#723975#2628. Self StudyModyKachef#54 91ms7956kbC++23580b2024-11-08 05:42:242024-11-08 05:42:25

Judging History

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

  • [2024-11-08 05:42:25]
  • 评测
  • 测评结果:54
  • 用时:91ms
  • 内存:7956kb
  • [2024-11-08 05:42:24]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long 

void doWork(){
	int n , m;
	cin >> n >> m;
	vector<int> a(n) , b(n);
	for (int i = 0 ; i < n;  i++) cin >> a[i];
	for (int i = 0 ; i < n ; i++) cin >> b[i];
	
	int l = 0 , r = 1e18 , md;
	while(l<=r){
		md = (l+r)/2;
		int sum = 0 ;
		for (int i = 0 ; i < n ; i++){
			sum += (md + b[i]-1)/b[i];
            if (sum > n*m) break;
		}
		if (sum <= n*m) l = md+1;
		else r = md-1; 
	}
	cout << l-1; 
}

signed main(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    doWork();
}

详细

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 10
Accepted
time: 0ms
memory: 3512kb

input:

1 1
548641561
724453206

output:

724453206

result:

ok single line: '724453206'

Test #2:

score: 0
Wrong Answer
time: 0ms
memory: 3544kb

input:

2 1
80304386 1597
1258971 98815137

output:

1258971

result:

wrong answer 1st lines differ - expected: '80304386', found: '1258971'

Subtask #2:

score: 25
Accepted

Test #15:

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

input:

3 3
430074929 299686894 507918575
430074929 299686894 507918575

output:

1015837150

result:

ok single line: '1015837150'

Test #16:

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

input:

8 2
838643951 240217016 261207069 66687076 628994327 646228382 585174644 909710002
838643951 240217016 261207069 66687076 628994327 646228382 585174644 909710002

output:

466809532

result:

ok single line: '466809532'

Test #17:

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

input:

5 3
97283122 448906411 242495629 994021326 237073930
97283122 448906411 242495629 994021326 237073930

output:

583698732

result:

ok single line: '583698732'

Test #18:

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

input:

8 9
605252877 430369638 951054166 725102459 957083940 702833150 560462831 778843323
605252877 430369638 951054166 725102459 957083940 702833150 560462831 778843323

output:

5706324996

result:

ok single line: '5706324996'

Test #19:

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

input:

5 6
177261053 471738378 620494299 22899748 431624268
177261053 471738378 620494299 22899748 431624268

output:

503794456

result:

ok single line: '503794456'

Test #20:

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

input:

5 3
210207442 280126392 78641217 947623685 74849413
210207442 280126392 78641217 947623685 74849413

output:

374247065

result:

ok single line: '374247065'

Test #21:

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

input:

1 2
277396200
277396200

output:

554792400

result:

ok single line: '554792400'

Test #22:

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

input:

2 9
663859439 355600750
663859439 355600750

output:

3983156634

result:

ok single line: '3983156634'

Test #23:

score: 25
Accepted
time: 31ms
memory: 5472kb

input:

150000 2
105295735 817188254 945364397 912402231 203758571 794613367 528387081 254379958 377098879 754454786 265063605 399253822 50069142 552324889 687426901 465038712 67694214 627282227 218124305 72659729 829014661 252082800 673784906 429311574 410894912 800771330 865107863 35065584 128252901 35948...

output:

81081684

result:

ok single line: '81081684'

Test #24:

score: 25
Accepted
time: 21ms
memory: 4616kb

input:

100000 3
477721927 368835451 739967201 967746671 348354695 694651745 320318398 425176124 75735246 581329106 338055205 267807461 83980603 539036952 384773331 818445431 534294342 809121868 340460138 731645448 459444180 626832563 389107488 814874553 899637777 802059908 762583175 987018364 142559064 629...

output:

110677572

result:

ok single line: '110677572'

Test #25:

score: 25
Accepted
time: 15ms
memory: 4420kb

input:

75000 4
868250486 799799349 933909985 630919106 33530455 700944860 79525162 834134337 441386423 77353305 511360916 17997903 282872826 198810305 31393333 725207410 711626485 516179318 342711711 32564225 427023013 233428207 509188994 561521037 38936290 784185485 867008799 374585575 125011263 839928624...

output:

47418300

result:

ok single line: '47418300'

Test #26:

score: 25
Accepted
time: 13ms
memory: 4164kb

input:

60000 5
161564185 390907347 426181889 867402696 959889814 958540714 154891379 152599226 105497775 145400383 336544259 797805881 781066373 261096516 642200980 598023441 263758200 974489698 622974811 342002810 360018925 103239418 856523517 873592867 6029039 320181433 389071113 245496447 134675885 6590...

output:

400175093

result:

ok single line: '400175093'

Test #27:

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

input:

600 500
406068791 554338297 164087338 103512 395342101 570279441 294543639 102643657 563673633 827344200 224536735 878783159 849667806 685930945 831952784 583591196 871947668 341243305 865502137 925604982 467471388 337964327 581496974 680683382 180217152 815037215 960839910 215272921 971689310 73290...

output:

18380352124

result:

ok single line: '18380352124'

Test #28:

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

input:

8 37500
995879700 388051689 83290852 679821958 189503537 126482058 183850314 717981325
995879700 388051689 83290852 679821958 189503537 126482058 183850314 717981325

output:

8091956144356

result:

ok single line: '8091956144356'

Test #29:

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

input:

5 60000
395236873 364004629 416840897 545512109 647978992
395236873 364004629 416840897 545512109 647978992

output:

27142497016402

result:

ok single line: '27142497016402'

Test #30:

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

input:

1 300000
1
1

output:

300000

result:

ok single line: '300000'

Test #31:

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

input:

1 300000
1000000000
1000000000

output:

300000000000000

result:

ok single line: '300000000000000'

Test #32:

score: 25
Accepted
time: 1ms
memory: 3600kb

input:

4685 64
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

64

result:

ok single line: '64'

Test #33:

score: 25
Accepted
time: 1ms
memory: 3616kb

input:

4685 64
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 100000...

output:

64000000000

result:

ok single line: '64000000000'

Subtask #3:

score: 0
Wrong Answer

Dependency #2:

100%
Accepted

Test #34:

score: 0
Wrong Answer
time: 0ms
memory: 3528kb

input:

3 8
601047763 838215942 318811201
697100290 122519868 465324773

output:

1960317888

result:

wrong answer 1st lines differ - expected: '4879702030', found: '1960317888'

Subtask #4:

score: 29
Accepted

Test #54:

score: 29
Accepted
time: 13ms
memory: 3800kb

input:

46277 26082660
216820392 975920171 670198908 751879346 785464410 137803695 990316039 136082781 508319725 285053836 962754829 189537126 843451157 603648162 288458523 785309345 169328756 469187125 338962865 683500991 389745945 300198265 425154931 243946562 947186175 802786983 215106495 843125200 25944...

output:

1649349400858800

result:

ok single line: '1649349400858800'

Test #55:

score: 29
Accepted
time: 35ms
memory: 5144kb

input:

134402 213977
354127362 466466705 264673839 368419003 19094918 120973266 657169678 31387949 167460016 560536543 919543850 716433626 529408125 215153655 28708914 776554269 178184187 878003153 561479796 213194915 941457004 613773927 613018619 792927384 300832847 142835848 577497599 866650846 274382245...

output:

18429048917344

result:

ok single line: '18429048917344'

Test #56:

score: 29
Accepted
time: 7ms
memory: 3568kb

input:

31415 92
289610992 141809603 98698877 190933093 464442187 601709540 823305042 348290927 693268976 150260735 593927123 993649671 725555511 599092249 902757838 756111591 477244253 993703487 38511569 132542400 234468185 182240498 460516548 822902455 18805813 762977631 383065323 111084668 114662882 7630...

output:

9952589196

result:

ok single line: '9952589196'

Test #57:

score: 29
Accepted
time: 60ms
memory: 7764kb

input:

300000 2
196402839 214076790 677992263 767896778 889226845 443127493 181437631 21410741 666189581 755959325 228176790 525043251 205398011 49793396 784234784 557422555 227101292 884542852 883078212 1594525 730250272 268921266 761858891 855259803 327118948 800050768 162527642 32500985 790893812 677501...

output:

4534160

result:

ok single line: '4534160'

Test #58:

score: 29
Accepted
time: 63ms
memory: 7808kb

input:

300000 3
880237150 129359832 148759871 326440360 600942425 696120545 820936063 647729805 7561787 854164087 720459196 79744884 995177687 99959740 219434332 824959822 475774863 171493467 199870369 198244697 999057258 874377108 978974991 606648508 658396318 648784180 277363933 894208565 398762431 23155...

output:

183800342

result:

ok single line: '183800342'

Test #59:

score: 29
Accepted
time: 60ms
memory: 7732kb

input:

300000 10
320634317 415791038 127763643 917805508 449839858 922198179 353588398 368793393 121407771 274235014 270866970 676240714 980200613 417990746 279287693 497194720 679250046 790815729 565442907 613487998 133134932 284767663 811995643 207521993 634100788 262289408 68253208 836141174 29058377 33...

output:

581943660

result:

ok single line: '581943660'

Test #60:

score: 29
Accepted
time: 66ms
memory: 7832kb

input:

300000 1000
964709204 519640713 518025767 697662003 79061126 580260125 959635874 560476724 131704405 513789044 391734656 923438882 63910155 965058046 207011248 365095660 313203934 178003811 106113551 959879903 165824776 381927460 887339372 568677467 100782486 759951168 559026885 705245307 659371145 ...

output:

81548196863

result:

ok single line: '81548196863'

Test #61:

score: 29
Accepted
time: 81ms
memory: 7784kb

input:

300000 1000000000
957093878 12695891 462363176 783394095 980326381 921960708 875420894 708624956 424399185 120415711 820517616 464024473 555529954 318137533 857958873 981068908 32416198 780436560 738371785 543302364 852678172 594280317 783664707 912238912 550415466 447803483 872191641 808296485 2503...

output:

31255144134529426

result:

ok single line: '31255144134529426'

Test #62:

score: 29
Accepted
time: 45ms
memory: 7956kb

input:

300000 1000000000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

1000000000

result:

ok single line: '1000000000'

Test #63:

score: 29
Accepted
time: 91ms
memory: 7816kb

input:

300000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000...

output:

1000000000000000000

result:

ok single line: '1000000000000000000'

Test #64:

score: 29
Accepted
time: 45ms
memory: 7788kb

input:

300000 1000000000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

1000003333

result:

ok single line: '1000003333'

Subtask #5:

score: 0
Skipped

Dependency #1:

0%