QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#728436 | #5137. Tower | yixuanoct# | WA | 1ms | 3688kb | C++20 | 1.2kb | 2024-11-09 15:10:41 | 2024-11-09 15:10:41 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
void solve() {
int n, k;
cin >> n >> k;
if (k % 2 == 0) cout << "Yes\n";
else if (k == 1) cout << "No\n";
else {
int s = n / k;
int t = n % k;
// 1 1 1 1 2 2 2
// if (std::min(std::min(n - s * k, k / 2), k / 2 - (n - s * k - k / 2)) < s - 1)
int m = (n - s * k < (k + 1) / 2) ? n - s * k : k / 2 - (n - s * k - k / 2);
// printf("n=%lld s=%lld k=%lld\n", n, s, k);
// std::cout << ">>> " << n - s * k << " " << (k + 1) / 2 << "\n";
// std::cout << "m=" << m << "\n";
if (m < s - 1) {
}
else {
std::cout << "Yes\n";
return;
}
// 1 1 1 2 2 2 2
// m = (n - s * k < (k + 1) / 2) ? n - s * k : k / 2 - (n - )
// if (std::min(n - s * k, k / 2) < s) {
// }
// else {
// std::cout << "Yes\n";
// return;
// }
std::cout << "No\n";
return;
}
}
signed main() {
// ios::sync_with_stdio(false), cin.tie(0);
int _ = 1;
cin >> _;
while (_--) solve();
}
详细
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3688kb
input:
3 2 0 2 6 5 0 1 2 3 4 5 5 3 1 2 3 4 5
output:
Yes Yes Yes
result:
wrong output format Expected integer, but "Yes" found