結果

問題 No.522 Make Test Cases(テストケースを作る)
ユーザー htensaihtensai
提出日時 2019-12-26 12:33:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 466 ms / 2,000 ms
コード長 459 bytes
コンパイル時間 2,359 ms
コンパイル使用メモリ 75,192 KB
実行使用メモリ 93,164 KB
最終ジャッジ日時 2024-04-14 10:36:46
合計ジャッジ時間 6,843 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 155 ms
54,240 KB
testcase_01 AC 185 ms
54,404 KB
testcase_02 AC 179 ms
54,112 KB
testcase_03 AC 201 ms
56,400 KB
testcase_04 AC 135 ms
54,020 KB
testcase_05 AC 137 ms
54,736 KB
testcase_06 AC 136 ms
54,428 KB
testcase_07 AC 137 ms
54,124 KB
testcase_08 AC 146 ms
54,248 KB
testcase_09 AC 186 ms
56,332 KB
testcase_10 AC 466 ms
93,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        StringBuilder sb = new StringBuilder();
        for (int i = 1; i * 3 <= n; i++) {
            for (int j = i; i + j * 2 <= n; j++) {
                sb.append(i).append(" ").append(j).append(" ").append(n - i - j).append("\n");
            }
        }
        System.out.print(sb);
    }
}
0