結果

問題 No.522 Make Test Cases(テストケースを作る)
ユーザー くれちーくれちー
提出日時 2017-06-03 00:58:45
言語 Haskell
(9.8.2)
結果
AC  
実行時間 362 ms / 2,000 ms
コード長 257 bytes
コンパイル時間 1,637 ms
コンパイル使用メモリ 164,816 KB
実行使用メモリ 9,336 KB
最終ジャッジ日時 2023-10-22 02:15:09
合計ジャッジ時間 4,173 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
9,300 KB
testcase_01 AC 22 ms
9,336 KB
testcase_02 AC 22 ms
9,328 KB
testcase_03 AC 32 ms
9,332 KB
testcase_04 AC 2 ms
5,132 KB
testcase_05 AC 2 ms
5,208 KB
testcase_06 AC 2 ms
5,136 KB
testcase_07 AC 2 ms
5,524 KB
testcase_08 AC 5 ms
8,308 KB
testcase_09 AC 21 ms
9,332 KB
testcase_10 AC 362 ms
9,332 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.2/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

import Control.Monad (guard)

main :: IO ()
main = mapM_ (putStrLn . unwords . map show) . solve =<< readLn

solve :: Int -> [[Int]]
solve n = do
    a <- [1 .. n `div` 3]
    b <- [a .. n * 2 `div` 3]
    guard $ b <= n - a - b
    return [a, b, n - a - b]
0