結果
問題 |
No.48 ロボットの操縦
|
ユーザー |
|
提出日時 | 2015-04-22 18:26:31 |
言語 | Haskell (9.10.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 375 bytes |
コンパイル時間 | 1,790 ms |
コンパイル使用メモリ | 172,928 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-05 00:18:10 |
合計ジャッジ時間 | 2,630 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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 + e 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 e = if x == 0 && y < 0 then (-1) else 0