結果

問題 No.2054 Different Sequence
ユーザー ks2mks2m
提出日時 2022-08-21 12:55:32
言語 Java21
(openjdk 21)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 338 bytes
コンパイル時間 2,251 ms
コンパイル使用メモリ 77,276 KB
実行使用メモリ 41,496 KB
最終ジャッジ日時 2024-04-18 12:42:57
合計ジャッジ時間 5,647 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
41,324 KB
testcase_01 AC 124 ms
41,496 KB
testcase_02 AC 131 ms
41,300 KB
testcase_03 AC 127 ms
41,256 KB
testcase_04 AC 116 ms
39,944 KB
testcase_05 AC 130 ms
41,048 KB
testcase_06 AC 126 ms
41,104 KB
testcase_07 AC 124 ms
41,172 KB
testcase_08 AC 128 ms
41,284 KB
testcase_09 AC 129 ms
41,068 KB
testcase_10 AC 130 ms
41,356 KB
testcase_11 AC 111 ms
40,128 KB
testcase_12 AC 127 ms
41,324 KB
testcase_13 AC 124 ms
41,280 KB
testcase_14 AC 114 ms
39,992 KB
testcase_15 AC 129 ms
41,048 KB
testcase_16 AC 128 ms
41,280 KB
testcase_17 AC 116 ms
40,352 KB
testcase_18 AC 115 ms
39,996 KB
testcase_19 AC 127 ms
41,204 KB
testcase_20 AC 118 ms
40,472 KB
testcase_21 AC 116 ms
39,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		sc.close();

		long s = (long) n * (n + 1) / 2;
		if (s <= m) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}
0