QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#583923#5141. Identical Parityrxzfn639WA 0ms3636kbC++23619b2024-09-23 00:06:462024-09-23 00:06:47

Judging History

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

  • [2024-09-23 00:06:47]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3636kb
  • [2024-09-23 00:06:46]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
const i64 P = 998244353;
void solve() {
    int n, k;
    cin >> n >> k;
    if (k % 2 == 0) {
        cout << "Yes\n";
    } else {
        if (n % 2 == 1 && n / k - 1 <= n % k && n % k <= k / 2) {
            cout << "Yes\n";
        } else if (n % 2 == 0 && n / k <= n % k && n % k <= k / 2) {
            cout << "Yes\n";
        } else {
            cout << "No\n";
        }
    }
}
int main() {
    ios::sync_with_stdio(0); cin.tie(0), cout.tie(0);
    int t = 1; 
    cin >> t;
    while(t--) solve();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3636kb

input:

3
3 1
4 2
5 3

output:

No
Yes
No

result:

wrong answer expected YES, found NO [3rd token]