CF

http://codeforces.com/problemset/problem/405/C

#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <bitset>

using namespace std ;

bitset < 1002 > a[1002];
int n;
inline int Solve(){
    int ret = 0;
    for(int i=1;i<=n;++i)
       ret += a[i][i];
    return ret;
}
int main()
{
    std::ios_base::sync_with_stdio(false);
    #ifndef ONLINE_JUDGE
        freopen("date.in", "r", stdin);
        freopen("date.out", "w", stdout);
    #endif
    int i,j;
    scanf("%d\n",&n);
    for(i=1;i<=n;++i)
        for(j=1;j<=n;++j){
           int x;
           scanf("%d\n",&x);
            a[i][j] = x;
        }
    int nr = Solve();
    int q , x ,op;
    scanf("%d\n",&q);
    for( ;q; --q){
        scanf("%d\n",&op);
        if(op==1 || op == 2){
            scanf("%d\n",&x);
            if(a[x][x] == 1){
                --nr;
                a[x][x] = 0;
            }
            else{
                ++nr;
                a[x][x] = 1;
            }
        }
        else
            cout<<(nr&1);
    }
    cout<<"\n";
    return 0;
}

 

 

转载于:https://my.oschina.net/hlslml77/blog/211557

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值