結果

問題 No.467 隠されていたゲーム
ユーザー atuk721atuk721
提出日時 2017-02-06 08:10:31
言語 Haskell
(9.8.2)
結果
TLE  
実行時間 -
コード長 354 bytes
コンパイル時間 682 ms
コンパイル使用メモリ 157,236 KB
実行使用メモリ 15,272 KB
最終ジャッジ日時 2023-08-25 22:55:57
合計ジャッジ時間 4,905 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
14,104 KB
testcase_01 AC 3 ms
6,988 KB
testcase_02 AC 3 ms
7,128 KB
testcase_03 AC 2 ms
7,124 KB
testcase_04 AC 2 ms
7,060 KB
testcase_05 AC 3 ms
7,120 KB
testcase_06 AC 2 ms
7,060 KB
testcase_07 AC 2 ms
7,076 KB
testcase_08 TLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

main :: IO ()
main = do
  getLine
  ds <- fmap (map read . words) getLine
  [dx, dy] <- fmap (map read . words) getLine
  let result = proc 0 ds (max dx dy)
  print result

proc :: Int -> [Int] -> Int -> Int
proc count ds dest
  | dest `elem` ds = count + 1
  | dest < (maximum ds * 2) = count + 2
  | otherwise = proc (count + 1) ds (dest - maximum ds)
0