結果

問題 No.911 ラッキーソート
ユーザー convexineqconvexineq
提出日時 2021-04-11 17:30:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 192 ms / 2,000 ms
コード長 444 bytes
コンパイル時間 405 ms
コンパイル使用メモリ 86,684 KB
実行使用メモリ 121,372 KB
最終ジャッジ日時 2023-09-09 19:34:05
合計ジャッジ時間 9,795 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,240 KB
testcase_01 AC 70 ms
71,108 KB
testcase_02 AC 71 ms
71,308 KB
testcase_03 AC 72 ms
71,020 KB
testcase_04 AC 72 ms
71,012 KB
testcase_05 AC 70 ms
71,312 KB
testcase_06 AC 71 ms
71,064 KB
testcase_07 AC 69 ms
71,148 KB
testcase_08 AC 72 ms
71,164 KB
testcase_09 AC 72 ms
71,108 KB
testcase_10 AC 72 ms
71,024 KB
testcase_11 AC 71 ms
71,024 KB
testcase_12 AC 72 ms
71,100 KB
testcase_13 AC 160 ms
113,872 KB
testcase_14 AC 174 ms
121,124 KB
testcase_15 AC 160 ms
113,764 KB
testcase_16 AC 181 ms
112,976 KB
testcase_17 AC 185 ms
116,648 KB
testcase_18 AC 185 ms
116,508 KB
testcase_19 AC 179 ms
120,960 KB
testcase_20 AC 173 ms
120,556 KB
testcase_21 AC 185 ms
121,204 KB
testcase_22 AC 184 ms
119,996 KB
testcase_23 AC 164 ms
108,864 KB
testcase_24 AC 167 ms
108,400 KB
testcase_25 AC 128 ms
97,252 KB
testcase_26 AC 119 ms
92,392 KB
testcase_27 AC 94 ms
82,996 KB
testcase_28 AC 85 ms
78,656 KB
testcase_29 AC 78 ms
76,288 KB
testcase_30 AC 75 ms
76,436 KB
testcase_31 AC 74 ms
75,492 KB
testcase_32 AC 71 ms
71,336 KB
testcase_33 AC 74 ms
75,580 KB
testcase_34 AC 72 ms
71,028 KB
testcase_35 AC 72 ms
75,604 KB
testcase_36 AC 70 ms
71,240 KB
testcase_37 AC 71 ms
75,480 KB
testcase_38 AC 186 ms
116,116 KB
testcase_39 AC 192 ms
110,564 KB
testcase_40 AC 79 ms
76,580 KB
testcase_41 AC 178 ms
120,912 KB
testcase_42 AC 141 ms
96,080 KB
testcase_43 AC 177 ms
121,204 KB
testcase_44 AC 161 ms
113,836 KB
testcase_45 AC 180 ms
121,372 KB
testcase_46 AC 183 ms
121,236 KB
testcase_47 AC 171 ms
120,560 KB
testcase_48 AC 182 ms
119,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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))
0