HDU 1851

http://acm.hdu.edu.cn/showproblem.php?pid=1851

Bash Game + 异或

#include <bits/stdc++.h>
using namespace std;
int t,n,m,l;
int s;
int main() {
    //freopen("in","r",stdin);
    ios::sync_with_stdio(0);
    cin >> t;
    while(t--){
        s = 0;
        cin >> n;
        for(int i = 0; i < n; i++){
            cin >> m >> l;
            s ^= (m % (l + 1));
        }
        if(!s) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    return 0;
}

猜你喜欢

转载自www.cnblogs.com/xcfxcf/p/12568982.html
hdu