結果

問題 No.8072 Sum of sqrt(x)
ユーザー wdpuyo
提出日時 2020-12-03 09:26:54
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
OLE  
実行時間 -
コード長 1,266 bytes
コンパイル時間 4,528 ms
コンパイル使用メモリ 195,276 KB
最終ジャッジ日時 2025-01-16 14:15:22
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5 OLE * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘void Main()’:
main.cpp:38:26: warning: format ‘%ld’ expects argument of type ‘long int*’, but argument 2 has type ‘ll*’ {aka ‘long long int*’} [-Wformat=]
   38 |                 scanf("%ld", &x);
      |                        ~~^   ~~
      |                          |   |
      |                          |   ll* {aka long long int*}
      |                          long int*
      |                        %lld
main.cpp:33:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   33 |         scanf("%d", &n);
      |         ~~~~~^~~~~~~~~~
main.cpp:38:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   38 |                 scanf("%ld", &x);
      |                 ~~~~~^~~~~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>
#define INF 1000000000000000007
#define rep(i, N) for(ll i = 0; i < N; i++)
#define rep2(i, j, k) for(ll i = j; i < k; i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define print(x) cout << x << "\n"
#define print2(x, y) cout << x << " " << y << "\n"
#define printv(vec){for(auto p: vec) cout << p << " "; cout << "\n";} 
#define SUM(v) accumulate(v.begin(), v.end(), 0LL)
#define MAX(v) *max_element(v.begin(), v.end())
#define MIN(v) *min_element(v.begin(), v.end())
#define SORT(v) sort(v.begin(), v.end())
#define REV(v) reverse(v.begin(), v.end())
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
typedef long long ll;
using namespace std;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;

// #include <atcoder/all>
// using namespace atcoder;
// ll mod = 1000000007;
// using mint = modint1000000007;
// using mint = modint998244353;
// ll mod = 998244353;

void Main(){
	
	int n;
	scanf("%d", &n);
	double ans = 0.0;
	
	rep(i, n){
		ll x;
		scanf("%ld", &x);
		ans += sqrt(x);
		cout << fixed << setprecision(16) << ans << endl;
	}
	
}

int main(){
	
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	ll t = 1;
	// cin >> t;
	rep(i, t) Main();
	return 0;
	
}


0