QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#65632 | #5141. Identical Parity | Jes | WA | 2ms | 3376kb | C++17 | 1.3kb | 2022-12-02 16:20:47 | 2022-12-02 16:20:51 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr)
#define rep(a, b, c) for(int (a)=(b);(a)<=(c);(a)++)
#define per(a, b, c) for(int (a)=(b);(a)>=(c);(a)--)
#define mset(var, val) memset(var,val,sizeof(var))
#define ll long long
#define itn int
#define fi first
#define se second
#define no "NO\n"
#define yes "YES\n"
#define pb push_back
#define endl "\n"
#define pii pair<int,int>
#define pll pair<ll,ll>
#define dbg(x...) do{cout<<#x<<" -> ";err(x);}while (0)
void err() { cout << '\n'; }
template<class T, class... Ts>
void err(T arg, Ts... args) {
cout << arg << ' ';
err(args...);
}
const int N = 2e5 + 5;
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int mod = 1e9 + 7;
const double eps = 1e-8;
const double pi = acos(-1.0);
void solve() {
itn n,k;
cin>>n>>k;
int x=k/2;
int y=k-x;
int t=n/k;
int z=n%k;
if(n==1) cout<<yes;
else if(k==1) cout<<no;
else if(k%2==0) cout<<yes;
else if(z>=t-1){
if(x>=t-1 && (z-x)%2==0){
cout<<yes;
}
else cout<<no;
}
else{
cout<<no;
}
}
int main() {
IOS;
int t = 1;
cin >> t;
while (t--) {
solve();
}
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 3376kb
input:
3 3 1 4 2 5 3
output:
NO YES NO
result:
wrong answer expected YES, found NO [3rd token]