結果
| 問題 | No.116 門松列(1) |
| コンテスト | |
| ユーザー |
lllllll88938494
|
| 提出日時 | 2023-05-30 01:32:26 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 26 ms / 5,000 ms |
| コード長 | 235 bytes |
| 記録 | |
| コンパイル時間 | 212 ms |
| コンパイル使用メモリ | 85,248 KB |
| 実行使用メモリ | 51,968 KB |
| 最終ジャッジ日時 | 2026-06-02 15:52:04 |
| 合計ジャッジ時間 | 2,207 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
n=int(input())
a=list(map(int,input().split()))
cnt = 0
for i in range(n-2):
if len({a[i],a[i+1],a[i+2]}) < 3:
continue
if a[i] < a[i+1] < a[i+2] or a[i] > a[i+1] > a[i+2]:
continue
cnt+=1
print(cnt)
lllllll88938494