結果

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

ソースコード

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