結果
| 問題 | No.2053 12345... |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-06-14 19:25:53 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 77 ms / 2,000 ms |
| + 322µs | |
| コード長 | 330 bytes |
| 記録 | |
| コンパイル時間 | 96 ms |
| コンパイル使用メモリ | 64,728 KB |
| 実行使用メモリ | 87,856 KB |
| 最終ジャッジ日時 | 2026-10-16 16:41:04 |
| 合計ジャッジ時間 | 5,858 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 33 |
ソースコード
def C(n, A):
count = 0
i = 0
while i < n:
j = i + 1
while j < n and A[j] - A[j - 1] == 1:
j += 1
length = j - i
if length >= 2:
count += (length - 1) * length // 2
i = j
return count
N = int(input())
A = list(map(int, input().split()))
print(C(N, A))