結果

問題 No.1687 What the Heck?
ユーザー asumo0729asumo0729
提出日時 2021-09-24 21:26:38
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 580 bytes
コンパイル時間 329 ms
コンパイル使用メモリ 86,976 KB
実行使用メモリ 106,832 KB
最終ジャッジ日時 2023-09-18 20:38:00
合計ジャッジ時間 3,689 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
71,536 KB
testcase_01 WA -
testcase_02 AC 94 ms
71,832 KB
testcase_03 WA -
testcase_04 AC 95 ms
71,792 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 112 ms
85,620 KB
testcase_10 AC 110 ms
82,496 KB
testcase_11 AC 106 ms
82,648 KB
testcase_12 AC 139 ms
106,744 KB
testcase_13 AC 139 ms
106,832 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from operator import itemgetter
from collections import defaultdict, deque
import heapq
import bisect

stdin=sys.stdin
sys.setrecursionlimit(10 ** 8)

ip=lambda: int(sp())
fp=lambda: float(sp())
lp=lambda:list(map(int,stdin.readline().split()))
sp=lambda:stdin.readline().rstrip()
Yp=lambda:print('Yes')
Np=lambda:print('No')
inf = 1 << 60
eps = 1e-9
sortkey = itemgetter(0)

###############################################################

N = ip()
A = lp()
ans = 0
for i in range(N):
    if A[i] == N:
        ans -= (i + 1)
    else:
        ans += i + 1

print(ans)
0