結果
| 問題 |
No.1673 Lamps on a line
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-09-10 21:39:10 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 417 bytes |
| コンパイル時間 | 610 ms |
| コンパイル使用メモリ | 82,492 KB |
| 実行使用メモリ | 163,096 KB |
| 最終ジャッジ日時 | 2024-06-11 22:53:32 |
| 合計ジャッジ時間 | 4,949 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 TLE * 1 -- * 5 |
ソースコード
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))