結果
| 問題 |
No.881 sin(x)/xの和
|
| コンテスト | |
| ユーザー |
tko919
|
| 提出日時 | 2019-09-08 01:27:58 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 792 bytes |
| コンパイル時間 | 1,614 ms |
| コンパイル使用メモリ | 164,568 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-21 08:06:58 |
| 合計ジャッジ時間 | 2,500 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 23 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:22:11: warning: 'sum' may be used uninitialized [-Wmaybe-uninitialized]
22 | printf("%.12f\n",M_PI*sum);
| ~~~~~~^~~~~~~~~~~~~~~~~~~~
main.cpp:20:12: note: 'sum' was declared here
20 | double sum,p,tmp;
| ^~~
ソースコード
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
//template
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(a);i>(b);i--)
#define ALL(v) (v).begin(),(v).end()
typedef long long int ll; typedef pair<ll, ll> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<typename A,size_t N,typename T>void Fill(A(&array)[N],const T &val){fill((T*)array, (T*)(array+N), val);}
const int inf = INT_MAX / 2; const ll INF = LLONG_MAX / 2;
//template end
int main(){
int n; scanf("%d",&n);
double sum,p,tmp;
rep(i,0,n)scanf("%lf%lf",&tmp,&p),sum+=p;
printf("%.12f\n",M_PI*sum);
return 0;
}
tko919