結果

問題 No.164 ちっちゃくないよ!!
コンテスト
ユーザー tottoripaper
提出日時 2015-03-12 23:39:54
言語 Haskell
(9.14.1)
コンパイル:
ghc -rtsopts -with-rtsopts=-K1G -o a.out -O2 _filename_
実行:
./a.out
結果
AC  
実行時間 6 ms / 2,000 ms
コード長 442 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 12,672 ms
コンパイル使用メモリ 195,584 KB
実行使用メモリ 8,960 KB
最終ジャッジ日時 2026-05-01 00:40:35
合計ジャッジ時間 8,637 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
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

ソースコード

diff #
raw source code

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