結果
問題 | No.1282 Display Elements |
ユーザー | 👑 Kazun |
提出日時 | 2020-11-06 21:54:25 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 787 bytes |
コンパイル時間 | 368 ms |
コンパイル使用メモリ | 87,208 KB |
実行使用メモリ | 274,716 KB |
最終ジャッジ日時 | 2023-09-29 18:40:14 |
合計ジャッジ時間 | 5,489 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 61 ms
75,688 KB |
testcase_01 | AC | 61 ms
71,412 KB |
testcase_02 | AC | 61 ms
71,504 KB |
testcase_03 | AC | 60 ms
71,440 KB |
testcase_04 | AC | 60 ms
71,412 KB |
testcase_05 | AC | 62 ms
71,148 KB |
testcase_06 | AC | 62 ms
71,420 KB |
testcase_07 | AC | 63 ms
71,220 KB |
testcase_08 | AC | 63 ms
71,412 KB |
testcase_09 | AC | 61 ms
71,424 KB |
testcase_10 | AC | 64 ms
75,852 KB |
testcase_11 | AC | 67 ms
75,600 KB |
testcase_12 | AC | 62 ms
71,508 KB |
testcase_13 | AC | 65 ms
75,232 KB |
testcase_14 | AC | 69 ms
76,468 KB |
testcase_15 | TLE | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
ソースコード
def Binary_Search_Big_Count(A,x,equal=False,sort=False): """2分探索によって,xを超える要素の個数を調べる. A:リスト x:調べる要素 sort:ソートをする必要があるかどうか(Trueで必要) equal:Trueのときはx"を超える"がx"以上"になる """ if sort: A.sort() if A[-1]<x or ((not equal) and A[-1]==x): return 0 L,R=-1,len(A)-1 while R-L>1: C=L+(R-L)//2 if A[C]>x or (equal and A[C]==x): R=C else: L=C return len(A)-R #================================================ N=int(input()) A=list(map(int,input().split())) B=list(map(int,input().split())) A.sort() X=0 for i in range(N): X+=Binary_Search_Big_Count(A[i:],B[i]) print(X)