結果

問題 No.648  お や す み 
ユーザー しとお
提出日時 2018-02-23 18:34:50
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 274 bytes
コンパイル時間 671 ms
コンパイル使用メモリ 53,364 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-08 17:43:43
合計ジャッジ時間 18,504 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 53 WA * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main(){
  long long n;
  cin >> n;
  int count = 1;
  while(n>0){
    n -= count;
    count++;
  }
  if(n==0){
    cout << "YES" << '\n';
    cout << count << '\n';
  }
  else{
    cout << "NO" << '\n';
  }
  return 0;
}
    
  
0