結果

問題 No.648  お や す み 
ユーザー ohreitetsu
提出日時 2018-02-17 22:03:32
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 1,095 ms / 2,000 ms
コード長 278 bytes
コンパイル時間 577 ms
コンパイル使用メモリ 54,432 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-13 21:10:42
合計ジャッジ時間 25,665 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 84
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
typedef long long LL;
int main(int argc, char* argv[])
{
	LL n;
	cin>>n;
	LL i=1;
	LL N=0;
	while(true){
		N+=i;
		if (N>=n){
			break;
		}
		i++;
	}
	if (N==n){
		cout<<"YES"<<endl;
		cout<<i;
	}else{
		cout<<"NO"<<endl;
	}
	return 0;
}
0