結果

問題 No.522 Make Test Cases(テストケースを作る)
ユーザー くれちーくれちー
提出日時 2017-06-02 23:11:14
言語 Haskell
(9.8.2)
結果
TLE  
実行時間 -
コード長 318 bytes
コンパイル時間 11,138 ms
コンパイル使用メモリ 162,000 KB
実行使用メモリ 9,580 KB
最終ジャッジ日時 2023-10-22 01:35:46
合計ジャッジ時間 21,880 ms
ジャッジサーバーID
(参考情報)
judge14 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
9,452 KB
testcase_01 AC 782 ms
9,404 KB
testcase_02 AC 452 ms
9,404 KB
testcase_03 TLE -
testcase_04 AC 2 ms
5,144 KB
testcase_05 AC 2 ms
5,236 KB
testcase_06 AC 3 ms
5,152 KB
testcase_07 AC 4 ms
5,948 KB
testcase_08 AC 23 ms
9,304 KB
testcase_09 AC 1,382 ms
9,404 KB
testcase_10 TLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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]; c <- [1 .. n]
    guard $ a + b + c == n
    guard $ a <= b && b <= c
    return (a, b, c)
0