답안 #781006

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
781006 2023-07-12T15:33:08 Z ymm Self Study (JOI22_ho_t2) C++17
0 / 100
443 ms 5016 KB
#include <bits/stdc++.h>
#define Loop(x,l,r) for (ll x = (l); x < (ll)(r); ++x)
#define LoopR(x,l,r) for (ll x = (r)-1; x >= (ll)(l); --x)
typedef long long ll;
typedef std::pair<int, int> pii;
typedef std::pair<ll , ll > pll;
using namespace std;

int main()
{
	cin.tie(0) -> sync_with_stdio(false);
	ll n, m;
	cin >> n >> m;
	vector<ll> a(n), b(n);
	for (auto &x : a)
		cin >> x;
	Loop (i,0,n) {
		cin >> b[i];
		a[i] = max(a[i], b[i]);
	}
	ll l = 0, r = 2e18;
	while (l < r) {
		ll target = (l+r+1)/2;
		ll cnt = 0;
		Loop (i,0,n) {
			ll x = (target+a[i]-1)/a[i];
			if (x > m) {
				x = m;
				x += (target - x*a[i] + b[i]-1)/b[i];
			}
			cnt += x;
		}
		if (cnt <= n*m)
			l = target;
		else
			r = target-1;
	}
	cout << l << '\n';
}

# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 4 ms 340 KB Output is correct
11 Correct 230 ms 4948 KB Output is correct
12 Correct 224 ms 5004 KB Output is correct
13 Correct 234 ms 5016 KB Output is correct
14 Incorrect 443 ms 5004 KB Output isn't correct
15 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 108 ms 2644 KB Output is correct
10 Correct 72 ms 1876 KB Output is correct
11 Correct 59 ms 1492 KB Output is correct
12 Correct 47 ms 1236 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Incorrect 9 ms 340 KB Output isn't correct
19 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 4 ms 340 KB Output is correct
11 Correct 230 ms 4948 KB Output is correct
12 Correct 224 ms 5004 KB Output is correct
13 Correct 234 ms 5016 KB Output is correct
14 Incorrect 443 ms 5004 KB Output isn't correct
15 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 108 ms 2644 KB Output is correct
10 Correct 72 ms 1876 KB Output is correct
11 Correct 59 ms 1492 KB Output is correct
12 Correct 47 ms 1236 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Incorrect 9 ms 340 KB Output isn't correct
19 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 4 ms 340 KB Output is correct
11 Correct 230 ms 4948 KB Output is correct
12 Correct 224 ms 5004 KB Output is correct
13 Correct 234 ms 5016 KB Output is correct
14 Incorrect 443 ms 5004 KB Output isn't correct
15 Halted 0 ms 0 KB -