結果
| 問題 | No.365 ジェンガソート | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2016-04-29 23:50:12 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 384 bytes | 
| コンパイル時間 | 196 ms | 
| コンパイル使用メモリ | 82,016 KB | 
| 実行使用メモリ | 115,188 KB | 
| 最終ジャッジ日時 | 2024-10-04 19:31:26 | 
| 合計ジャッジ時間 | 4,623 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 10 WA * 31 | 
ソースコード
def solve():
    al, tl = [], []
    n = int(input())
    for j in input().split():
        i = int(j)
        al.append(i)
        tl.append(i)
    
    ad = dict(zip(al, [i for i in range(n)]))
    tl = dict(zip(sorted(tl), [i for i in range(n)]))
    res = 0
    for ak in ad.keys():
        res = max(res, abs(ad[ak] - tl[ak]))
    print(res)
if __name__=="__main__":
    solve()
            
            
            
        