QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#679336 | #8027. Sky Garden | LJY_ljy | AC ✓ | 147ms | 3952kb | C++11 | 1.2kb | 2024-10-26 17:24:09 | 2024-10-26 17:24:10 |
Judging History
answer
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <cstdlib>
using namespace std;
const double pi = atan(1) * 4;
double ans;
int main() {
long long n, m;
scanf("%lld %lld", &n, &m);
for (long long i = 1; i < m; i++) {
if (pi * i / (m * 1.00000) < 2) {
for (long long u = 1; u <= n; u++) {
for (long long v = 1; v <= n; v++) {
long long minn = min(u, v), maxx = max(u, v);
ans += maxx - minn + pi * i / (m * 1.00000) * minn;
}
}
} else {
for (long long u = 1; u <= n; u++) {
for (long long v = 1; v <= n; v++)
ans += u + v;
}
}
}
for (long long i = 1; i <= n; i++) {
for (long long j = i + 1; j <= n; j++)
ans += j - i;
}
ans *= (2 * m);
double cnt = 0;
for (long long i = 1; i <= n; i++) {
for (long long j = 1; j <= n; j++)
cnt += i + j;
}
ans += cnt * m; // 处理圆心角为 π时的情形。
if (m >= 2) { // m >= 2 时,多条直线在原点处相交产生一个交点。
for (long long i = 1; i <= 2 * m; i++) {
for (long long j = 1; j <= n; j++) {
ans += j;
}
}
}
printf("%.10lf\n", ans);
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3952kb
input:
1 2
output:
14.2831853072
result:
ok found '14.2831853', expected '14.2831853', error '0.0000000'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3952kb
input:
1 1
output:
2.0000000000
result:
ok found '2.0000000', expected '2.0000000', error '0.0000000'
Test #3:
score: 0
Accepted
time: 1ms
memory: 3868kb
input:
500 1
output:
166916500.0000000000
result:
ok found '166916500.0000000', expected '166916500.0000000', error '0.0000000'
Test #4:
score: 0
Accepted
time: 1ms
memory: 3796kb
input:
500 2
output:
763585309.5613231659
result:
ok found '763585309.5613232', expected '763585309.5613225', error '0.0000000'
Test #5:
score: 0
Accepted
time: 147ms
memory: 3856kb
input:
500 499
output:
49125277129687.6953125000
result:
ok found '49125277129687.6953125', expected '49125277129819.2734375', error '0.0000000'
Test #6:
score: 0
Accepted
time: 147ms
memory: 3900kb
input:
500 500
output:
49322369986244.0156250000
result:
ok found '49322369986244.0156250', expected '49322369986259.6953125', error '0.0000000'
Test #7:
score: 0
Accepted
time: 11ms
memory: 3852kb
input:
252 139
output:
488838606007.2880249023
result:
ok found '488838606007.2880249', expected '488838606007.1795654', error '0.0000000'
Test #8:
score: 0
Accepted
time: 5ms
memory: 3900kb
input:
96 359
output:
181277190205.0918579102
result:
ok found '181277190205.0918579', expected '181277190205.0371094', error '0.0000000'
Test #9:
score: 0
Accepted
time: 33ms
memory: 3872kb
input:
237 487
output:
4992630041189.0585937500
result:
ok found '4992630041189.0585938', expected '4992630041184.1953125', error '0.0000000'
Test #10:
score: 0
Accepted
time: 4ms
memory: 3868kb
input:
81 411
output:
142953582310.3024902344
result:
ok found '142953582310.3024902', expected '142953582310.2773743', error '0.0000000'
Test #11:
score: 0
Accepted
time: 3ms
memory: 3860kb
input:
221 39
output:
25968641931.5313453674
result:
ok found '25968641931.5313454', expected '25968641931.5297089', error '0.0000000'
Test #12:
score: 0
Accepted
time: 23ms
memory: 3848kb
input:
270 259
output:
2087014641698.4094238281
result:
ok found '2087014641698.4094238', expected '2087014641700.0227051', error '0.0000000'
Test #13:
score: 0
Accepted
time: 81ms
memory: 3844kb
input:
422 387
output:
17770193032370.3632812500
result:
ok found '17770193032370.3632812', expected '17770193032349.6250000', error '0.0000000'
Test #14:
score: 0
Accepted
time: 0ms
memory: 3952kb
input:
63 15
output:
89852047.5085163414
result:
ok found '89852047.5085163', expected '89852047.5085171', error '0.0000000'
Test #15:
score: 0
Accepted
time: 86ms
memory: 3860kb
input:
407 439
output:
20515296102936.8046875000
result:
ok found '20515296102936.8046875', expected '20515296102923.2070312', error '0.0000000'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3868kb
input:
18 18
output:
3123573.6956475577
result:
ok found '3123573.6956476', expected '3123573.6956476', error '0.0000000'
Test #17:
score: 0
Accepted
time: 6ms
memory: 3856kb
input:
171 146
output:
168786179167.0080261230
result:
ok found '168786179167.0080261', expected '168786179167.0194092', error '0.0000000'
Test #18:
score: 0
Accepted
time: 9ms
memory: 3800kb
input:
311 70
output:
232875509505.2557067871
result:
ok found '232875509505.2557068', expected '232875509505.2748413', error '0.0000000'
Test #19:
score: 0
Accepted
time: 15ms
memory: 3856kb
input:
155 494
output:
1439825967584.3798828125
result:
ok found '1439825967584.3798828', expected '1439825967582.9992676', error '0.0000000'
Test #20:
score: 0
Accepted
time: 21ms
memory: 3848kb
input:
204 418
output:
2347066265475.3222656250
result:
ok found '2347066265475.3222656', expected '2347066265474.4873047', error '0.0000000'
Test #21:
score: 0
Accepted
time: 0ms
memory: 3848kb
input:
344 46
output:
136054690372.2135314941
result:
ok found '136054690372.2135315', expected '136054690372.2714844', error '0.0000000'
Test #22:
score: 0
Accepted
time: 8ms
memory: 3888kb
input:
188 174
output:
318429902145.0037841797
result:
ok found '318429902145.0037842', expected '318429902145.0420532', error '0.0000000'
Test #23:
score: 0
Accepted
time: 9ms
memory: 3788kb
input:
137 394
output:
632896487876.0996093750
result:
ok found '632896487876.0996094', expected '632896487876.0313721', error '0.0000000'
Test #24:
score: 0
Accepted
time: 6ms
memory: 3856kb
input:
481 22
output:
85020954588.1791992188
result:
ok found '85020954588.1791992', expected '85020954588.2031097', error '0.0000000'
Test #25:
score: 0
Accepted
time: 1ms
memory: 3944kb
input:
30 446
output:
8705279441.3519744873
result:
ok found '8705279441.3519745', expected '8705279441.3520851', error '0.0000000'
Test #26:
score: 0
Accepted
time: 22ms
memory: 3936kb
input:
204 440
output:
2600626525627.4477539062
result:
ok found '2600626525627.4477539', expected '2600626525627.9575195', error '0.0000000'
Test #27:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
2 3
output:
175.4159265359
result:
ok found '175.4159265', expected '175.4159265', error '0.0000000'
Extra Test:
score: 0
Extra Test Passed