結果
問題 | No.881 sin(x)/xの和 |
ユーザー |
![]() |
提出日時 | 2019-09-02 10:59:59 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 798 bytes |
コンパイル時間 | 2,608 ms |
コンパイル使用メモリ | 181,904 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-26 21:02:06 |
合計ジャッジ時間 | 4,670 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 WA * 22 |
ソースコード
#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 40003 int main() { int n = ri(); assert(n > 5); long double ans = 0; std::vector<long double> sins(LOOP + 1); std::vector<long double> coss(LOOP + 1); for (int i = 1; i <= LOOP; 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; for (int j = LOOP; j; j--) res += (r0 * coss[j] - r1 * j * sins[j]) / (r2 - j * j); res *= 2; res += sin(x) / x; ans += res * a; } printf("%.12Lf\n", ans); return 0; }