結果

問題 No.164 ちっちゃくないよ!!
ユーザー tottoripapertottoripaper
提出日時 2015-03-12 23:39:54
言語 Haskell
(9.6.2)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 442 bytes
コンパイル時間 9,671 ms
コンパイル使用メモリ 164,000 KB
実行使用メモリ 9,792 KB
最終ジャッジ日時 2023-08-03 16:59:30
合計ジャッジ時間 5,509 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,856 KB
testcase_01 AC 2 ms
6,856 KB
testcase_02 AC 2 ms
6,880 KB
testcase_03 AC 3 ms
6,880 KB
testcase_04 AC 2 ms
6,972 KB
testcase_05 AC 5 ms
9,780 KB
testcase_06 AC 5 ms
9,792 KB
testcase_07 AC 3 ms
8,204 KB
testcase_08 AC 4 ms
8,784 KB
testcase_09 AC 4 ms
8,772 KB
testcase_10 AC 2 ms
7,060 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 Data.Char
import Data.List
    
f :: Char -> Int
f c
  | isAlpha c = ord c - ord 'A' + 10
  | otherwise = digitToInt c

main = do
  n <- readLn
  as <- replicateM n $ do
          s <- getLine
          let
              l = ['0'..'9'] ++ ['a'..'z']
              b = maximum $ map ((+1) . f) s
              g [] x = x
              g (c:s) x = g s (x * b + f c)
           in return $ g s 0
  print $ minimum as
0