結果

問題 No.1722 [Cherry 3rd Tune C] In my way
ユーザー ああいい
提出日時 2021-12-29 17:22:39
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 400 bytes
コンパイル時間 112 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-10-04 03:38:31
合計ジャッジ時間 1,689 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())

X = list(map(int,input().split()))
Y = list(map(int,input().split()))
Y.sort()

def calc(x):
    if Y[-1] < x:
        return 'Infinity'
    end = M - 1
    start = -1
    while end - start > 1:
        mid = (start + end) // 2
        if x < Y[mid]:
            end = mid
        else:
            start = mid
    return Y[end] - x
for i in X:
    print(calc(i))
    
0