結果
| 問題 | No.2053 12345... |
| コンテスト | |
| ユーザー |
ytft
|
| 提出日時 | 2022-08-23 13:47:10 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 65 ms / 2,000 ms |
| コード長 | 179 bytes |
| 記録 | |
| コンパイル時間 | 138 ms |
| コンパイル使用メモリ | 85,504 KB |
| 実行使用メモリ | 108,160 KB |
| 最終ジャッジ日時 | 2026-04-27 01:29:06 |
| 合計ジャッジ時間 | 3,835 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 31 |
ソースコード
N=int(input()) A=list(map(int,input().split())) temp,ans=0,0 for i in range(N-1): if A[i+1]-A[i]==1: temp+=1 else: ans+=temp*(temp+1)//2 temp=0 print(ans+temp*(temp+1)//2)
ytft