結果

問題 No.1687 What the Heck?
ユーザー kept1994
提出日時 2021-11-21 23:03:15
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 266 bytes
コンパイル時間 1,269 ms
コンパイル使用メモリ 82,448 KB
実行使用メモリ 102,192 KB
最終ジャッジ日時 2024-06-23 05:40:39
合計ジャッジ時間 2,486 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
from sys import stdin

def main():
    N = int(input())
    if N == 1:
        print(0)
        return
    P = list(map(int, input().split()))
    print((1 + N) * N // 2 - (P.index(N) + 1) * 2)
    return

if __name__ == '__main__':
    main()
0