QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#521889 | #5141. Identical Parity | rerebornzhou | WA | 0ms | 3692kb | C++14 | 1.4kb | 2024-08-16 16:19:10 | 2024-08-16 16:19:10 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define IOS std::ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#define int long long
#define ull unsigned long long
#define fi first
#define se second
#define pi pair<int,int>
const int N=1e6+10;
const int INF=1e18;
int a[N];
int t[N][3];
map<pair<int,int>,vector<int>> mp;
void solve(){
int n,k;
cin>>n>>k;
// if(n==k){
// cout<<"Yes\n";
// return;
// }
// if(k==1){
// cout<<"No\n";
// return;
// }
// if(k>n/2){
// cout<<"Yes\n";
// return;
// }
// if(k&1){
// if(n&1){
int ne=0,no=0;
ne=(n+1)/2-((k+1)/2)*(n/k);
no=n/2-((k)/2)*(n/k);
if(ne<0||no<0){
cout<<"No";
return;
}
if(ne<=(k+1)/2&&no<=k/2){
cout<<"Yes\n";
}
else{
cout<<"No\n";
}
// }
// else{
// if(min(n%k,(k/2))+(n/k)*(k/2)==((k+1)/2)*(n/k)){
// cout<<"Yes\n";
// }
// else{
// cout<<"No\n";
// }
// }
// }
// else{
// cout<<"Yes\n";
// }
}
signed main(){
IOS
int _=1;
cin>>_;
while(_--){
solve();
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3692kb
input:
3 3 1 4 2 5 3
output:
NoYes Yes
result:
wrong output format YES or NO expected, but NOYES found [1st token]