QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#762329 | #8027. Sky Garden | TianShuiXingHe | AC ✓ | 1ms | 3936kb | C++17 | 2.1kb | 2024-11-19 14:38:38 | 2024-11-19 14:38:42 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
namespace basic{
#define int long long
#define uint unsigned int
#define per(i,a,b) for(int i=(a);i<=(b);i++)
#define perr(i,a,b,c) for(int i=(a);i<=(b);i+=(c))
#define rep(i,b,a) for(int i=(b);i>=(a);i--)
#define epb emplace_back
#define bit(x) (1ll<<(x))
#define all(x,l,r) &(x)[l],&(x)[r]+1
#define vall(x) (x).begin(),(x).end()
#define lowbit(x) ((x)&(-(x)))
#define pc(x) putchar(x)
#define turn(x) (x-'a'+1)
#define cto const auto
template <class T> bool chkmn(T &x,T y){return x>y?(x=y,1):0;}
template <class T> bool chkmn(T &x,T y,T z){return y<z?(x=y,1):(x=z,0);}
template <class T> bool chkmx(T &x,T y){return x<y?(x=y,1):0;}
template <class T> bool chkmx(T &x,T y,T z){return y>z?(x=y,1):(x=z,0);}
char *p1,*p2,buf[100000];
#define nc() (p1==p2 && (p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++)
int read(){
int x=0,f=1;char ch=nc();
while(ch<48||ch>57){if(ch=='-') f=-1;ch=nc();}
while(ch>=48&&ch<=57) x=x*10+ch-48,ch=nc();
return x*f;
}
void write(int x){
if(x<0) pc('-'),x=-x;
if(x>9) write(x/10);
pc(x%10+'0');
}
void print(string s,char op=0){for(auto x:s) pc(x);op&&pc(op);}
void print(int x,char op=0){write(x);op&&pc(op);}
}
using namespace basic;
namespace fisher{
bool mbe;void cntime();
const long double pi=acosl(-1);
int n,m,sum1,sum2,anspi,ansn;
long double ans;
void main(){
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
cin>>n>>m;
if(m==1){
per(i,1,n*2) ans+=i*(n*2-i+1);
per(i,1,n) ans-=2*i;
}
else{
per(i,1,n){
sum1+=i*(2*n-2*i+1);
sum2+=i*(2*i-1);
}
per(i,1,m-1){
if(pi*i>2*m)
ansn+=2*m*(sum1+sum2);
else{
ansn+=2*m*(sum2-sum1);
anspi+=2*i*sum1;
}
}
per(i,1,n*2) ansn+=m*i*(n*2-i+1);
ans=anspi*pi+ansn;
}
cout<<fixed<<setprecision(10)<<ans<<'\n';
return cntime();
}
bool mbd;void cntime(){
cerr<<"Memory: "<<abs(&mbd-&mbe)/1048476.0<<" MB\n";
cerr<<"Time: "<<1e3*clock()/CLOCKS_PER_SEC<<" ms\n";
}}
signed main(){
fisher::main();
return 0;
}
这程序好像有点Bug,我给组数据试试?
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3856kb
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: 3856kb
input:
1 1
output:
2.0000000000
result:
ok found '2.0000000', expected '2.0000000', error '0.0000000'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3792kb
input:
500 1
output:
166916500.0000000000
result:
ok found '166916500.0000000', expected '166916500.0000000', error '0.0000000'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3896kb
input:
500 2
output:
763585309.5613224831
result:
ok found '763585309.5613225', expected '763585309.5613225', error '0.0000000'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3692kb
input:
500 499
output:
49125277129819.3371200562
result:
ok found '49125277129819.3359375', expected '49125277129819.2734375', error '0.0000000'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3916kb
input:
500 500
output:
49322369986259.8376693726
result:
ok found '49322369986259.8359375', expected '49322369986259.6953125', error '0.0000000'
Test #7:
score: 0
Accepted
time: 1ms
memory: 3868kb
input:
252 139
output:
488838606007.1794675887
result:
ok found '488838606007.1794434', expected '488838606007.1795654', error '0.0000000'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
96 359
output:
181277190205.0371225178
result:
ok found '181277190205.0371094', expected '181277190205.0371094', error '0.0000000'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3936kb
input:
237 487
output:
4992630041184.1961097717
result:
ok found '4992630041184.1962891', expected '4992630041184.1953125', error '0.0000000'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
81 411
output:
142953582310.2773631811
result:
ok found '142953582310.2773743', expected '142953582310.2773743', error '0.0000000'
Test #11:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
221 39
output:
25968641931.5297139101
result:
ok found '25968641931.5297127', expected '25968641931.5297089', error '0.0000000'
Test #12:
score: 0
Accepted
time: 0ms
memory: 3848kb
input:
270 259
output:
2087014641700.0213329792
result:
ok found '2087014641700.0212402', expected '2087014641700.0227051', error '0.0000000'
Test #13:
score: 0
Accepted
time: 1ms
memory: 3932kb
input:
422 387
output:
17770193032349.6235847473
result:
ok found '17770193032349.6250000', expected '17770193032349.6250000', error '0.0000000'
Test #14:
score: 0
Accepted
time: 0ms
memory: 3904kb
input:
63 15
output:
89852047.5085170583
result:
ok found '89852047.5085171', expected '89852047.5085171', error '0.0000000'
Test #15:
score: 0
Accepted
time: 0ms
memory: 3812kb
input:
407 439
output:
20515296102923.2060089111
result:
ok found '20515296102923.2070312', expected '20515296102923.2070312', error '0.0000000'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
18 18
output:
3123573.6956475554
result:
ok found '3123573.6956476', expected '3123573.6956476', error '0.0000000'
Test #17:
score: 0
Accepted
time: 0ms
memory: 3924kb
input:
171 146
output:
168786179167.0193175673
result:
ok found '168786179167.0193176', expected '168786179167.0194092', error '0.0000000'
Test #18:
score: 0
Accepted
time: 1ms
memory: 3928kb
input:
311 70
output:
232875509505.2748312354
result:
ok found '232875509505.2748413', expected '232875509505.2748413', error '0.0000000'
Test #19:
score: 0
Accepted
time: 0ms
memory: 3932kb
input:
155 494
output:
1439825967582.9987277985
result:
ok found '1439825967582.9987793', expected '1439825967582.9992676', error '0.0000000'
Test #20:
score: 0
Accepted
time: 0ms
memory: 3924kb
input:
204 418
output:
2347066265474.4883174896
result:
ok found '2347066265474.4882812', expected '2347066265474.4873047', error '0.0000000'
Test #21:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
344 46
output:
136054690372.2715026736
result:
ok found '136054690372.2714996', expected '136054690372.2714844', error '0.0000000'
Test #22:
score: 0
Accepted
time: 0ms
memory: 3880kb
input:
188 174
output:
318429902145.0420268178
result:
ok found '318429902145.0420532', expected '318429902145.0420532', error '0.0000000'
Test #23:
score: 0
Accepted
time: 0ms
memory: 3932kb
input:
137 394
output:
632896487876.0314480066
result:
ok found '632896487876.0314941', expected '632896487876.0313721', error '0.0000000'
Test #24:
score: 0
Accepted
time: 0ms
memory: 3928kb
input:
481 22
output:
85020954588.2031030655
result:
ok found '85020954588.2031097', expected '85020954588.2031097', error '0.0000000'
Test #25:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
30 446
output:
8705279441.3520848416
result:
ok found '8705279441.3520851', expected '8705279441.3520851', error '0.0000000'
Test #26:
score: 0
Accepted
time: 1ms
memory: 3924kb
input:
204 440
output:
2600626525627.9567010403
result:
ok found '2600626525627.9565430', expected '2600626525627.9575195', error '0.0000000'
Test #27:
score: 0
Accepted
time: 1ms
memory: 3848kb
input:
2 3
output:
175.4159265359
result:
ok found '175.4159265', expected '175.4159265', error '0.0000000'
Extra Test:
score: 0
Extra Test Passed