結果

問題 No.522 Make Test Cases(テストケースを作る)
ユーザー Mcpu3Mcpu3
提出日時 2018-12-06 16:55:37
言語 Java21
(openjdk 21)
結果
AC  
実行時間 625 ms / 2,000 ms
コード長 404 bytes
コンパイル時間 3,819 ms
コンパイル使用メモリ 74,448 KB
実行使用メモリ 47,132 KB
最終ジャッジ日時 2023-10-12 02:48:35
合計ジャッジ時間 9,361 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 237 ms
41,072 KB
testcase_01 AC 277 ms
42,512 KB
testcase_02 AC 262 ms
42,104 KB
testcase_03 AC 307 ms
44,328 KB
testcase_04 AC 165 ms
40,676 KB
testcase_05 AC 166 ms
40,560 KB
testcase_06 AC 165 ms
40,756 KB
testcase_07 AC 172 ms
40,552 KB
testcase_08 AC 192 ms
41,020 KB
testcase_09 AC 290 ms
43,224 KB
testcase_10 AC 625 ms
47,132 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.io.PrintWriter;

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