結果
問題 | No.911 ラッキーソート |
ユーザー | vwxyz |
提出日時 | 2023-02-02 05:43:54 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,414 bytes |
コンパイル時間 | 277 ms |
コンパイル使用メモリ | 87,140 KB |
実行使用メモリ | 137,968 KB |
最終ジャッジ日時 | 2023-09-14 14:12:19 |
合計ジャッジ時間 | 17,597 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 242 ms
91,308 KB |
testcase_01 | AC | 240 ms
91,364 KB |
testcase_02 | AC | 241 ms
91,348 KB |
testcase_03 | AC | 243 ms
91,304 KB |
testcase_04 | AC | 244 ms
91,316 KB |
testcase_05 | AC | 243 ms
91,412 KB |
testcase_06 | AC | 243 ms
91,472 KB |
testcase_07 | AC | 245 ms
91,240 KB |
testcase_08 | AC | 242 ms
91,292 KB |
testcase_09 | AC | 248 ms
91,348 KB |
testcase_10 | AC | 242 ms
91,300 KB |
testcase_11 | AC | 243 ms
91,656 KB |
testcase_12 | AC | 243 ms
91,388 KB |
testcase_13 | AC | 394 ms
137,968 KB |
testcase_14 | AC | 349 ms
127,968 KB |
testcase_15 | AC | 346 ms
125,108 KB |
testcase_16 | AC | 367 ms
124,508 KB |
testcase_17 | AC | 361 ms
126,988 KB |
testcase_18 | AC | 363 ms
127,528 KB |
testcase_19 | AC | 354 ms
124,728 KB |
testcase_20 | AC | 353 ms
133,444 KB |
testcase_21 | AC | 369 ms
124,516 KB |
testcase_22 | AC | 363 ms
124,016 KB |
testcase_23 | AC | 348 ms
122,600 KB |
testcase_24 | AC | 353 ms
126,048 KB |
testcase_25 | AC | 307 ms
112,576 KB |
testcase_26 | AC | 295 ms
106,696 KB |
testcase_27 | AC | 273 ms
99,292 KB |
testcase_28 | WA | - |
testcase_29 | AC | 250 ms
94,956 KB |
testcase_30 | AC | 252 ms
94,236 KB |
testcase_31 | AC | 244 ms
92,084 KB |
testcase_32 | WA | - |
testcase_33 | AC | 248 ms
92,264 KB |
testcase_34 | WA | - |
testcase_35 | AC | 244 ms
91,844 KB |
testcase_36 | AC | 242 ms
91,316 KB |
testcase_37 | AC | 248 ms
92,068 KB |
testcase_38 | AC | 360 ms
124,708 KB |
testcase_39 | AC | 366 ms
121,968 KB |
testcase_40 | AC | 259 ms
94,888 KB |
testcase_41 | WA | - |
testcase_42 | WA | - |
testcase_43 | AC | 357 ms
124,504 KB |
testcase_44 | AC | 397 ms
137,588 KB |
testcase_45 | AC | 355 ms
130,656 KB |
testcase_46 | AC | 355 ms
126,952 KB |
testcase_47 | AC | 339 ms
124,100 KB |
testcase_48 | AC | 360 ms
130,684 KB |
ソースコード
import bisect import copy import decimal import fractions import heapq import itertools import math import random import sys import time from collections import Counter,deque,defaultdict from functools import lru_cache,reduce from heapq import heappush,heappop,heapify,heappushpop,_heappop_max,_heapify_max def _heappush_max(heap,item): heap.append(item) heapq._siftdown_max(heap, 0, len(heap)-1) def _heappushpop_max(heap, item): if heap and item < heap[0]: item, heap[0] = heap[0], item heapq._siftup_max(heap, 0) return item from math import gcd as GCD read=sys.stdin.read readline=sys.stdin.readline readlines=sys.stdin.readlines write=sys.stdout.write N,L,R=map(int,readline().split()) A=list(map(int,readline().split())) X=[[1,1] for bit in range(61)] for i in range(N-1): for bit in range(60,-1,-1): if A[i]&1<<bit!=A[i+1]&1<<bit: if A[i]&1<<bit: X[bit][0]=0 else: X[bit][1]=0 break for bit in range(61): if not sum(X[bit]): ans=0 break else: def solve(N): bl=X[60][N>>60&1] dp=0 if N&1<<60 and 0 in X[60]: dp+=1 for bit in range(59,-1,-1): dp*=sum(X[bit]) if bl and X[bit][0] and N&1<<bit: dp+=1 bl&=X[bit][N>>bit&1] return dp ans=solve(R+1)-solve(L) print(ans)