用户输出
10589.082471941052063
Special Judge 信息
Error(5264.98786594816556316800) too large
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#81361 | #1012. L. 注重风控,风火轮模型 | Wrong Answer | 0 | 15 ms | 396 K | C++ 17 / 3.6 K | sunrise1024 | 2022-09-24 20:40:58 |
#include <bits/stdc++.h>
#define jjl(i, j) jl(a[gid(i)], a[gid(j)])
using namespace std;
typedef long long ll;
namespace fastio {
const int bufl = 1 << 16;
const double base1[16] = { 1, 1e-1, 1e-2, 1e-3, 1e-4, 1e-5, 1e-6, 1e-7,
1e-8, 1e-9, 1e-10, 1e-11, 1e-12, 1e-13, 1e-14, 1e-15 };
const double base2[16] = {
1, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13, 1e14, 1e15
};
struct IN {
FILE* IT;
char ibuf[bufl], *is = ibuf, *it = ibuf;
IN() { IT = stdin; }
IN(char* a) { IT = fopen(a, "r"); }
inline char getChar() {
if (is == it) {
it = (is = ibuf) + fread(ibuf, 1, bufl, IT);
if (is == it)
return EOF;
}
return *is++;
}
template <typename Temp>
inline void getInt(Temp& a) {
a = 0;
int b = 0, c = getChar();
while (c < 48 || c > 57) b ^= (c == 45), c = getChar();
while (c >= 48 && c <= 57) a = (a << 1) + (a << 3) + c - 48, c = getChar();
if (b)
a = -a;
}
template <typename Temp>
inline void getDouble(Temp& a) {
a = 0;
int b = 0, c = getChar(), d = 0;
__int128 e = 0, f = 0;
while (c < 48 || c > 57) b ^= (c == 45), c = getChar();
while (c >= 48 && c <= 57) e = (e << 1) + (e << 3) + c - 48, c = getChar();
if (c == 46) {
c = getChar();
while (c >= 48 && c <= 57) d++, f = (f << 1) + (f << 3) + c - 48, c = getChar();
}
a = e + base1[d] * f;
if (b)
a = -a;
}
IN& operator>>(char& a) {
a = getChar();
return *this;
}
IN& operator>>(char* a) {
do {
*a = getChar();
} while (*a <= 32);
while (*a > 32) *++a = getChar();
*a = 0;
return *this;
}
IN& operator>>(string& a) {
char b = getChar();
while (b <= 32) b = getChar();
while (b > 32) a += b, b = getChar();
return *this;
}
IN& operator>>(int& a) {
getInt(a);
return *this;
}
IN& operator>>(long long& a) {
getInt(a);
return *this;
}
IN& operator>>(__int128& a) {
getInt(a);
return *this;
}
IN& operator>>(float& a) {
getDouble(a);
return *this;
}
IN& operator>>(double& a) {
getDouble(a);
return *this;
}
IN& operator>>(long double& a) {
getDouble(a);
return *this;
}
};
struct OUT {
FILE* IT;
char obuf[bufl], *os = obuf, *ot = obuf + bufl;
int Eps;
long double Acc;
OUT() { IT = stdout, Eps = 6, Acc = 1e-6; }
OUT(char* a) { IT = fopen(a, "w"), Eps = 6, Acc = 1e-6; }
inline void ChangEps(int x = 6) { Eps = x; }
inline void flush() {
fwrite(obuf, 1, os - obuf, IT);
os = obuf;
}
inline void putChar(int a) {
*os++ = a;
if (os == ot)
flush();
}
template <typename Temp>
inline void putInt(Temp a) {
if (a < 0) {
putChar(45);
a = -a;
}
if (a < 10) {
putChar(a + 48);
return;
}
putInt(a / 10);
putChar(a % 10 + 48);
}
template <typename Temp>
inline void putDouble(Temp a) {
if (a < 0) {
putChar(45);
a = -a;
}
__int128 b = a;
putInt(b);
a -= b;
a *= base2[Eps];
b = a + Acc;
putChar(46);
putInt(b);
}
OUT& operator<<(char a) {
putChar(a);
return *this;
}
OUT& operator<<(char* a) {
while (*a > 32) putChar(*a++);
return *this;
}
OUT& operator<<(string a) {
for (auto c : a) putChar(c);
return *this;
}
OUT& operator<<(int a) {
putInt(a);
return *this;
}
OUT& operator<<(long long a) {
putInt(a);
return *this;
}
OUT& operator<<(__int128 a) {
putInt(a);
return *this;
}
OUT& operator<<(float a) {
putDouble(a);
return *this;
}
OUT& operator<<(double a) {
putDouble(a);
return *this;
}
OUT& operator<<(long double a) {
putDouble(a);
return *this;
}
~OUT() { flush(); }
};
} // namespace fastio
using fastio::IN;
using fastio::OUT;
struct node {
double x, y;
} a[105];
int n;
double r;
double jl(node x, node y) { return sqrt((x.x - y.x) * (x.x - y.x) + (x.y - y.y) * (x.y - y.y)); }
double qa(double a, double b, double c) { return acos((b * b + c * c - a * a) / b / c / 2); }
double ans;
int gid(int x) { return (x - 1) % n + 1; }
int main() {
cin >> n >> r;
for (int i = 1; i <= n; ++i) {
cin >> a[i].x >> a[i].y;
}
for (int i = 1; i < n; ++i) {
ans += jjl(i, i + 1) * (qa(r, jjl(i, i + 1), r) + qa(r, jjl(i + 1, i + 2), r) -
qa(jjl(i, i + 2), jjl(i, i + 1), jjl(i + 1, i + 2)));
}
printf("%.15lf", ans);
return 0;
}
用户输出
10589.082471941052063
Special Judge 信息
Error(5264.98786594816556316800) too large
系统信息
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>
用户输出
10923.455846562219449
Special Judge 信息
Error(18412.39209813726301945280) too large
系统信息
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>
用户输出
10133.162102106643943
Special Judge 信息
Error(22666.65199973447488446254) too large
系统信息
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>
用户输出
2291.468391549346052
Special Judge 信息
Error(27469.78665376849494350608) too large
系统信息
Exited with return code 0