結果
| 問題 | No.1673 Lamps on a line |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-09-10 21:39:10 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 417 bytes |
| 記録 | |
| コンパイル時間 | 160 ms |
| コンパイル使用メモリ | 85,572 KB |
| 実行使用メモリ | 163,132 KB |
| 最終ジャッジ日時 | 2026-03-05 04:09:40 |
| 合計ジャッジ時間 | 13,076 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 WA * 3 TLE * 3 |
ソースコード
def popcount(x):
x = x - ((x >> 1) & 0x5555555555555555)
x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f
x = x + (x >> 8)
x = x + (x >> 16)
x = x + (x >> 32)
return x & 0x0000007f
n,q=map(int,input().split())
A=0
for i in range(q):
l,r=map(int,input().split())
l=(1<<l-1)-1
r=(1<<r)-1
A=A^l^r
print(popcount(A))