結果

問題 No.1722 [Cherry 3rd Tune C] In my way
ユーザー HydruHydru
提出日時 2021-10-29 21:30:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 53 ms / 2,000 ms
コード長 443 bytes
コンパイル時間 256 ms
コンパイル使用メモリ 82,376 KB
実行使用メモリ 65,408 KB
最終ジャッジ日時 2024-04-16 14:11:24
合計ジャッジ時間 2,073 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
51,968 KB
testcase_01 AC 41 ms
52,736 KB
testcase_02 AC 46 ms
62,176 KB
testcase_03 AC 47 ms
62,816 KB
testcase_04 AC 46 ms
61,056 KB
testcase_05 AC 39 ms
53,504 KB
testcase_06 AC 39 ms
52,224 KB
testcase_07 AC 39 ms
52,736 KB
testcase_08 AC 50 ms
63,748 KB
testcase_09 AC 38 ms
52,992 KB
testcase_10 AC 37 ms
52,864 KB
testcase_11 AC 52 ms
65,024 KB
testcase_12 AC 53 ms
64,512 KB
testcase_13 AC 52 ms
65,024 KB
testcase_14 AC 53 ms
65,152 KB
testcase_15 AC 51 ms
64,128 KB
testcase_16 AC 53 ms
64,896 KB
testcase_17 AC 51 ms
63,232 KB
testcase_18 AC 52 ms
64,384 KB
testcase_19 AC 53 ms
64,384 KB
testcase_20 AC 53 ms
65,408 KB
testcase_21 AC 37 ms
51,840 KB
testcase_22 AC 38 ms
52,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
Z=[]
for i in range(n):
    Z.append((X[i],0,i))
for i in range(m):
    Z.append((Y[i],1))
Z.sort()
ans=[0]*n
flag=[]
for i in range(n+m):
    if Z[i][1]==0:
        flag.append((Z[i][0],Z[i][2]))
    else:
        for x,y in flag:
            ans[y]=Z[i][0]-x
        flag.clear()
for x,y in flag:
    ans[y]="Infinity"
for x in ans:
    print(x)
0