QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#755913 | #5141. Identical Parity | L_wwqq | WA | 0ms | 3620kb | C++20 | 967b | 2024-11-16 18:22:32 | 2024-11-16 18:22:34 |
Judging History
answer
#include<bits/stdc++.h>
#define int long long
#define i128 __int128
#define fi first
#define se second
#define all(a) begin(a)+1,end(a)
typedef unsigned long long ull;
using namespace std;
using pii = pair<int,int>;
using piii = pair<int,pii>;
const int N = 1e6+5;
int n,m,k;
inline void beez(){
cin >> n >> k;
if(n == 1 and k == 1){
cout << "Yes\n";
return;
}
if(n != 1 and k == 1){
cout << "No\n";
return;
}
if(k % 2 == 0){
cout << "Yes\n";
return;
} else{
if(n == k){
cout << "Yes\n";
return;
}
bool ok = true;
int a = (n / k) * (k / 2) + (n % k),b = (n / k) * ((k + 1) / 2);
cout << a << " " << b << "\n";
if(n & 1){
if(abs(a - b) != 1)ok = false;
} else{
if(a != b)ok = false;
}
if(ok) cout << "Yes\n";
else cout << "No\n";
}
}
signed main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int __=1;
cin>>__;
while(__--){
beez();
}
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3620kb
input:
3 3 1 4 2 5 3
output:
No Yes 3 2 Yes
result:
wrong output format YES or NO expected, but 3 found [3rd token]