QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#746264 | #9750. 拼图 | wsyear# | WA | 26ms | 3664kb | C++20 | 1.3kb | 2024-11-14 14:02:46 | 2024-11-14 14:02:47 |
Judging History
answer
#include <bits/stdc++.h>
#define rep(i, j, k) for (int i = (j); i <= (k); ++i)
#define per(i, j, k) for (int i = (j); i >= (k); --i)
#define SZ(v) int((v).size())
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
using ll = long long;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;
template<class T>inline void chkmn(T &x, T y) { if (y < x) x = y; }
template<class T>inline void chkmx(T &x, T y) { if (y > x) x = y; }
using namespace std;
int a, b, c, d;
void work() {
cin >> a >> b >> c >> d;
int mx = 0;
rep (x, 0, 2000) {
if (a < 4) continue;
int rb = b - 2 * (x / 2), rc = c - 2 * ((x + 1) / 2);
if (rb < 0 || rc < 0) continue;
rb /= 2, rc /= 2;
int mxy = min(2 * rb, 2 * rc + 1);
if (x) chkmn(mxy, d / x);
chkmx(mx, (mxy + 2) * (x + 2));
}
swap(b, c);
rep (x, 0, 2000) {
if (a < 4) continue;
int rb = b - 2 * (x / 2), rc = c - 2 * ((x + 1) / 2);
if (rb < 0 || rc < 0) continue;
rb /= 2, rc /= 2;
int mxy = min(2 * rb, 2 * rc + 1);
if (x) chkmn(mxy, d / x);
chkmx(mx, (mxy + 2) * (x + 2));
}
cout << mx << '\n';
}
int main() {
cin.tie(nullptr) -> ios::sync_with_stdio(false);
int t; cin >> t;
while (t--) work();
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3664kb
input:
2 4 0 0 0 4 4 4 4
output:
4 16
result:
ok 2 lines
Test #2:
score: -100
Wrong Answer
time: 26ms
memory: 3592kb
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'