結果
問題 |
No.8072 Sum of sqrt(x)
|
ユーザー |
![]() |
提出日時 | 2020-06-14 01:51:48 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
OLE
|
実行時間 | - |
コード長 | 293 bytes |
コンパイル時間 | 1,011 ms |
コンパイル使用メモリ | 88,940 KB |
最終ジャッジ日時 | 2025-01-11 04:02:35 |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 4 TLE * 20 OLE * 3 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:14:9: warning: ‘sum’ may be used uninitialized [-Wmaybe-uninitialized] 14 | sum += __float128(sqrt(x)); | ~~~~^~~~~~~~~~~~~~~~~~~~~~ main.cpp:11:14: note: ‘sum’ was declared here 11 | __float128 sum; | ^~~
ソースコード
#include<iostream> #include<iomanip> #include<cmath> using namespace std; int main(){ int N; cin >> N; long double x; __float128 sum; for(int i=0;i<N;i++){ cin >> x; sum += __float128(sqrt(x)); cout << scientific << setprecision(16) << (long double)(sum) << endl; } }