結果
問題 |
No.204 ゴールデン・ウィーク(2)
|
ユーザー |
|
提出日時 | 2016-09-05 13:53:43 |
言語 | Python2 (2.7.18) |
結果 |
RE
|
実行時間 | - |
コード長 | 364 bytes |
コンパイル時間 | 63 ms |
コンパイル使用メモリ | 6,912 KB |
実行使用メモリ | 6,400 KB |
最終ジャッジ日時 | 2024-11-15 20:26:58 |
合計ジャッジ時間 | 1,731 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 44 RE * 2 |
ソースコード
D = input() s = raw_input()+raw_input() o = map(len, filter(None, s.split('x'))) x = map(len, filter(None, s.split('o'))) if s.startswith('x'): x.pop(0) if s.endswith('x'): x.pop() ans = max(o[0]+D, o[-1]+D) for i in xrange(len(x)): if x[i] <= D: ans = max(ans, o[i]+x[i]+o[i+1]) else: ans = max(ans, max(o[i], o[i+1])+D) print ans