結果

問題 No.1687 What the Heck?
ユーザー momoyuu
提出日時 2022-03-27 16:18:37
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 305 bytes
コンパイル時間 308 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 102,332 KB
最終ジャッジ日時 2024-11-06 10:03:56
合計ジャッジ時間 2,389 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 7 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    import sys
    input = sys.stdin.readline
    
    N = int(input())
    P = list(map(int,input().split()))
    count = 0
    for i in range(N):
        if P[i] != N:
            count += i + 1
        else:
            count -= i + 1
    print(count)

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