結果
問題 |
No.648 お や す み
|
ユーザー |
|
提出日時 | 2018-02-10 00:58:29 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 231 bytes |
コンパイル時間 | 613 ms |
コンパイル使用メモリ | 64,556 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-13 21:05:53 |
合計ジャッジ時間 | 2,584 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 84 |
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main() | ^~~~
ソースコード
#include<iostream> using namespace std; long n,f,l; main() { cin>>n;l=2e9; for(int i=0;i<99;i++) { long m=f+l>>1; if(m*(m+1)/2<n)f=m; else l=m; } if(l*(l+1)/2==n) { cout<<"YES\n"<<l<<endl; } else cout<<"NO"<<endl; }