QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#65632#5141. Identical ParityJesWA 2ms3376kbC++171.3kb2022-12-02 16:20:472022-12-02 16:20:51

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-12-02 16:20:51]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3376kb
  • [2022-12-02 16:20:47]
  • 提交

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]