結果

問題 No.522 Make Test Cases(テストケースを作る)
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-26 18:21:14
言語 Java21
(openjdk 21)
結果
AC  
実行時間 630 ms / 2,000 ms
コード長 481 bytes
コンパイル時間 2,307 ms
コンパイル使用メモリ 76,396 KB
実行使用メモリ 60,876 KB
最終ジャッジ日時 2024-05-03 12:17:27
合計ジャッジ時間 7,534 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 248 ms
55,168 KB
testcase_01 AC 263 ms
57,288 KB
testcase_02 AC 263 ms
57,272 KB
testcase_03 AC 297 ms
58,364 KB
testcase_04 AC 170 ms
55,044 KB
testcase_05 AC 172 ms
54,908 KB
testcase_06 AC 171 ms
54,892 KB
testcase_07 AC 180 ms
54,972 KB
testcase_08 AC 193 ms
54,704 KB
testcase_09 AC 286 ms
57,176 KB
testcase_10 AC 630 ms
60,876 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import static java.lang.System.*;
import java.io.PrintWriter;

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