結果
| 問題 | No.8072 Sum of sqrt(x) |
| ユーザー |
maspy
|
| 提出日時 | 2020-06-14 01:51:48 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
(最新)
OLE
(最初)
|
| 実行時間 | - |
| コード長 | 293 bytes |
| 記録 | |
| コンパイル時間 | 678 ms |
| コンパイル使用メモリ | 101,836 KB |
| 実行使用メモリ | 7,972 KB |
| 最終ジャッジ日時 | 2026-06-10 17:49:49 |
| 合計ジャッジ時間 | 47,187 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 27 |
コンパイルメッセージ
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;
}
}
maspy