結果
| 問題 | No.208 王将 |
| コンテスト | |
| ユーザー |
Konton7
|
| 提出日時 | 2019-05-01 09:54:49 |
| 言語 | Haskell (9.10.1) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 551 bytes |
| 記録 | |
| コンパイル時間 | 1,666 ms |
| コンパイル使用メモリ | 173,184 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-31 12:12:58 |
| 合計ジャッジ時間 | 2,607 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
コンパイルメッセージ
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 :: IO ()
main = do
input_line <- getLine
let king = map read (words input_line) :: [Int]
let kingx = king !! (0)
let kingy = king !! (1)
input_line2 <- getLine
let destinaion = map read (words input_line2) :: [Int]
let destinaionx = destinaion !! (0)
let destinaiony = destinaion !! (1)
putStrLn $ show (moving kingx kingy destinaionx destinaiony)
return ()
moving :: Int -> Int -> Int -> Int -> Int
moving a b c d
| a == b && c == d && a > c = a + 1
| otherwise = max a b
Konton7