結果

問題 No.522 Make Test Cases(テストケースを作る)
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-26 18:04:24
言語 Java21
(openjdk 21)
結果
AC  
実行時間 1,857 ms / 2,000 ms
コード長 366 bytes
コンパイル時間 2,280 ms
コンパイル使用メモリ 76,040 KB
実行使用メモリ 52,764 KB
最終ジャッジ日時 2024-05-03 11:43:35
合計ジャッジ時間 8,824 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 268 ms
43,552 KB
testcase_01 AC 401 ms
50,712 KB
testcase_02 AC 364 ms
47,936 KB
testcase_03 AC 491 ms
52,292 KB
testcase_04 AC 148 ms
42,184 KB
testcase_05 AC 149 ms
42,556 KB
testcase_06 AC 157 ms
42,516 KB
testcase_07 AC 166 ms
42,408 KB
testcase_08 AC 197 ms
43,020 KB
testcase_09 AC 433 ms
48,316 KB
testcase_10 AC 1,857 ms
52,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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