QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#239157 | #5141. Identical Parity | tselmegkh# | WA | 0ms | 3532kb | C++17 | 771b | 2023-11-04 18:54:04 | 2023-11-04 18:54:05 |
Judging History
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]