QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#583921#5141. Identical Parityrxzfn639Compile Error//C++23576b2024-09-23 00:06:242024-09-23 00:06:24

Judging History

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

  • [2024-09-23 00:06:24]
  • 评测
  • [2024-09-23 00:06:24]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
const i64 P = 998244353;
void solve() {
    int n, k;
    cin >> n >> k;
    if (k % 2 == 0) {
        cout << "Yes\n";
    } else {
        if (n % 2 == 1 && n / k - 1 <= n % k && n % k <= k / 2) {
            cout << "Yes\n";
        } else if (n % 2 == 0 && n / k <= n % k && n % k <= k / 2) else {
            cout << "No\n";
        }
    }
}
int main() {
    ios::sync_with_stdio(0); cin.tie(0), cout.tie(0);
    int t = 1; 
    cin >> t;
    while(t--) solve();
    return 0;
}

Details

answer.code: In function ‘void solve()’:
answer.code:13:68: error: expected primary-expression before ‘else’
   13 |         } else if (n % 2 == 0 && n / k <= n % k && n % k <= k / 2) else {
      |                                                                    ^~~~