結果

問題 No.1687 What the Heck?
コンテスト
ユーザー asumo0729
提出日時 2021-09-24 21:26:38
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 580 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 220 ms
コンパイル使用メモリ 85,888 KB
実行使用メモリ 103,296 KB
最終ジャッジ日時 2026-03-26 17:04:53
合計ジャッジ時間 1,768 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 7 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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