結果

問題 No.648  お や す み 
ユーザー totori_nyaa
提出日時 2019-07-17 22:27:51
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 299 bytes
コンパイル時間 1,591 ms
コンパイル使用メモリ 165,516 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-23 12:15:54
合計ジャッジ時間 3,922 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 84
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

signed main(){
    ios::sync_with_stdio(false);
	cin.tie(0);
 
    ll n;
    cin>>n;
    ll now=0;
    n*=2;
    ll t=sqrt(n);
    if(t*(t+1)==n){
        cout<<"YES"<<endl;
        cout<<t<<endl;
    }
    else cout<<"NO"<<endl;
}
0