結果

問題 No.1687 What the Heck?
ユーザー ayaoniayaoni
提出日時 2021-09-24 21:27:16
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 269 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 87,000 KB
実行使用メモリ 105,756 KB
最終ジャッジ日時 2023-09-18 20:39:27
合計ジャッジ時間 3,411 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,300 KB
testcase_01 AC 77 ms
71,384 KB
testcase_02 AC 78 ms
71,240 KB
testcase_03 WA -
testcase_04 AC 75 ms
71,368 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 91 ms
84,696 KB
testcase_10 AC 87 ms
81,468 KB
testcase_11 AC 86 ms
81,572 KB
testcase_12 AC 118 ms
105,440 KB
testcase_13 AC 117 ms
105,756 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)

N = int(input())
P = list(map(int,input().split()))

if N == 1:
    exit(print(0))

ans = 0
for i in range(1,N+1):
    p = P[i-1]
    if p == N:
        ans -= i
    else:
        ans += i

print(ans)
0