#include #include using namespace std; using namespace atcoder; //ループ系マクロ #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define REP2(i, s, n) for (ll i = s; i < (ll)n; i++) #define REP3(v, A) for(auto v: A) #define REP4(It, A) for (auto It=A.begin();It!=A.end();++It) #define REP5(i, n) for (ll i = 0; i * i < (ll)(n); i++) //vector系マクロ #define ALL(A) A.begin(), A.end() #define RV(A) reverse(ALL(A)) #define RALL(A) A.rbegin(), A.rend() #define SORT(A) sort(ALL(A)) #define RSORT(A) sort(RALL(A)) //入力系マクロ #define GET(A) cin >> A #define GETV(i,n,A) REP(i,n)cin >> A[i] #define GETV2(A) REP(i,A.size())cin >> A[i] //出力系マクロ #define print(A) cout << A << endl #define Yes(bo) ((bo) ? "Yes":"No") #define YES(bo) ((bo) ? "YES":"NO") #define yes(bo) ((bo) ? "yes":"no") #define Taka(bo) ((bo) ? "Takahashi":"Aoki") #define LISTOUT(A) REP(i,A.SZ())cout << A[i] << " ";cout << endl //雑処理系マクロ #define PB push_back #define IS insert #define SZ size #define TE true #define FE false #define fir first #define sec second #define PP pop #define PS push #define FT front //定数系マクロ #define I_MAX 2147483647 #define I_MIN -2147483647 #define UI_MAX 4294967295 #define LL_MAX 9223372036854775807 #define LL_MIN -9223372036854775808 #define ULL_MAX 18446744073709551615 //型宣言系マクロ using ll = long long; using ull = unsigned long long; using P = pair; using vll = vector; using vvll = vector; using vP = vector

; using vc = vector; //using mint = modint998244353; //デバッグ系マクロ #ifdef _DEBUG #define debug(x) cerr << "dbg: "<< #x << ": " << x << endl #define debug_v(x) cerr << "dbg_vec: " << #x << ": "; REP3(v,x) cerr << v << " "; cerr << endl #define debug_s(x) cerr << "dbg_set: " << #x << ": {"; REP3(v,x) cerr << v << ","; cerr << "}" << endl #define debug_m(x) cerr << "dbg_map: " << #x << ": "; REP4(Ite1,x)cerr << "key: " << Ite1->first << " : " << Ite1->second << " "; cerr<< endl #else #define debug(x) #define debug_v(x) #define debug_s(x) #define debug_m(x) #endif ll GCD(ll a, ll b) {if (b == 0) return a;else return GCD(b, a % b);} ll LCM(ll a, ll b) {return a * b/GCD(a , b);} template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0;} template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0;} template inline void input(T&... a) { ((cin >> a), ...); } bool kaibuncheck(string S){ REP(i,S.SZ()/2)if(S[i]!=S[S.SZ()-i-1])return false; return true; } ll kaibuncount(string S){ ll tmp1=0; REP(i,S.SZ()/2)if(S[i]!=S[S.SZ()-i-1])tmp1++; return tmp1; } vector

primefact(ll N){ vector

ret; for(ll i=2;i*i<=N;i++){ ll cot=0; if(N%i==0){ while(N%i==0){ cot++; N/=i; } ret.PB({i,cot}); } } if(N!=1)ret.PB({N,1}); return ret; } /* struct Node{ int val, par; vector vec; Node(int v, int p){val = v, par = p;}; }; int Q; map mp;//SAVEandLOAD vector vect; */ bool poich(ll P,ll Q){return(0<=P&&P A(N); GETV2(A); vector> keisan(N,vector(2,0)); REP(i,Q){ ll L,R;input(L,R); L--;R--; keisan[L][0]+=1; keisan[L][0]%=2; keisan[R][1]+=1; keisan[R][1]%=2; } ll now=0; REP(i,N){ now+=keisan[i][0]; cout << (A[i]+now)%2 << " "; now+=keisan[i][1]; now%=2; } cout << endl; }