結果

問題 No.522 Make Test Cases(テストケースを作る)
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2017-07-17 16:57:17
言語 Java21
(openjdk 21)
結果
AC  
実行時間 557 ms / 2,000 ms
コード長 542 bytes
コンパイル時間 2,348 ms
コンパイル使用メモリ 76,528 KB
実行使用メモリ 49,652 KB
最終ジャッジ日時 2024-04-16 23:53:34
合計ジャッジ時間 6,375 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 211 ms
43,084 KB
testcase_01 AC 226 ms
44,256 KB
testcase_02 AC 213 ms
43,616 KB
testcase_03 AC 245 ms
46,160 KB
testcase_04 AC 152 ms
42,284 KB
testcase_05 AC 138 ms
42,428 KB
testcase_06 AC 160 ms
42,544 KB
testcase_07 AC 158 ms
42,608 KB
testcase_08 AC 167 ms
42,608 KB
testcase_09 AC 251 ms
44,884 KB
testcase_10 AC 557 ms
49,652 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);
                }else{
                    break;
                }
            }
        }
        pw.flush();
    }
}
0