結果
| 問題 | No.204 ゴールデン・ウィーク(2) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-05-08 22:44:38 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 557 bytes |
| 記録 | |
| コンパイル時間 | 148 ms |
| コンパイル使用メモリ | 77,364 KB |
| 最終ジャッジ日時 | 2025-12-03 15:02:57 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 35 WA * 11 |
ソースコード
def getmax(s):
res = 0
for i in xrange(46):
cnt = 0
for si in s:
if si == "o": cnt += 1
else:
res = max(res, cnt)
cnt = 0
res = max(res, cnt)
return res
D = int(raw_input())
s = ["x"] * 16 + list(raw_input() + raw_input()) + ["x"] * 16
ans = getmax(s)
for d in xrange(1, D + 1):
for i in xrange(46):
if "xo" in s[i:i + d] and "ox" in s[i:i + d]: continue
ss = s[:]
ss[i:i + d] = "o" * d
ans = max(ans, getmax(ss))
print ans