結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー yuppe19 😺
提出日時 2015-05-08 23:24:17
言語 Go
(1.23.4)
結果
WA  
実行時間 -
コード長 750 bytes
コンパイル時間 10,552 ms
コンパイル使用メモリ 224,820 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-13 11:53:22
合計ジャッジ時間 10,870 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21 WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import "fmt"

var DEBUG bool = false
func debugsln(s string) { if DEBUG { fmt.Println(s) } }
func debugln(n int) { if DEBUG { fmt.Println(n) } }
func debug(s string, a ...interface{}) { if DEBUG { fmt.Printf(s, a...) } }

func main() {
  var d int
  fmt.Scanf("%d", &d)
  var s1, s2 string
  fmt.Scanf("%s\n%s", &s1, &s2)
  s := s1 + s2
  ha := 0
  for i:=0; i<len(s)-d+1; i++ {
    debugln(i)
    cp := []rune(s)
    for j:=i; j<i+d; j++ {
      if cp[j] == 'x' {
        cp[j] = 'o'
//      } else {
//        break
      }
    }
    cnt := 0
    for j:=0; j<len(s); j++ {
      if cp[j] == 'o' {
        cnt += 1
      } else {
        cnt = 0
      }
      if ha < cnt {
        ha = cnt
      }
    }
  }
  fmt.Printf("%d\n", ha)
}
0