結果

問題 No.365 ジェンガソート
ユーザー 👑 yumechiyumechi
提出日時 2016-04-30 00:05:13
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 443 bytes
コンパイル時間 213 ms
コンパイル使用メモリ 81,904 KB
実行使用メモリ 115,568 KB
最終ジャッジ日時 2024-04-15 06:16:47
合計ジャッジ時間 4,362 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,824 KB
testcase_01 AC 37 ms
52,388 KB
testcase_02 AC 37 ms
52,660 KB
testcase_03 AC 34 ms
53,016 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 35 ms
53,228 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 35 ms
53,168 KB
testcase_11 WA -
testcase_12 AC 36 ms
52,804 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 116 ms
114,972 KB
testcase_37 AC 113 ms
114,648 KB
testcase_38 WA -
testcase_39 AC 116 ms
115,176 KB
testcase_40 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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()
0