結果
問題 | No.2879 Range Flip Queries |
ユーザー | graph11463 |
提出日時 | 2024-09-08 18:44:34 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 407 ms / 2,000 ms |
コード長 | 3,794 bytes |
コンパイル時間 | 5,765 ms |
コンパイル使用メモリ | 314,484 KB |
実行使用メモリ | 34,584 KB |
最終ジャッジ日時 | 2024-09-08 18:44:51 |
合計ジャッジ時間 | 16,259 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
6,812 KB |
testcase_01 | AC | 2 ms
6,940 KB |
testcase_02 | AC | 2 ms
6,940 KB |
testcase_03 | AC | 54 ms
6,940 KB |
testcase_04 | AC | 54 ms
6,940 KB |
testcase_05 | AC | 54 ms
6,940 KB |
testcase_06 | AC | 55 ms
6,944 KB |
testcase_07 | AC | 54 ms
6,940 KB |
testcase_08 | AC | 3 ms
6,944 KB |
testcase_09 | AC | 2 ms
6,944 KB |
testcase_10 | AC | 2 ms
6,940 KB |
testcase_11 | AC | 3 ms
6,944 KB |
testcase_12 | AC | 3 ms
6,944 KB |
testcase_13 | AC | 268 ms
21,348 KB |
testcase_14 | AC | 287 ms
22,632 KB |
testcase_15 | AC | 176 ms
12,444 KB |
testcase_16 | AC | 78 ms
14,476 KB |
testcase_17 | AC | 213 ms
31,232 KB |
testcase_18 | AC | 374 ms
33,932 KB |
testcase_19 | AC | 407 ms
33,972 KB |
testcase_20 | AC | 373 ms
33,948 KB |
testcase_21 | AC | 377 ms
34,420 KB |
testcase_22 | AC | 372 ms
33,992 KB |
testcase_23 | AC | 371 ms
33,948 KB |
testcase_24 | AC | 379 ms
34,456 KB |
testcase_25 | AC | 383 ms
34,392 KB |
testcase_26 | AC | 380 ms
34,504 KB |
testcase_27 | AC | 391 ms
34,428 KB |
testcase_28 | AC | 375 ms
34,484 KB |
testcase_29 | AC | 175 ms
34,460 KB |
testcase_30 | AC | 174 ms
34,432 KB |
testcase_31 | AC | 174 ms
34,436 KB |
testcase_32 | AC | 174 ms
34,584 KB |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> 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<ll,ll>; using vll = vector<ll>; using vvll = vector<vll>; using vP = vector<P>; using vc = vector<char>; //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<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0;} template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0;} template<class... T> 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<P> primefact(ll N){ vector<P> 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<int> vec; Node(int v, int p){val = v, par = p;}; }; int Q; map<int, int> mp;//SAVEandLOAD vector<Node> vect; */ bool poich(ll P,ll Q){return(0<=P&&P<Q);} bool poich2(ll x,ll y,ll H,ll W){return(poich(x,W)&&poich(y,H));} int main() { ios::sync_with_stdio(0); cin.tie(0); ll N,Q;input(N,Q); vector<ll> A(N); GETV2(A); vector<vector<ll>> keisan(N,vector<ll>(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; }