結果
問題 | No.327 アルファベット列 |
ユーザー |
|
提出日時 | 2018-08-09 13:48:51 |
言語 | Haskell (9.10.1) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 371 bytes |
コンパイル時間 | 5,242 ms |
コンパイル使用メモリ | 176,256 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-23 04:20:50 |
合計ジャッジ時間 | 6,892 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 50 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
importControl.Applicative(<$>)importData.ListunfoldrimportData.Charord,chrmain::IO()main = solve <$> readLn >>= putStrLnsolve::Int->Stringsolve n = reverse $ unfoldr f (n+1)where f x | x == 0 = Nothing| r == 0 = Just ('Z', q-1)| otherwise = Just (chr (ord 'A' - 1 + r), q)where (q, r) = divMod x 26