結果

問題 No.48 ロボットの操縦
ユーザー aimy
提出日時 2017-05-31 14:20:24
言語 Haskell
(9.10.1)
結果
WA  
実行時間 -
コード長 267 bytes
コンパイル時間 1,932 ms
コンパイル使用メモリ 171,392 KB
実行使用メモリ 6,940 KB
最終ジャッジ日時 2024-09-21 20:19:32
合計ジャッジ時間 2,847 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24 WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

main = do
 [x,y,l] <- map read . words <$> getContents
 print (robot x y l)

robot x y l = (div' x l) + (div' y l) + (rotate x y)
 where
  div' a b = let (d,m) = divMod (abs a) (abs b) in d + signum m
  rotate x y
   | x==0 && y>=0 = 0
   | y>0 = 1
   | otherwise = 2
0