1021 : The Area of a Sector
- 时间限制Time Limit
- 1 秒Sec
- 内存限制Memory Limit
- 128 兆MB
- 提交次数Submitted
- 1 次Times
- 通过次数Solved
- 1 次Times
| C / C++ | 1 s |
|---|---|
| Java / Python3 / Kotlin |
3 s
1s + 2s
|
全局时限上限:30 s(补偿后超出截断) Global time cap: 30 s (after allowances)
| C / C++ | 128 MB |
|---|---|
| Java / Kotlin |
640 MB
128 + 512 MB · 含 JVM
128 + 512 MB · JVM
|
| Python3 |
640 MB
128 + 512 MB
|
全局内存上限:2048 MB(补偿后超出截断) Global memory cap: 2048 MB (after allowances)
| 输入Input | 标准输入。Standard input. |
|---|---|
| 输出Output | 标准输出,格式以题面为准。Standard output; format as specified in the statement. |
| 时间与内存Time and memory | 记选手程序的 CPU 时间和内存峰值。判定程序不计入。题目上的限制只约束选手程序。The record is the solution’s CPU time and peak memory. The checker is not included. The limits apply only to the solution. |
题目描述Description
Given a circle and two points on it, calculate the area of the sector with its central angle no more than 180 degrees.
输入格式Input
There are multiple test cases.
Each line contains 6 float numbers denote the center of the circle xc, yc, the two points on the circle x1, y1 and x2, y2.
1 <= xc, yc, x1, y1, x2, y2 <= 10000.
输出格式Output
The area of the sector. The result should be accurated to three decimal places.
样例Sample
提示Hint
With math.h, you could define pi (3.1415926...) as const double pi = acos(-1.0);
Inverse trigonometric function could be obtained by acos, atan, asin, etc..
Be careful that angles like pi in C/C++ are in 3.1415926... type rather than 180.
You’d better use double instead of float. Load double with "%lf" but output it with "%f".
出题Author
CSGrandeur