QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#239157#5141. Identical Paritytselmegkh#WA 0ms3532kbC++17771b2023-11-04 18:54:042023-11-04 18:54:05

Judging History

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

  • [2023-11-04 18:54:05]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3532kb
  • [2023-11-04 18:54:04]
  • 提交

answer

#include <iostream>
using namespace std;


void solve(){
    int n, k;
    cin >> n >> k;
    if(n == k || k % 2 == 0){
        cout << "Yes\n";
        return;
    }
    if(k == 1){
        cout << "No\n";
    }
    if(n % 2 == 0){
        if(n / k > n % k){
            cout << "No\n";
            return;
        }
        if(2 * (n / k) + 1 > k){
            cout << "No\n";
            return;
        }
    }
    else{
        if((n / k) - 1 > n % k){
            cout << "No\n";
            return;
        }
        if((n / k) * 2 - 1 > k){
            cout << "No\n";
            return;
        }
    }
    cout << "Yes\n";
    return;
}

int main(){
    int t; 
    cin >> t;
    while(t--){
        solve();
    }
}

詳細信息

Test #1:

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

input:

3
3 1
4 2
5 3

output:

No
No
Yes
Yes

result:

wrong answer expected YES, found NO [2nd token]