結果
| 問題 | No.911 ラッキーソート |
| コンテスト | |
| ユーザー |
convexineq
|
| 提出日時 | 2021-04-11 17:30:48 |
| 言語 | PyPy3 (8.0.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 114 ms / 2,000 ms |
| + 101µs | |
| コード長 | 444 bytes |
| 記録 | |
| コンパイル時間 | 85 ms |
| コンパイル使用メモリ | 64,592 KB |
| 実行使用メモリ | 94,120 KB |
| 最終ジャッジ日時 | 2026-11-07 19:51:24 |
| 合計ジャッジ時間 | 8,003 ms |
|
ジャッジサーバーID (参考情報) |
judge7_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 47 |
ソースコード
d = {}
def f(x,i):
if (x,i) in d: return d[x,i]
if x < 0: return 0
if i==62: return 1
c = 0
if res[i]&1: c += f(x//2,i+1)
if res[i]&2: c += f((x-1)//2,i+1)
d[x,i] = c
return c
n,L,R = map(int,input().split())
*a, = map(int,input().split())
res = [3]*62
for x,y in zip(a,a[1:]):
for i in range(62)[::-1]:
if x>>i&1 != y>>i&1:
res[i] &= 1<<(x>>i&1)
break
print(f(R,0)-f(L-1,0))
convexineq