結果
| 問題 |
No.48 ロボットの操縦
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-04-03 17:55:16 |
| 言語 | Haskell (9.10.1) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 371 bytes |
| コンパイル時間 | 9,248 ms |
| コンパイル使用メモリ | 171,136 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-10-02 12:38:27 |
| 合計ジャッジ時間 | 2,790 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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 )
Main.hs:2:1: warning: [GHC-94817] [-Wtabs]
Tab character found here, and in 37 further locations.
Suggested fix: Please use spaces instead.
|
2 | [x, y, l] <- getContents >>= return . map read . lines
| ^^^^^^^^
[2 of 2] Linking a.out
ソースコード
main = do [x, y, l] <- getContents >>= return . map read . lines print $ if x == 0 && y == 0 then 0 else if x == 0 then if y > 0 then ceiling (y / l) else 2 + ceiling ((-y) / l) else if y == 0 then 1 + ceiling((abs x) / l) else if y > 0 then ceiling(y / l) + 1 + ceiling((abs x) / l) else 2 + ceiling((abs x) / l) + ceiling((-y) / l)