結果
問題 | No.116 門松列(1) |
ユーザー |
|
提出日時 | 2017-08-06 11:09:32 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 32 ms / 5,000 ms |
コード長 | 484 bytes |
コンパイル時間 | 102 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-06-25 01:30:55 |
合計ジャッジ時間 | 1,643 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
N = int(input())A = input().split()A = [int(i) for i in A]def ch(int1, int2, int3):if (int1 == int2) or (int2 == int3) or (int1 == int3):return 0elif ((int1 < int2) and (int1 > int3)) or ((int1 > int2) and (int1 < int3)):return 1elif ((int3 < int1) and (int3 > int2)) or ((int3 > int1) and (int3 < int2)):return 1else:return 0chcount = 0for i in range(0, N-2):count = count + ch(A[i], A[i+1], A[i+2])print(count)