結果
問題 | No.1673 Lamps on a line |
ユーザー | akakimidori |
提出日時 | 2021-08-31 16:58:21 |
言語 | C++17(clang) (17.0.6 + boost 1.83.0) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 358 bytes |
コンパイル時間 | 4,779 ms |
コンパイル使用メモリ | 132,408 KB |
実行使用メモリ | 9,536 KB |
最終ジャッジ日時 | 2023-09-02 15:14:29 |
合計ジャッジ時間 | 9,543 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 3 ms
5,536 KB |
testcase_01 | AC | 4 ms
5,476 KB |
testcase_02 | AC | 91 ms
5,400 KB |
testcase_03 | AC | 89 ms
5,436 KB |
testcase_04 | AC | 159 ms
5,420 KB |
testcase_05 | AC | 11 ms
5,404 KB |
testcase_06 | AC | 134 ms
5,384 KB |
testcase_07 | TLE | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
ソースコード
#include <bits/stdc++.h> using namespace std; #define REP(i, m, n) for (int i = m; i < (int)(n); ++i) #define rep(i, n) REP(i, 0, n) int main() { int n, q; cin >> n >> q; int a[500010] = {}; rep(i, q) { int l, r; cin >> l >> r; l--; int sum = 0; REP(j, l, r) a[j] ^= 1; rep(j, n) sum += a[j]; cout << sum << "\n"; } }