結果
| 問題 |
No.116 門松列(1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-08-08 23:31:54 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 34 ms / 5,000 ms |
| コード長 | 385 bytes |
| コンパイル時間 | 95 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-06-25 01:30:57 |
| 合計ジャッジ時間 | 1,633 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
import itertools
input()
ary = list(map(int, input().split()))
ans = 0
for i in range(len(ary) - 2):
tmp = ary[i:i + 3]
dup = False
for j in itertools.combinations(tmp, 2):
if(j[0] == j[1]):
dup = True
if(not dup):
tmp[tmp.index(max(tmp))] = 0
if(tmp.index(max(tmp)) == 0 or tmp.index(max(tmp)) == 2):
ans += 1
print(ans)