QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#629880#8027. Sky Gardenucup-team3161#AC ✓148ms3952kbC++14805b2024-10-11 15:20:522024-10-11 15:20:53

Judging History

This is the latest submission verdict.

  • [2024-10-11 15:20:53]
  • Judged
  • Verdict: AC
  • Time: 148ms
  • Memory: 3952kb
  • [2024-10-11 15:20:52]
  • Submitted

answer

#include <bits/stdc++.h>
#define For(i,a,b) for(int i=(a);i<=(b);++i)
using namespace std;
typedef double db;

int n,m;
db pi=acos(-1.0);
void work()
{
    cin>>n>>m;
    m*=2;
    db res=0;
    For(i,1,n){
        For(j,i,n){
            if(j!=i)res+=1.0l*(j-i)*m*m;
            db now=0;
            For(k,0,m-1){
                db d1=min(k,m-k)*pi*2/m;
                db d2=2;
                now+=min(d1,d2);
            }
            now*=i;
            now*=m;
            if(i==j) now/=2;
            res+=now;
        }
    }
    if(m!=2){
        db sum=0;
        For(i,1,n)sum+=i;
        sum*=m;
        res+=sum;
    }
    printf("%.12lf\n",res);
}
int main()
{
    //cout<<"pi "<<pi<<"\n";
	int T=1;
	while(T--){
        work();
	}
	return 0;
}

这程序好像有点Bug,我给组数据试试?

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3836kb

input:

1 2

output:

14.283185307180

result:

ok found '14.2831853', expected '14.2831853', error '0.0000000'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3836kb

input:

1 1

output:

2.000000000000

result:

ok found '2.0000000', expected '2.0000000', error '0.0000000'

Test #3:

score: 0
Accepted
time: 1ms
memory: 3932kb

input:

500 1

output:

166916500.000000000000

result:

ok found '166916500.0000000', expected '166916500.0000000', error '0.0000000'

Test #4:

score: 0
Accepted
time: 1ms
memory: 3916kb

input:

500 2

output:

763585309.561351180077

result:

ok found '763585309.5613512', expected '763585309.5613225', error '0.0000000'

Test #5:

score: 0
Accepted
time: 147ms
memory: 3780kb

input:

500 499

output:

49125277129815.914062500000

result:

ok found '49125277129815.9140625', expected '49125277129819.2734375', error '0.0000000'

Test #6:

score: 0
Accepted
time: 148ms
memory: 3876kb

input:

500 500

output:

49322369986272.820312500000

result:

ok found '49322369986272.8203125', expected '49322369986259.6953125', error '0.0000000'

Test #7:

score: 0
Accepted
time: 11ms
memory: 3884kb

input:

252 139

output:

488838606007.177307128906

result:

ok found '488838606007.1773071', expected '488838606007.1795654', error '0.0000000'

Test #8:

score: 0
Accepted
time: 4ms
memory: 3932kb

input:

96 359

output:

181277190205.037719726562

result:

ok found '181277190205.0377197', expected '181277190205.0371094', error '0.0000000'

Test #9:

score: 0
Accepted
time: 33ms
memory: 3824kb

input:

237 487

output:

4992630041184.049804687500

result:

ok found '4992630041184.0498047', expected '4992630041184.1953125', error '0.0000000'

Test #10:

score: 0
Accepted
time: 4ms
memory: 3888kb

input:

81 411

output:

142953582310.277893066406

result:

ok found '142953582310.2778931', expected '142953582310.2773743', error '0.0000000'

Test #11:

score: 0
Accepted
time: 0ms
memory: 3828kb

input:

221 39

output:

25968641931.529693603516

result:

ok found '25968641931.5296936', expected '25968641931.5297089', error '0.0000000'

Test #12:

score: 0
Accepted
time: 23ms
memory: 3836kb

input:

270 259

output:

2087014641700.026611328125

result:

ok found '2087014641700.0266113', expected '2087014641700.0227051', error '0.0000000'

Test #13:

score: 0
Accepted
time: 82ms
memory: 3832kb

input:

422 387

output:

17770193032349.691406250000

result:

ok found '17770193032349.6914062', expected '17770193032349.6250000', error '0.0000000'

Test #14:

score: 0
Accepted
time: 1ms
memory: 3932kb

input:

63 15

output:

89852047.508517578244

result:

ok found '89852047.5085176', expected '89852047.5085171', error '0.0000000'

Test #15:

score: 0
Accepted
time: 87ms
memory: 3884kb

input:

407 439

output:

20515296102935.304687500000

result:

ok found '20515296102935.3046875', expected '20515296102923.2070312', error '0.0000000'

Test #16:

score: 0
Accepted
time: 0ms
memory: 3880kb

input:

18 18

output:

3123573.695647559594

result:

ok found '3123573.6956476', expected '3123573.6956476', error '0.0000000'

Test #17:

score: 0
Accepted
time: 6ms
memory: 3932kb

input:

171 146

output:

168786179167.018310546875

result:

ok found '168786179167.0183105', expected '168786179167.0194092', error '0.0000000'

Test #18:

score: 0
Accepted
time: 8ms
memory: 3832kb

input:

311 70

output:

232875509505.268554687500

result:

ok found '232875509505.2685547', expected '232875509505.2748413', error '0.0000000'

Test #19:

score: 0
Accepted
time: 15ms
memory: 3932kb

input:

155 494

output:

1439825967582.991455078125

result:

ok found '1439825967582.9914551', expected '1439825967582.9992676', error '0.0000000'

Test #20:

score: 0
Accepted
time: 17ms
memory: 3932kb

input:

204 418

output:

2347066265474.460937500000

result:

ok found '2347066265474.4609375', expected '2347066265474.4873047', error '0.0000000'

Test #21:

score: 0
Accepted
time: 7ms
memory: 3936kb

input:

344 46

output:

136054690372.272033691406

result:

ok found '136054690372.2720337', expected '136054690372.2714844', error '0.0000000'

Test #22:

score: 0
Accepted
time: 8ms
memory: 3760kb

input:

188 174

output:

318429902145.045532226562

result:

ok found '318429902145.0455322', expected '318429902145.0420532', error '0.0000000'

Test #23:

score: 0
Accepted
time: 6ms
memory: 3952kb

input:

137 394

output:

632896487876.025512695312

result:

ok found '632896487876.0255127', expected '632896487876.0313721', error '0.0000000'

Test #24:

score: 0
Accepted
time: 6ms
memory: 3776kb

input:

481 22

output:

85020954588.198715209961

result:

ok found '85020954588.1987152', expected '85020954588.2031097', error '0.0000000'

Test #25:

score: 0
Accepted
time: 1ms
memory: 3832kb

input:

30 446

output:

8705279441.352083206177

result:

ok found '8705279441.3520832', expected '8705279441.3520851', error '0.0000000'

Test #26:

score: 0
Accepted
time: 23ms
memory: 3892kb

input:

204 440

output:

2600626525627.927246093750

result:

ok found '2600626525627.9272461', expected '2600626525627.9575195', error '0.0000000'

Test #27:

score: 0
Accepted
time: 0ms
memory: 3884kb

input:

2 3

output:

175.415926535898

result:

ok found '175.4159265', expected '175.4159265', error '0.0000000'

Extra Test:

score: 0
Extra Test Passed