結果
問題 |
No.365 ジェンガソート
|
ユーザー |
|
提出日時 | 2016-04-30 00:05:13 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 443 bytes |
コンパイル時間 | 144 ms |
コンパイル使用メモリ | 82,384 KB |
実行使用メモリ | 115,816 KB |
最終ジャッジ日時 | 2024-10-04 19:42:58 |
合計ジャッジ時間 | 4,441 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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 rsum = 0 for ak in ad.keys(): t = ad[ak] - tl[ak] res = max(res, abs(t)) rsum = t print(max(res, rsum)) if __name__=="__main__": solve()