QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#723942#2628. Self StudyModyKachef#0 10ms3868kbC++23560b2024-11-08 04:16:472024-11-08 04:16:47

Judging History

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

  • [2024-11-08 04:16:47]
  • 评测
  • 测评结果:0
  • 用时:10ms
  • 内存:3868kb
  • [2024-11-08 04:16:47]
  • 提交

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 = 1e9 , 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) l = md+1;
		else r = md-1; 
	}
	cout << l-1; 
}

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

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

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

input:

1 1
548641561
724453206

output:

724453206

result:

ok single line: '724453206'

Test #2:

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

input:

2 1
80304386 1597
1258971 98815137

output:

1258971

result:

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

Subtask #2:

score: 0
Wrong Answer

Test #15:

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

input:

3 3
430074929 299686894 507918575
430074929 299686894 507918575

output:

1000000000

result:

wrong answer 1st lines differ - expected: '1015837150', found: '1000000000'

Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 0
Wrong Answer

Test #54:

score: 0
Wrong Answer
time: 10ms
memory: 3868kb

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:

1000000000

result:

wrong answer 1st lines differ - expected: '1649349400858800', found: '1000000000'

Subtask #5:

score: 0
Skipped

Dependency #1:

0%