网址: https://cspjs.online/contest/660/problem/3
题解: https://b1bznc26af6.feishu.cn/file/TxyebfDa1orlxkxQ3DAcS2NYnuf?from=from_copylink
#include <bits/stdc++.h>
using namespace std;
int a[10101][10101];
int main() {
freopen("paint.in", "r", stdin);
freopen("paint.out", "w", stdout);
ios::sync_with_stdio(false);
int n, m;
cin.tie(0);
cout.tie(0);
cin >> n >> m;
for (int i = 1; i <= n; i++) {
a[i][1] = 1;
for (int j = 2; j <= i; j++) {
a[i][j] = (a[i - 1][j - 1] + a[i - 1][j]) % 2;
}
}
for (int i = 1; i <= m; i++) {
int b, c;
cin >> b >> c;
if (a[b][c] == 1)
puts("Yes");
else
puts("No");
}
return 0;
}