結果
| 問題 | No.204 ゴールデン・ウィーク(2) |
| コンテスト | |
| ユーザー |
aimy
|
| 提出日時 | 2018-02-03 12:03:03 |
| 言語 | Haskell (9.14.1) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 654 bytes |
| 記録 | |
| コンパイル時間 | 26 ms |
| 最終ジャッジ日時 | 2026-03-04 21:44:27 |
| 合計ジャッジ時間 | 281 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
eb3ca2bd4d4b
[/j_bin/judge_tool judge 40000 ../CompileMemory.txt /dev/null sud /dev/null _ ghc -rtsopts -with-rtsopts=-K1G -o a.out -O2 Main.hs]
strconv.Atoi: parsing "../CompileMemory.txt": invalid syntax
goroutine 1 [running]:
runtime/debug.Stack()
/home/yuki2006/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.0.linux-amd64/src/runtime/debug/stack.go:26 +0x5e
main.main.func1()
/home/yuki2006/gopath/src/yukicoder/judge/main.go:22 +0x57
panic({0x7d6880?, 0xc0000f6240?})
/home/yuki2006/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.0.linux-amd64/src/runtime/panic.go:783 +0x132
main.judgeMain({0xc000012300, 0x5?, 0x0?})
/home/yuki2006/gopath/src/yukicoder/judge/judge_linux.go:121 +0x4b1
main.main()
/home/yuki2006/gopath/src/yukicoder/judge/main.go:97 +0x277
ソースコード
import Data.List
import Control.Monad
main = do
d <- readLn
cs <- concat . words <$> getContents
let
gs = (map length . group) (replicate 14 'x' ++ cs ++ replicate 14 'x')
ans = do
guard (length gs > 2)
let
ansh = let (_:h:_) = gs in h + d
anst = let (_:t:_) = reverse gs in t + d
ansi = map (\[x,y,z] -> if d>=y then x+y+z else max x z + d) <$> windows3 (init (tail gs))
pure (maximum [ansh, anst, maybe 0 maximum ansi])
print (maybe d id ans)
windows3 xs
| length xs < 3 = Nothing
| otherwise = Just [g | (i,g) <- zip [0..] (zipWith3 (\x y z -> [x,y,z]) xs (drop 1 xs) (drop 2 xs)), even i]
aimy