結果
問題 | No.48 ロボットの操縦 |
ユーザー |
|
提出日時 | 2018-09-11 23:29:37 |
言語 | Haskell (9.10.1) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 416 bytes |
コンパイル時間 | 8,273 ms |
コンパイル使用メモリ | 173,696 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-24 10:17:07 |
合計ジャッジ時間 | 9,106 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
コンパイルメッセージ
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
ソースコード
moduleMainwhereimportControl.Monadrotate::Int->Int->Introtate 0 y| y >= 0 = 0rotate x y| y >= 0 = 1| otherwise = 2move::Int->Int->Intmove _ 0 = 0move dt n| r == 0 = q| otherwise = q + 1where(q, r) = (abs n) `divMod` dtmain::IO()main = dox <- readLn :: IO Inty <- readLndt <- readLnprint $ rotate x y + move dt x + move dt y