結果

問題 No.648  お や す み 
ユーザー Freed_0929
提出日時 2018-02-10 00:44:11
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 374 bytes
コンパイル時間 2,578 ms
コンパイル使用メモリ 77,232 KB
実行使用メモリ 42,068 KB
最終ジャッジ日時 2024-10-09 08:48:55
合計ジャッジ時間 15,883 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 69 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        boolean c = true;
        int x=(int)Math.sqrt(2*N);
        if(x*(x+1)==2*N){
            System.out.println("YES\n" + x);
        } else {
            System.out.println("NO");
        }
    }
}
0