結果

問題 No.3004 愛国心
ユーザー poapoapoapoa
提出日時 2020-07-21 18:35:01
言語 Haskell
(9.8.2)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 482 bytes
コンパイル時間 2,149 ms
コンパイル使用メモリ 162,672 KB
実行使用メモリ 7,068 KB
最終ジャッジ日時 2023-08-28 21:00:10
合計ジャッジ時間 2,792 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
7,068 KB
testcase_01 AC 2 ms
6,996 KB
testcase_02 AC 2 ms
7,004 KB
testcase_03 AC 2 ms
7,048 KB
testcase_04 AC 3 ms
7,032 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 #

yukicoder :: Int -> [Char]
yukicoder 1 = ['y']
yukicoder 2 = ['u']
yukicoder 3 = ['k']
yukicoder 4 = ['i']
yukicoder 5 = ['c']
yukicoder 6 = ['o']
yukicoder 7 = ['d']
yukicoder 8 = ['e']
yukicoder 9 = ['r']
yukicoder _ = []

main :: IO ()
main = do
  xs <- f . map (read :: String -> Int) . words <$> getContents
  putStr $ unlines $ map yukicoder xs

f :: [Int] -> [Int]
f []  = []
f [x]
  | x == 0    = []
  | otherwise = [x]
f (x:xs)
  | x == 0    = []
  | otherwise = x : (f xs)
0