結果
| 問題 | No.522 Make Test Cases(テストケースを作る) |
| コンテスト | |
| ユーザー |
kou_kkk
|
| 提出日時 | 2025-07-06 02:33:44 |
| 言語 | Haskell (9.10.1) |
| 結果 |
AC
|
| 実行時間 | 407 ms / 2,000 ms |
| コード長 | 537 bytes |
| コンパイル時間 | 8,912 ms |
| コンパイル使用メモリ | 174,848 KB |
| 実行使用メモリ | 9,984 KB |
| 最終ジャッジ日時 | 2025-07-06 02:33:56 |
| 合計ジャッジ時間 | 5,955 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.10.1/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
module Main where
main :: IO ()
main = readLn >>= mapM_ putStrLn . solve
solve :: Int -> [String]
solve = map (unwords . map show) . aux 1 1 . (subtract 2)
aux :: Int -> Int -> Int -> [[Int]]
aux a b c | c - a <= 1 = [ns]
| otherwise = ns : aux a' b' c'
where
ns = [a, b, c]
(a', b', c') = next a b c
next :: Int -> Int -> Int -> (Int, Int, Int)
next a b c | b + 1 <= c - 1 = (a, b + 1, c - 1)
| otherwise = (a + 1, a + 1, n - (a + 1) * 2)
where
n = a + b + c
kou_kkk