結果

問題 No.1722 [Cherry 3rd Tune C] In my way
ユーザー ShirotsumeShirotsume
提出日時 2021-10-29 21:27:40
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 433 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 87,008 KB
実行使用メモリ 78,228 KB
最終ジャッジ日時 2023-07-29 07:01:51
合計ジャッジ時間 3,961 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
71,592 KB
testcase_01 AC 104 ms
77,256 KB
testcase_02 AC 119 ms
77,612 KB
testcase_03 AC 114 ms
77,688 KB
testcase_04 AC 110 ms
77,440 KB
testcase_05 AC 104 ms
77,240 KB
testcase_06 AC 99 ms
76,944 KB
testcase_07 AC 103 ms
76,880 KB
testcase_08 AC 119 ms
77,608 KB
testcase_09 AC 106 ms
77,016 KB
testcase_10 AC 101 ms
76,976 KB
testcase_11 AC 122 ms
77,896 KB
testcase_12 AC 119 ms
78,228 KB
testcase_13 AC 118 ms
77,896 KB
testcase_14 AC 119 ms
77,716 KB
testcase_15 AC 121 ms
77,672 KB
testcase_16 AC 122 ms
78,168 KB
testcase_17 AC 123 ms
77,788 KB
testcase_18 AC 123 ms
77,620 KB
testcase_19 AC 121 ms
77,672 KB
testcase_20 AC 123 ms
77,900 KB
testcase_21 AC 93 ms
71,324 KB
testcase_22 AC 93 ms
71,536 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