用户输出
15854.0703378892215
Special Judge 信息
OK Error:0.00000000000387423427
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#31898 | #1012. L. 注重风控,风火轮模型 | Accepted | 100 | 17 ms | 356 K | C++ 17 / 846 B | 2n8asm | 2020-07-05 19:01:47 |
#ifdef D
#include "hpp.hpp"
#else
#include <bits/stdc++.h>
#endif
using namespace std;
using R = long double;
struct P {
R x;
R y;
};
vector<P> p;
R d = 0;
int i, n, r;
inline R dist(int x, int y) { return hypotl(p[x].x - p[y].x, p[x].y - p[y].y); }
inline R angl(int x, int y, int z) {
R const xy = dist(x, y);
R const xz = dist(x, z);
R const yz = dist(y, z);
R const a1 = acosl(xy / r) + acosl(yz / r);
R const a0 = acosl((xy * xy + yz * yz - xz * xz) / xy / yz / 2);
return a1 - a0;
}
int main() {
cin >> n >> r;
p.resize(n);
r <<= 1;
for (P &p : p) {
cin >> p.x >> p.y;
}
for (i = n - 1; i; --i) {
d += angl(i - 1, i, (i + 1) % n) * dist(i, 0);
}
cout << setprecision(numeric_limits<R>::digits10) << d;
}
用户输出
15854.0703378892215
Special Judge 信息
OK Error:0.00000000000387423427
系统信息
Exited with return code 0
15 21331
504.05781 3250.88951
1718.34697 1497.03649
3702.66308 378.64555
4424.20987 234.65996
4821.3
<235 bytes omitted>
用户输出
29335.8479446995139
Special Judge 信息
OK Error:0.00000000003143085792
系统信息
Exited with return code 0
15 35155
1903.22247 1332.58007
2542.13948 884.86186
4344.54468 244.96285
5745.72528 258.28156
7454.5
<234 bytes omitted>
用户输出
32799.8141018411319
Special Judge 信息
OK Error:0.00000000001307398634
系统信息
Exited with return code 0
100 21315
202.73110 4838.10150
207.03370 4740.24226
222.70360 4533.69633
233.73077 4431.95278
304.67
<2075 bytes omitted>
用户输出
29761.2550453168384
Special Judge 信息
OK Error:0.00000000100259534008
系统信息
Exited with return code 0