QOJ.ac
QOJ
The 2nd Universal Cup Finals is coming! Check out our event page, schedule, and competition rules!
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#745444 | #9750. 拼图 | hhoppitree# | WA | 3ms | 3828kb | C++17 | 729b | 2024-11-14 09:59:54 | 2024-11-14 09:59:55 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
signed main() {
int T; scanf("%d", &T);
while (T--) {
int a, b, c, d, res = 0; scanf("%d%d%d%d", &a, &b, &c, &d);
if (b > c) swap(b, c);
for (int i = 2; i <= a + b + c + d; ++i) {
for (int j = i; i * j <= a + b + c + d; ++j) {
if (a >= 4 && d >= (i - 2) * (j - 2)) {
int va = (i - 2) / 2 + (j - 1) / 2, vb = (j - 2) / 2 + (i - 1) / 2;
va *= 2, vb *= 2;
if (va > vb) swap(va, vb);
if (b >= va && c >= vb) res = max(res, i * j);
}
}
}
printf("%d\n", res);
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3828kb
input:
2 4 0 0 0 4 4 4 4
output:
4 16
result:
ok 2 lines
Test #2:
score: -100
Wrong Answer
time: 3ms
memory: 3740kb
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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
wrong answer 4021st lines differ - expected: '4', found: '6'