QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#228256#7638. Lakeucup-team055#WA 1ms3424kbC++20522b2023-10-28 13:14:312023-10-28 13:14:32

Judging History

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

  • [2023-10-28 13:14:32]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3424kb
  • [2023-10-28 13:14:31]
  • 提交

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'