結果

問題 No.2560 A_1 < A_2 < ... < A_N
ユーザー viral8viral8
提出日時 2023-12-02 14:43:23
言語 Java21
(openjdk 21)
結果
AC  
実行時間 394 ms / 2,000 ms
コード長 662 bytes
コンパイル時間 2,554 ms
コンパイル使用メモリ 74,748 KB
実行使用メモリ 61,568 KB
最終ジャッジ日時 2023-12-02 14:43:33
合計ジャッジ時間 6,762 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
52,172 KB
testcase_01 AC 177 ms
59,928 KB
testcase_02 AC 192 ms
59,212 KB
testcase_03 AC 180 ms
60,452 KB
testcase_04 AC 201 ms
59,512 KB
testcase_05 AC 209 ms
60,468 KB
testcase_06 AC 367 ms
61,568 KB
testcase_07 AC 369 ms
61,080 KB
testcase_08 AC 394 ms
61,124 KB
testcase_09 AC 381 ms
61,164 KB
testcase_10 AC 374 ms
61,048 KB
testcase_11 AC 57 ms
54,120 KB
testcase_12 AC 61 ms
54,116 KB
testcase_13 AC 57 ms
54,124 KB
testcase_14 AC 55 ms
54,108 KB
testcase_15 AC 70 ms
54,788 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
class Main{
	private static final BufferedReader br =
		new BufferedReader(new InputStreamReader(System.in));
	private static final PrintWriter out =
		new PrintWriter(System.out);
	public static void main(String[] args)throws IOException{

		int T = Integer.parseInt(br.readLine());
		while(T-->0){
			String[] str = br.readLine().split(" ");
			int N = Integer.parseInt(str[0]);
			long X = Long.parseLong(str[1]);
			if(X<(long)N*(N+1)/2)
				out.println(-1);
			else{
				for(int i=1;i<N;i++){
					out.print(i);
					out.print(" ");
				}
				out.println(X-(long)N*(N-1)/2);
			}
		}

		br.close();
		out.close();
	}
}
0