結果
| 問題 |
No.1924 3 color painting on a line
|
| ユーザー |
lam6er
|
| 提出日時 | 2025-04-16 00:39:10 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 350 bytes |
| コンパイル時間 | 238 ms |
| コンパイル使用メモリ | 82,004 KB |
| 実行使用メモリ | 74,200 KB |
| 最終ジャッジ日時 | 2025-04-16 00:42:41 |
| 合計ジャッジ時間 | 3,688 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 WA * 42 |
ソースコード
n = int(input())
s = input().strip()
if n == 0:
print(0)
exit()
# Split into runs
runs = []
current = s[0]
runs.append(current)
for c in s[1:]:
if c != current:
current = c
runs.append(current)
m = len(runs)
k = 0
for i in range(2, m):
if runs[i] == runs[i-2] and runs[i-1] != runs[i]:
k += 1
print(m - k)
lam6er