#P3945. 三体问题【std 疑似有误】
三体问题【std 疑似有误】
Description
You are given celestial bodies with their positions in space, initial velocities , and masses . It is known that, under the influence of the "Singer" civilization, time in the three-body world does not flow continuously (it updates every seconds). All celestial bodies are treated as point masses. Compute the positions of all celestial bodies at time .
The universal gravitational constant is . In code, you may write:
#define G 6.67408e-11
If your answer’s relative error does not exceed compared to the standard answer, you will receive AC on that test point. In other words, you may choose how many decimal places to keep. The standard answer keeps decimal places. This problem uses SPJ to check correctness.
Input Format
The first line contains a positive integer and a nonnegative real number , representing the number of celestial bodies and the time, respectively.
The next lines each contain real numbers , representing each body’s position, mass, and initial velocity (the velocity components in the three directions).
Output Format
Output lines. The -th line contains the coordinates of the -th body at time , separated by single spaces.
3 100
0 10 0 10000000 0.006207480877613 0 0
8.660254037844 -5 0 10000000 -0.003103740438807 -0.00537583613352 0
-8.660254037844 -5 0 10000000 -0.003103740438807 0.00537583613352 0
0.620349511786 9.980741705470 0.000000000000
8.333401109655 -5.527609289167 0.000000000000
-8.953750621441 -4.453132416303 0.000000000000
3 100
0 10 0 10000000 0.06207480877613 0 0
8.760254037844 -5 0 10000000 -0.03103740438807 -0.0537583613352 0
-8.660254037844 -5 0 10000000 -0.03103740438807 0.0537583613352 0
6.204092324054 9.982347016794 0.000000000000
5.642963405596 -10.364100727695 0.000000000000
-11.747055729651 0.381753710901 0.000000000000
Hint
Constraints: , , . is within the range of long long.
Translated by ChatGPT 5
京公网安备 11011102002149号