QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#309590 | #8027. Sky Garden | algotester# | AC ✓ | 0ms | 3944kb | C++23 | 996b | 2024-01-20 18:48:15 | 2024-01-20 18:48:15 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long Int;
typedef pair<int,int> PII;
typedef vector<int> VInt;
#define FOR(i, a, b) for(i = (a); i < (b); ++i)
#define RFOR(i, a, b) for(i = (a) - 1; i >= (b); --i)
#define EACH(it, a) for(auto it = (a).begin(); it != (a).end(); ++it)
#define CLEAR(a, b) memset(a, b, sizeof(a))
#define SIZE(a) int((a).size())
#define ALL(a) (a).begin(),(a).end()
#define MP make_pair
void SolveTest(int test)
{
int n, m;
cin >> n >> m;
int i, j;
double pi = 2*acos(0.0);
double sum = 0;
FOR(i, 0, 2*m)
sum += min(2.0, min(i, 2*m - i)*pi/m);
double res = 0;
FOR(i, 1, n + 1)
{
double r = sum*i;
if(m > 1) res += i;
res += r/2;
FOR(j, i + 1, n + 1)
res += r + 2*m*(j - i);
}
cout << fixed << setprecision(11) << res*2*m << endl;
}
int main()
{
int T, t;
T = 1;
//cin >> T;
FOR(t, 0, T)
{
//cerr << "Solving " << t << "/" << T << endl;
SolveTest(t);
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3900kb
input:
1 2
output:
14.28318530718
result:
ok found '14.2831853', expected '14.2831853', error '0.0000000'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
1 1
output:
2.00000000000
result:
ok found '2.0000000', expected '2.0000000', error '0.0000000'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
500 1
output:
166916500.00000000000
result:
ok found '166916500.0000000', expected '166916500.0000000', error '0.0000000'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
500 2
output:
763585309.56132268906
result:
ok found '763585309.5613227', expected '763585309.5613225', error '0.0000000'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3884kb
input:
500 499
output:
49125277129819.29687500000
result:
ok found '49125277129819.2968750', expected '49125277129819.2734375', error '0.0000000'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
500 500
output:
49322369986259.86718750000
result:
ok found '49322369986259.8671875', expected '49322369986259.6953125', error '0.0000000'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3768kb
input:
252 139
output:
488838606007.17932128906
result:
ok found '488838606007.1793213', expected '488838606007.1795654', error '0.0000000'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3900kb
input:
96 359
output:
181277190205.03704833984
result:
ok found '181277190205.0370483', expected '181277190205.0371094', error '0.0000000'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3896kb
input:
237 487
output:
4992630041184.19335937500
result:
ok found '4992630041184.1933594', expected '4992630041184.1953125', error '0.0000000'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
81 411
output:
142953582310.27752685547
result:
ok found '142953582310.2775269', expected '142953582310.2773743', error '0.0000000'
Test #11:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
221 39
output:
25968641931.52965927124
result:
ok found '25968641931.5296593', expected '25968641931.5297089', error '0.0000000'
Test #12:
score: 0
Accepted
time: 0ms
memory: 3828kb
input:
270 259
output:
2087014641700.02001953125
result:
ok found '2087014641700.0200195', expected '2087014641700.0227051', error '0.0000000'
Test #13:
score: 0
Accepted
time: 0ms
memory: 3900kb
input:
422 387
output:
17770193032349.60937500000
result:
ok found '17770193032349.6093750', expected '17770193032349.6250000', error '0.0000000'
Test #14:
score: 0
Accepted
time: 0ms
memory: 3940kb
input:
63 15
output:
89852047.50851702690
result:
ok found '89852047.5085170', expected '89852047.5085171', error '0.0000000'
Test #15:
score: 0
Accepted
time: 0ms
memory: 3892kb
input:
407 439
output:
20515296102923.18359375000
result:
ok found '20515296102923.1835938', expected '20515296102923.2070312', error '0.0000000'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3700kb
input:
18 18
output:
3123573.69564755540
result:
ok found '3123573.6956476', expected '3123573.6956476', error '0.0000000'
Test #17:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
171 146
output:
168786179167.01913452148
result:
ok found '168786179167.0191345', expected '168786179167.0194092', error '0.0000000'
Test #18:
score: 0
Accepted
time: 0ms
memory: 3892kb
input:
311 70
output:
232875509505.27563476562
result:
ok found '232875509505.2756348', expected '232875509505.2748413', error '0.0000000'
Test #19:
score: 0
Accepted
time: 0ms
memory: 3944kb
input:
155 494
output:
1439825967582.99707031250
result:
ok found '1439825967582.9970703', expected '1439825967582.9992676', error '0.0000000'
Test #20:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
204 418
output:
2347066265474.49023437500
result:
ok found '2347066265474.4902344', expected '2347066265474.4873047', error '0.0000000'
Test #21:
score: 0
Accepted
time: 0ms
memory: 3900kb
input:
344 46
output:
136054690372.27139282227
result:
ok found '136054690372.2713928', expected '136054690372.2714844', error '0.0000000'
Test #22:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
188 174
output:
318429902145.04187011719
result:
ok found '318429902145.0418701', expected '318429902145.0420532', error '0.0000000'
Test #23:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
137 394
output:
632896487876.03149414062
result:
ok found '632896487876.0314941', expected '632896487876.0313721', error '0.0000000'
Test #24:
score: 0
Accepted
time: 0ms
memory: 3896kb
input:
481 22
output:
85020954588.20315551758
result:
ok found '85020954588.2031555', expected '85020954588.2031097', error '0.0000000'
Test #25:
score: 0
Accepted
time: 0ms
memory: 3888kb
input:
30 446
output:
8705279441.35208511353
result:
ok found '8705279441.3520851', expected '8705279441.3520851', error '0.0000000'
Test #26:
score: 0
Accepted
time: 0ms
memory: 3892kb
input:
204 440
output:
2600626525627.95410156250
result:
ok found '2600626525627.9541016', expected '2600626525627.9575195', error '0.0000000'
Test #27:
score: 0
Accepted
time: 0ms
memory: 3848kb
input:
2 3
output:
175.41592653590
result:
ok found '175.4159265', expected '175.4159265', error '0.0000000'
Extra Test:
score: 0
Extra Test Passed