結果
| 問題 | 
                            No.1722 [Cherry 3rd Tune C] In my way
                             | 
                    
| コンテスト | |
| ユーザー | 
                             mrng
                         | 
                    
| 提出日時 | 2021-11-21 13:17:39 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 50 ms / 2,000 ms | 
| コード長 | 338 bytes | 
| コンパイル時間 | 435 ms | 
| コンパイル使用メモリ | 82,272 KB | 
| 実行使用メモリ | 64,600 KB | 
| 最終ジャッジ日時 | 2024-06-22 19:27:50 | 
| 合計ジャッジ時間 | 2,379 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 23 | 
ソースコード
n,m = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
y.sort()
def lower_bound(a,x):
	ng,ok = -1,len(a)
	while ok-ng>1:
		m = (ng+ok)//2
		if x<=a[m]: ok = m
		else: ng = m
	return ok
for i in range(n):
	t = lower_bound(y,x[i])
	if t==m:
		print('Infinity')
	else:
		d = y[t]-x[i]
		print(d)
            
            
            
        
            
mrng