結果

問題 No.522 Make Test Cases(テストケースを作る)
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2017-07-17 16:55:37
言語 Java21
(openjdk 21)
結果
AC  
実行時間 1,943 ms / 2,000 ms
コード長 554 bytes
コンパイル時間 2,151 ms
コンパイル使用メモリ 76,788 KB
実行使用メモリ 62,900 KB
最終ジャッジ日時 2024-04-16 23:52:59
合計ジャッジ時間 9,272 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 269 ms
44,020 KB
testcase_01 AC 393 ms
47,900 KB
testcase_02 AC 340 ms
46,456 KB
testcase_03 AC 506 ms
51,912 KB
testcase_04 AC 158 ms
42,900 KB
testcase_05 AC 160 ms
42,732 KB
testcase_06 AC 158 ms
42,724 KB
testcase_07 AC 187 ms
42,992 KB
testcase_08 AC 220 ms
43,480 KB
testcase_09 AC 450 ms
50,252 KB
testcase_10 AC 1,943 ms
62,900 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.PrintWriter;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        int N = sc.nextInt();
        for(int i=1; i<=N/3; i++){
            for(int j=i; j<=N/2; j++){
                int k = N-(i+j);
                if(k>=j){
                    pw.println(i+" "+j+" "+k);
                    pw.flush();
                }else{
                    break;
                }
            }
        }
    }
}
0