結果
| 問題 | No.3847 Triple Balls Removal |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-11-03 18:50:51 |
| 言語 | PyPy3 (8.0.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 197 ms / 2,000 ms |
| + 440µs | |
| コード長 | 207 bytes |
| 記録 | |
| コンパイル時間 | 83 ms |
| コンパイル使用メモリ | 64,768 KB |
| 実行使用メモリ | 151,668 KB |
| 最終ジャッジ日時 | 2026-12-04 20:54:44 |
| 合計ジャッジ時間 | 6,401 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge6_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
N = int(input())
A = map(int, input().split())
x = []
ans = 0
for i in A:
if len(x) >= 2 and x[-1] == x[-2] == i:
ans += 3
x.pop()
x.pop()
else:
x.append(i)
print(ans)