結果

問題 No.501 穴と文字列
ユーザー LeonardoneLeonardone
提出日時 2017-04-08 00:28:45
言語 Haskell
(9.8.2)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 327 bytes
コンパイル時間 898 ms
コンパイル使用メモリ 157,464 KB
実行使用メモリ 9,672 KB
最終ジャッジ日時 2023-08-21 07:13:59
合計ジャッジ時間 2,061 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
9,500 KB
testcase_01 AC 5 ms
9,460 KB
testcase_02 AC 3 ms
6,996 KB
testcase_03 AC 2 ms
6,996 KB
testcase_04 AC 2 ms
6,964 KB
testcase_05 AC 2 ms
6,984 KB
testcase_06 AC 2 ms
6,932 KB
testcase_07 AC 2 ms
6,984 KB
testcase_08 AC 2 ms
6,964 KB
testcase_09 AC 3 ms
6,984 KB
testcase_10 AC 3 ms
7,148 KB
testcase_11 AC 2 ms
7,232 KB
testcase_12 AC 3 ms
7,132 KB
testcase_13 AC 3 ms
7,052 KB
testcase_14 AC 2 ms
7,096 KB
testcase_15 AC 2 ms
7,148 KB
testcase_16 AC 2 ms
7,120 KB
testcase_17 AC 2 ms
7,136 KB
testcase_18 AC 5 ms
9,436 KB
testcase_19 AC 5 ms
9,508 KB
testcase_20 AC 5 ms
9,528 KB
testcase_21 AC 4 ms
9,672 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 My practice
-- author: Leonardone @ NEETSDKASU

main = putStrLn . solve . map read . words =<< getLine

solve [n, d] = hoge n d where
    hoge n d
         | n >= d = replicate d 'A' ++ replicate (n - d) 'C'
         | n < d  = replicate (n - bs) 'A' ++ replicate bs 'B'
         where
            bs = d - n
    
0