QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#755132#9750. 拼图wcyQwQ#WA 2ms3660kbC++14467b2024-11-16 16:32:232024-11-16 16:32:24

Judging History

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

  • [2024-11-16 16:32:24]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3660kb
  • [2024-11-16 16:32:23]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

void solve() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  if (A < 4) cout << 0 << '\n';
  int w = 2 * min(B, C);
  int ans = 0;
  for (int i = 0; i <= min(w, D); i++) {
    int h = min(i ? D / i : (int)1e9, w / 2 - i);
    ans = max(ans, (i + 2) * (h + 2));
  }
  cout << ans << '\n';
}

int main() {
  cin.tie(0)->sync_with_stdio(0);
  int T;
  cin >> T;
  while (T--) solve();
  return 0;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3660kb

input:

2
4 0 0 0
4 4 4 4

output:

4
16

result:

ok 2 lines

Test #2:

score: -100
Wrong Answer
time: 2ms
memory: 3596kb

input:

10000
0 0 0 0
0 0 0 1
0 0 0 2
0 0 0 3
0 0 0 4
0 0 0 5
0 0 0 6
0 0 0 7
0 0 0 8
0 0 0 9
0 0 1 0
0 0 1 1
0 0 1 2
0 0 1 3
0 0 1 4
0 0 1 5
0 0 1 6
0 0 1 7
0 0 1 8
0 0 1 9
0 0 2 0
0 0 2 1
0 0 2 2
0 0 2 3
0 0 2 4
0 0 2 5
0 0 2 6
0 0 2 7
0 0 2 8
0 0 2 9
0 0 3 0
0 0 3 1
0 0 3 2
0 0 3 3
0 0 3 4
0 0 3 5
0 0 3 ...

output:

0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
0
4
...

result:

wrong answer 2nd lines differ - expected: '0', found: '4'