QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#728436#5137. Toweryixuanoct#WA 1ms3688kbC++201.2kb2024-11-09 15:10:412024-11-09 15:10:41

Judging History

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

  • [2024-11-09 15:10:41]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3688kb
  • [2024-11-09 15:10:41]
  • 提交

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();
}

Details

Tip: Click on the bar to expand more detailed information

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