結果

問題 No.2157 崖
ユーザー achapiachapi
提出日時 2022-12-09 22:05:53
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 434 bytes
コンパイル時間 130 ms
コンパイル使用メモリ 82,220 KB
実行使用メモリ 95,104 KB
最終ジャッジ日時 2024-04-22 22:13:35
合計ジャッジ時間 8,320 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
52,124 KB
testcase_01 AC 36 ms
52,224 KB
testcase_02 AC 32 ms
52,224 KB
testcase_03 AC 32 ms
52,608 KB
testcase_04 AC 32 ms
52,352 KB
testcase_05 AC 33 ms
52,480 KB
testcase_06 AC 32 ms
52,224 KB
testcase_07 AC 32 ms
52,224 KB
testcase_08 WA -
testcase_09 AC 33 ms
52,736 KB
testcase_10 AC 32 ms
52,352 KB
testcase_11 WA -
testcase_12 AC 32 ms
52,096 KB
testcase_13 WA -
testcase_14 AC 607 ms
93,696 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 545 ms
91,068 KB
testcase_18 AC 522 ms
91,264 KB
testcase_19 WA -
testcase_20 AC 716 ms
94,464 KB
testcase_21 AC 688 ms
95,104 KB
testcase_22 AC 498 ms
90,708 KB
testcase_23 AC 32 ms
52,224 KB
testcase_24 AC 58 ms
71,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())
s=[list(map(int,input().split()))for i in range(n)]
for i in range(n):s[i].sort()
from bisect import*
def ge(a, x):
    i = bisect_left(a, x)
    if i != len(a):return a[i]
    return -1
ans=10**18
for i in range(m):
    c=s[0][i]
    k=0
    for j in range(1,n):
        r=ge(s[j],c)
        if r==-1:break
        k=max(k,r-c)
        c=r
    else:ans=min(ans,k)
if ans==10**18:print(-1)
else:print(ans)
0