結果

問題 No.2054 Different Sequence
ユーザー tentententen
提出日時 2022-08-22 12:59:09
言語 Java21
(openjdk 21)
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 1,055 bytes
コンパイル時間 2,318 ms
コンパイル使用メモリ 75,296 KB
実行使用メモリ 37,240 KB
最終ジャッジ日時 2024-04-18 13:22:26
合計ジャッジ時間 4,142 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
37,236 KB
testcase_01 AC 55 ms
36,748 KB
testcase_02 AC 53 ms
36,940 KB
testcase_03 AC 54 ms
36,852 KB
testcase_04 AC 52 ms
37,100 KB
testcase_05 AC 53 ms
37,180 KB
testcase_06 AC 54 ms
37,240 KB
testcase_07 AC 53 ms
36,944 KB
testcase_08 AC 53 ms
37,032 KB
testcase_09 AC 53 ms
37,000 KB
testcase_10 AC 54 ms
37,092 KB
testcase_11 AC 52 ms
36,928 KB
testcase_12 AC 53 ms
37,016 KB
testcase_13 AC 52 ms
36,992 KB
testcase_14 AC 54 ms
37,048 KB
testcase_15 AC 53 ms
37,000 KB
testcase_16 AC 53 ms
37,064 KB
testcase_17 AC 53 ms
37,000 KB
testcase_18 AC 53 ms
37,168 KB
testcase_19 AC 53 ms
37,040 KB
testcase_20 AC 52 ms
36,652 KB
testcase_21 AC 54 ms
36,864 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        long n = sc.nextInt();
        int m = sc.nextInt();
        if ((n + 1) * n / 2 <= m) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}

class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    
    public Scanner() throws Exception {
        
    }
    
    public int nextInt() throws Exception {
        return Integer.parseInt(next());
    }
    
    public long nextLong() throws Exception {
        return Long.parseLong(next());
    }
    
    public double nextDouble() throws Exception {
        return Double.parseDouble(next());
    }
    
    public String next() throws Exception {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
}
0