結果
問題 |
No.3017 交互浴
|
ユーザー |
![]() |
提出日時 | 2024-12-30 15:04:54 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 374 bytes |
コンパイル時間 | 606 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 153,984 KB |
最終ジャッジ日時 | 2025-01-25 22:12:08 |
合計ジャッジ時間 | 61,871 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | WA * 10 OLE * 45 |
ソースコード
N = int(input()) H = list(map(int, input().split())) stk = [(10 ** 18, 1)] def query(h, cl): while stk: pre_h, pre_cl = stk[-1] if h <= pre_h: if pre_cl != cl: stk.append((h, cl)) break else: stk.pop() ans = len(stk) // 2 print(stk, ans) for i, h in enumerate(H): query(h, i % 2)