結果
| 問題 | No.1486 ロボット |
| コンテスト | |
| ユーザー |
kou_kkk
|
| 提出日時 | 2026-09-07 10:06:30 |
| 言語 | Haskell (9.14.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 12 ms / 2,000 ms |
| + 506µs | |
| コード長 | 768 bytes |
| 記録 | |
| コンパイル時間 | 4,103 ms |
| コンパイル使用メモリ | 195,584 KB |
| 実行使用メモリ | 10,368 KB |
| 最終ジャッジ日時 | 2026-09-07 10:06:44 |
| 合計ジャッジ時間 | 6,118 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.14.1/environments/default
[1 of 2] Compiling Main ( Main.hs, Main.o )
Main.hs:10:7: warning: [GHC-63394] [-Wx-partial]
In the use of ‘head’
(imported from Prelude, but defined in GHC.Internal.List):
"This is a partial function, it throws an error on empty lists. Use pattern matching, 'Data.List.uncons' or 'Data.Maybe.listToMaybe' instead. Consider refactoring to use "Data.List.NonEmpty"."
|
10 | . head
| ^^^^
[2 of 2] Linking a.out
ソースコード
module Main where
type Input = [Int]
type Output = Int
parse :: String -> Input
parse =
map read
. words
. head
. lines
solve :: Input -> Output
solve input =
let
[a, b, c, d, e] = input
b1 = repeat True
b2 = repeat False
a' = take a b1
b' = take b b2
c' = take c b1
d' = take d b2
e' = lcm (a + b) (c + d)
(n, m) = e `divMod` e'
xs = cycle $ a' ++ b'
ys = cycle $ c' ++ d'
f =
length
. filter id
. zipWith (&&) xs
. flip take ys
in
n * f e' + f m
render :: Output -> String
render = show
main :: IO ()
main =
interact
( render
. solve
. parse
)
kou_kkk