結果
| 問題 |
No.284 門松と魔法(2)
|
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 14:48:04 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 751 bytes |
| コンパイル時間 | 160 ms |
| コンパイル使用メモリ | 82,040 KB |
| 実行使用メモリ | 88,836 KB |
| 最終ジャッジ日時 | 2025-06-12 14:51:24 |
| 合計ジャッジ時間 | 3,299 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 WA * 33 |
ソースコード
n = int(input())
a = list(map(int, input().split()))
if n < 3:
print(0)
else:
found = False
for k in range(6, 2, -1):
if k > n:
continue
for i in range(n - k + 1):
valid = True
for j in range(i, i + k - 2):
x = a[j]
y = a[j+1]
z = a[j+2]
if x == y or y == z or x == z:
valid = False
break
if not ((y > x and y > z) or (y < x and y < z)):
valid = False
break
if valid:
print(k)
found = True
break
if found:
break
if not found:
print(0)
gew1fw