結果

問題 No.522 Make Test Cases(テストケースを作る)
ユーザー くれちーくれちー
提出日時 2017-06-02 23:15:13
言語 Haskell
(9.8.2)
結果
AC  
実行時間 901 ms / 2,000 ms
コード長 292 bytes
コンパイル時間 7,377 ms
コンパイル使用メモリ 164,260 KB
実行使用メモリ 9,640 KB
最終ジャッジ日時 2023-10-22 01:39:02
合計ジャッジ時間 9,367 ms
ジャッジサーバーID
(参考情報)
judge9 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
9,372 KB
testcase_01 AC 42 ms
9,428 KB
testcase_02 AC 33 ms
9,392 KB
testcase_03 AC 72 ms
9,448 KB
testcase_04 AC 2 ms
5,188 KB
testcase_05 AC 2 ms
5,276 KB
testcase_06 AC 2 ms
5,192 KB
testcase_07 AC 3 ms
5,880 KB
testcase_08 AC 7 ms
9,348 KB
testcase_09 AC 52 ms
9,420 KB
testcase_10 AC 901 ms
9,640 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)
import Text.Printf (printf)

main :: IO ()
main = mapM_ (\(a, b, c) -> printf "%d %d %d\n" a b c) . solve =<< readLn

solve :: Int -> [(Int, Int, Int)]
solve n = do
    a <- [1 .. n]; b <- [1 .. n]
    guard $ a <= b && b <= n - a - b
    return (a, b, n - a - b)
0