結果
問題 | No.2053 12345... |
ユーザー |
|
提出日時 | 2023-06-14 19:25:53 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 90 ms / 2,000 ms |
コード長 | 330 bytes |
コンパイル時間 | 435 ms |
コンパイル使用メモリ | 82,392 KB |
実行使用メモリ | 104,320 KB |
最終ジャッジ日時 | 2024-06-23 02:34:28 |
合計ジャッジ時間 | 4,041 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 31 |
ソースコード
def C(n, A):count = 0i = 0while i < n:j = i + 1while j < n and A[j] - A[j - 1] == 1:j += 1length = j - iif length >= 2:count += (length - 1) * length // 2i = jreturn countN = int(input())A = list(map(int, input().split()))print(C(N, A))