結果
問題 |
No.204 ゴールデン・ウィーク(2)
|
ユーザー |
|
提出日時 | 2015-05-08 22:47:48 |
言語 | Go (1.23.4) |
結果 |
WA
|
実行時間 | - |
コード長 | 677 bytes |
コンパイル時間 | 12,781 ms |
コンパイル使用メモリ | 226,048 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-13 11:38:07 |
合計ジャッジ時間 | 13,928 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 10 WA * 36 |
ソースコード
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++ { cp[j] = 'o' } 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) }