結果

問題 No.1722 [Cherry 3rd Tune C] In my way
ユーザー ShirotsumeShirotsume
提出日時 2021-10-29 21:27:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 433 bytes
コンパイル時間 259 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 66,304 KB
最終ジャッジ日時 2024-04-16 14:04:39
合計ジャッジ時間 2,688 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
53,632 KB
testcase_01 AC 61 ms
61,696 KB
testcase_02 AC 72 ms
65,024 KB
testcase_03 AC 70 ms
64,512 KB
testcase_04 AC 67 ms
63,616 KB
testcase_05 AC 62 ms
63,232 KB
testcase_06 AC 57 ms
61,824 KB
testcase_07 AC 57 ms
61,184 KB
testcase_08 AC 76 ms
65,664 KB
testcase_09 AC 59 ms
61,568 KB
testcase_10 AC 57 ms
61,184 KB
testcase_11 AC 81 ms
66,304 KB
testcase_12 AC 81 ms
66,048 KB
testcase_13 AC 80 ms
66,304 KB
testcase_14 AC 78 ms
66,176 KB
testcase_15 AC 79 ms
65,792 KB
testcase_16 AC 81 ms
66,048 KB
testcase_17 AC 78 ms
66,048 KB
testcase_18 AC 81 ms
66,304 KB
testcase_19 AC 79 ms
66,304 KB
testcase_20 AC 78 ms
66,048 KB
testcase_21 AC 47 ms
53,376 KB
testcase_22 AC 46 ms
53,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque

n, m = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
z = x + y
z.sort()
s = [-1] * n
g = [-1] * n
for i in range(n + m):
    if z[i] in x:
        s[x.index(z[i])] = z[i]
    if z[i] in y:
        for j in range(n):
            if s[j] >= 0 and g[j] < 0:
                g[j] = z[i]
for i in range(n):
    print(g[i] - s[i] if g[i] > 0 else 'Infinity')
0