結果

問題 No.648  お や す み 
ユーザー しとお
提出日時 2018-02-23 18:41:17
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 266 bytes
コンパイル時間 691 ms
コンパイル使用メモリ 53,492 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-08 18:05:25
合計ジャッジ時間 18,824 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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