【Henu ACM Round #13 B】Spider Man

【链接】 我是链接,点我呀:)
【题意】

在这里输入题意

【题解】

会发现每个环可以操作的次数是固定的。 (环的大小-1 也就是说一旦环确定了。其实结果就已经确定了。 则直接看操作总数的奇偶性就可以了。

【代码】

#include <bits/stdc++.h>
#define long long
using namespace std;

int n,x;

int main(){
	#ifdef LOCAL_DEFINE
	    freopen("rush_in.txt", "r", stdin);
	#endif
	ios::sync_with_stdio(0),cin.tie(0);
    cin >> n;
    int sum = 0;
    for (int i = 1;i <= n;i++){
        cin >> x;
        sum = (sum+x-1)%2;
        if (sum==0){
            cout <<2<<endl;
        }else{
            cout <<1<<endl;
        }
    }
	return 0;
}