結果
問題 |
No.648 お や す み
|
ユーザー |
|
提出日時 | 2018-03-06 22:29:16 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 276 bytes |
コンパイル時間 | 1,264 ms |
コンパイル使用メモリ | 160,400 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-13 21:15:11 |
合計ジャッジ時間 | 3,229 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 84 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:11:35: warning: use of ‘ll’ length modifier with ‘f’ type character has either no effect or undefined behavior [-Wformat=] 11 | printf("YES\n%.0llf\n",kai); | ^
ソースコード
#include <bits/stdc++.h> #define eps 1e-9 using namespace std; int main(){ long double n; cin >> n; long double kai = (-1+sqrt(1+4*2*n))/2; long double comp = floor(kai); if (abs(kai-comp)<=eps){ printf("YES\n%.0llf\n",kai); } else{ printf("NO\n"); } return 0; }