結果
| 問題 |
No.204 ゴールデン・ウィーク(2)
|
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2015-07-23 00:36:50 |
| 言語 | Go (1.23.4) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 635 bytes |
| コンパイル時間 | 9,983 ms |
| コンパイル使用メモリ | 222,944 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-13 13:28:50 |
| 合計ジャッジ時間 | 11,131 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 46 |
ソースコード
package main
import (
"fmt"
)
func max(a, b int) int {
if a > b {
return a
} else {
return b
}
}
func main() {
var d int
var a, b string
fmt.Scanf("%d %s %s", &d, &a, &b)
s := a + b
fmt.Printf("%d %s\n", d, s)
p := 0
ans := 0
for i := -d; i <= len(s); i++ {
// i 日目から有給取る
for j := -d; j < max(len(s), i+d); j++ {
off := false
if 0 <= j && j < len(s) && s[j] == 'o' { // スケジュール上の休日
off = true
}
if i <= j && j < i+d { // 有給
off = true
}
if off {
p++
if p > ans {
ans = p
}
} else {
p = 0
}
}
}
fmt.Println(ans)
}
norioc