結果

問題 No.2053 12345...
ユーザー googol_S0googol_S0
提出日時 2022-08-21 12:51:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 138 bytes
コンパイル時間 163 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 103,424 KB
最終ジャッジ日時 2024-04-18 12:40:35
合計ジャッジ時間 3,572 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
51,456 KB
testcase_01 AC 35 ms
51,840 KB
testcase_02 AC 40 ms
59,520 KB
testcase_03 AC 50 ms
69,504 KB
testcase_04 AC 68 ms
92,544 KB
testcase_05 AC 45 ms
65,408 KB
testcase_06 AC 68 ms
88,960 KB
testcase_07 AC 60 ms
79,616 KB
testcase_08 AC 58 ms
77,312 KB
testcase_09 AC 74 ms
92,928 KB
testcase_10 AC 81 ms
103,424 KB
testcase_11 AC 46 ms
65,152 KB
testcase_12 AC 42 ms
62,080 KB
testcase_13 AC 81 ms
102,272 KB
testcase_14 AC 49 ms
72,320 KB
testcase_15 AC 47 ms
70,912 KB
testcase_16 AC 48 ms
70,784 KB
testcase_17 AC 48 ms
66,176 KB
testcase_18 AC 94 ms
101,760 KB
testcase_19 AC 76 ms
94,080 KB
testcase_20 AC 43 ms
61,952 KB
testcase_21 AC 59 ms
80,256 KB
testcase_22 AC 40 ms
58,752 KB
testcase_23 AC 43 ms
63,488 KB
testcase_24 AC 50 ms
70,656 KB
testcase_25 AC 81 ms
102,656 KB
testcase_26 AC 59 ms
79,360 KB
testcase_27 AC 50 ms
70,912 KB
testcase_28 AC 48 ms
68,352 KB
testcase_29 AC 64 ms
86,528 KB
testcase_30 AC 48 ms
68,864 KB
testcase_31 AC 62 ms
85,632 KB
testcase_32 AC 95 ms
101,760 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))
P=0
Q=0
for i in range(1,N):
  if A[i-1]+1==A[i]:
    P+=1
  else:
    P=0
  Q+=P
print(Q)
0