結果
| 問題 | No.208 王将 |
| コンテスト | |
| ユーザー |
Konton7
|
| 提出日時 | 2019-05-01 09:54:49 |
| 言語 | Haskell (9.14.1) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 1,000 ms |
| コード長 | 551 bytes |
| 記録 | |
| コンパイル時間 | 4,240 ms |
| コンパイル使用メモリ | 194,688 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-05 00:10:05 |
| 合計ジャッジ時間 | 3,124 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.14.1/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