結果
問題 |
No.2879 Range Flip Queries
|
ユーザー |
|
提出日時 | 2024-09-10 01:39:03 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 995 bytes |
コンパイル時間 | 2,050 ms |
コンパイル使用メモリ | 170,544 KB |
実行使用メモリ | 13,756 KB |
最終ジャッジ日時 | 2024-09-10 01:39:12 |
合計ジャッジ時間 | 8,788 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 TLE * 1 -- * 19 |
ソースコード
#include <bits/stdc++.h> #define rep(i, a, n) for (int i = a; i < (int)(n); i++) #define vi vector<int> #define vb vector<bool> #define ll long long using namespace std; void faster() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); } template <typename T> void input(T &x) { cin >> x; } template <typename T, typename... Args> void input(T &x, Args &...args) { cin >> x; input(args...); } vi xudlr = {0, 0, -1, 1}; vi yudlr = {-1, 1, 0, 0}; int main() { int n, q; input(n, q); vector<bool> v(n); rep(i, 0, n) { int k; input(k); if (k == 0) v[i] = false; else v[i] = true; } rep(i, 0, q) { int l, r; input(l, r); rep(j, l - 1, r) { v[j] = !v[j]; } } for (auto ans : v) { if (ans == false) cout << 0 << " "; else cout << 1 << " "; } cout << '\n'; }