結果
問題 | No.48 ロボットの操縦 |
ユーザー |
|
提出日時 | 2015-04-22 18:23:48 |
言語 | Haskell (9.10.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 323 bytes |
コンパイル時間 | 2,450 ms |
コンパイル使用メモリ | 172,160 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-05 00:18:02 |
合計ジャッジ時間 | 2,449 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
ソースコード
main = getContents >>= print . solve . map read . lines solve :: [Int] -> Int solve [x, y, l] = a + b + c + d where a = div (abs x) l + if mod (abs x) l == 0 then 0 else 1 b = div (abs y) l + if mod (abs y) l == 0 then 0 else 1 c = if y < 0 then 1 else 0 d = if x == 0 then 0 else 1