結果

問題 No.83 最大マッチング
ユーザー jugemjugemjugemjugemjugemjugem
提出日時 2017-11-28 00:24:54
言語 Haskell
(9.8.2)
結果
WA  
実行時間 -
コード長 313 bytes
コンパイル時間 3,721 ms
コンパイル使用メモリ 167,440 KB
実行使用メモリ 7,492 KB
最終ジャッジ日時 2023-08-18 08:12:03
合計ジャッジ時間 4,603 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,984 KB
testcase_01 AC 3 ms
6,968 KB
testcase_02 AC 2 ms
6,920 KB
testcase_03 AC 3 ms
6,916 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 #

import Control.Monad
import Control.Applicative
import Data.List

main = do
  t <- readLn

  putStrLn . show $ solve t [0,0,1,7,7,7,9,9,9,9]

solve :: Int -> [Int]-> Int
solve 2 xs = 1
solve n xs
  | n > 9 = (xs !! 9)*10 + solve (n-9) xs
  | n >= 4 = (xs !! (n-2))*10 + solve (n-(n-2)) xs
  | otherwise = xs !! n
0