結果
| 問題 | No.204 ゴールデン・ウィーク(2) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-08-16 21:26:19 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 404 bytes |
| 記録 | |
| コンパイル時間 | 502 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 15,484 KB |
| 最終ジャッジ日時 | 2026-05-08 01:56:49 |
| 合計ジャッジ時間 | 6,941 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 WA * 25 |
ソースコード
#!/usr/bin/env python3
def takewhile(s, c):
assert c in 'ox'
f = {'o':'x', 'x':'o'}
try:
return s[:s.index(f[c])]
except:
return s
d = int(input())
s = ''
s += input()
s += input()
ans = 0
for i in range(len(s)):
x = len(takewhile(s[i:], 'o'))
y = min(d, len(takewhile(s[i+x:], 'x')))
z = len(takewhile(s[i+x+y:], 'o'))
ans = max(ans, x + y + z)
print(ans)