結果
| 問題 |
No.881 sin(x)/xの和
|
| コンテスト | |
| ユーザー |
QCFium
|
| 提出日時 | 2019-09-02 10:59:01 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 959 bytes |
| コンパイル時間 | 2,449 ms |
| コンパイル使用メモリ | 183,876 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-26 21:02:11 |
| 合計ジャッジ時間 | 4,809 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 23 |
ソースコード
#pragma GCC target("avx2")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
int ri() {
int n;
scanf("%d", &n);
return n;
}
#define LOOP 40000
int main() {
int n = ri();
long double ans = 0;
std::vector<long double> sins(LOOP + 1001);
std::vector<long double> coss(LOOP + 1001);
for (int i = 1; i <= LOOP + 1000; i++) sins[i] = sin((long double)i), coss[i] = cos((long double)i);
for (int i = 0; i < n; i++) {
long double x, a;
scanf("%Lf%Lf", &x, &a);
long double r0 = sin(x) * x;
long double r1 = cos(x);
long double r2 = x * x;
long double res = 0;
long double addition = 0;
for (int j = LOOP; j; j--) res += (r0 * coss[j] - r1 * j * sins[j]) / (r2 - j * j);
for (int j = LOOP + 1; j <= LOOP + 1000; j++) addition += (r0 * coss[j] - r1 * j * sins[j]) / (r2 - j * j);
res += addition / 1000;
res *= 2;
res += sin(x) / x;
ans += res * a;
}
printf("%.12Lf\n", ans);
return 0;
}
QCFium