結果

問題 No.1722 [Cherry 3rd Tune C] In my way
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2021-10-29 21:24:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 422 bytes
コンパイル時間 354 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 62,464 KB
最終ジャッジ日時 2024-04-16 14:00:19
合計ジャッジ時間 2,041 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
52,352 KB
testcase_01 AC 47 ms
57,728 KB
testcase_02 AC 54 ms
61,056 KB
testcase_03 AC 53 ms
60,928 KB
testcase_04 AC 53 ms
61,056 KB
testcase_05 AC 51 ms
58,880 KB
testcase_06 AC 42 ms
52,352 KB
testcase_07 AC 49 ms
58,496 KB
testcase_08 AC 54 ms
61,440 KB
testcase_09 AC 46 ms
57,472 KB
testcase_10 AC 42 ms
52,224 KB
testcase_11 AC 55 ms
61,568 KB
testcase_12 AC 55 ms
61,696 KB
testcase_13 AC 56 ms
61,952 KB
testcase_14 AC 56 ms
62,208 KB
testcase_15 AC 54 ms
61,696 KB
testcase_16 AC 55 ms
61,824 KB
testcase_17 AC 54 ms
61,440 KB
testcase_18 AC 55 ms
61,696 KB
testcase_19 AC 55 ms
62,464 KB
testcase_20 AC 55 ms
61,824 KB
testcase_21 AC 42 ms
52,224 KB
testcase_22 AC 41 ms
52,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

"""

import sys
from sys import stdin
import bisect

N,M = map(int,stdin.readline().split())

X = list(map(int,stdin.readline().split()))
Y = list(map(int,stdin.readline().split()))

Y.sort()

Y.append(float("inf"))

ans = []

for x in X:

    ind = bisect.bisect_left(Y,x)
    Z = Y[ind] - x

    if Z == float("inf"):
        ans.append("Infinity")
    else:
        ans.append(Z)

print ("\n".join(map(str,ans)))
0