QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#583921 | #5141. Identical Parity | rxzfn639 | Compile Error | / | / | C++23 | 576b | 2024-09-23 00:06:24 | 2024-09-23 00:06:24 |
Judging History
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 { | ^~~~