QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#228256 | #7638. Lake | ucup-team055# | WA | 1ms | 3424kb | C++20 | 522b | 2023-10-28 13:14:31 | 2023-10-28 13:14:32 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll ceildiv(ll a, ll b) { return a / b + (a % b && (a ^ b) >= 0); }
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll n, m;
cin >> n >> m;
auto ch = [&](ll k) {
ll rem = max<ll>(0, n - k * 4) + max<ll>(0, m - k * 4);
return rem <= k;
};
ll ng = 0;
ll ok = 1000000;
while (ok - ng > 1) {
ll mid = (ng + ok) / 2;
(ch(mid) ? ok : ng) = mid;
}
cout << ok * 2 - 1 << "\n";
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3424kb
input:
1 1
output:
1
result:
ok single line: '1'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3416kb
input:
1 4
output:
1
result:
ok single line: '1'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3324kb
input:
5 5
output:
3
result:
ok single line: '3'
Test #4:
score: -100
Wrong Answer
time: 0ms
memory: 3424kb
input:
4 4
output:
1
result:
wrong answer 1st lines differ - expected: '3', found: '1'