QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#750115 | #5141. Identical Parity | ckq328 | WA | 0ms | 3564kb | C++20 | 818b | 2024-11-15 12:45:38 | 2024-11-15 12:45:38 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int N=1e6+10,M=200+10,inf=1e18,mod=998244353;
int n,k;
int a[N],f[N];
void solve(){
cin>>n>>k;
if(k==1){
if(n==1) cout<<"yes"<<endl;
else cout<<"No"<<endl;
}
else if(k%2==0) cout<<"yes"<<endl;
else{
if(k==n) cout<<"yes"<<endl;
else{
vector<int> vc;
int sum=0;
for(int i=1;i<=k;i++){
int cnt=n/k;
if(n%k>=i) cnt++;
vc.push_back(cnt);
sum+=cnt;
}
if(sum<n) cout<<"yes"<<endl;
else{
cout<<"no"<<endl;
}
}
}
}
signed main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int tt;
cin>>tt;
// tt=1;
while(tt--){
solve();
}
}
/*
1
10
598196518 640274071 983359971 71550121 96204862 799843967 446173607 796619138 402690754 223219513
*/
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3564kb
input:
3 3 1 4 2 5 3
output:
No yes no
result:
wrong answer expected YES, found NO [3rd token]