結果
問題 | No.116 門松列(1) |
ユーザー |
|
提出日時 | 2023-10-21 23:05:27 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 30 ms / 5,000 ms |
コード長 | 326 bytes |
コンパイル時間 | 110 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-09-22 00:34:30 |
合計ジャッジ時間 | 1,738 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
def is_kadomatsu(a, b, c):if a == b or b == c or c == a:return Falseif a < b > c or a > b < c:return Trueelse:return Falsen = int(input())A = list(map(int, input().split()))ans = 0for i in range(n - 2):if is_kadomatsu(A[i], A[i + 1], A[i + 2]):ans += 1print(ans)