QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#157493#7102. Live Loveucup-team870#WA 0ms4152kbC++173.3kb2023-09-02 15:26:112023-09-02 15:26:12

Judging History

你现在查看的是最新测评结果

  • [2023-09-02 15:26:12]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:4152kb
  • [2023-09-02 15:26:11]
  • 提交

answer

#include <bits/stdc++.h>
#define rep(i,l,r) for(int i=l; i<=r; i++)
#define IOS {cin.tie(0);cout.tie(0);ios::sync_with_stdio(0);}
using namespace std;

typedef long long ll;
typedef pair<int,int> P;
#define db double
db p2(db x){return x*x;}
const db pi=acos(-1);
void slv(){
    db v,r,d; cin>>v>>r>>d;
    db ans=d/v;
    db L=r*4,R=d; db r2=r*2;
    while(L<R-1e-12){
        db x=(L+R)/2;
        db d1=sqrt(p2(x-r2)-p2(r2));
        db ang=acos(r2/(x-r2));
        cout<<x<<" "<<d1<<" "<<r2*(pi-ang)<<'\n';

        if( (d-x) >= r2*(pi-ang)+d1)ans=min(ans,(d-x)/v),L=x,cout<<"ok "<<x<<'\n';
        else R=x;
    }
    cout<<ans<<'\n';
}
int main() {
    IOS
    cout<<fixed<<setprecision(15);
    int T;cin>>T;
    while(T--)slv();
    return 0;
}
/*
1
2.00 3 30.0
21.000000000000000 13.747727084867520 11.893879037174308
16.500000000000000 8.616843969807043 13.074251434230638
14.250000000000000 5.662375826453062 14.310817613528531
13.125000000000000 3.842606537234849 15.431828007101176
12.562500000000000 2.658271289767092 16.347224155824101
12.281250000000000 1.858521337649907 17.047271016688356
12.140625000000000 1.306627487321846 17.563015203483737
12.070312500000000 0.921245812829698 17.935448805599734
12.035156250000000 0.650469800923965 18.201616641286623
12.017578125000000 0.459615589899337 18.390836181333018
12.008789062500000 0.324878435140945 18.524994425524717
12.004394531250000 0.229681707815201 18.619986305527465
12.002197265625000 0.162394628840448 18.687200929663781
12.001098632812500 0.114825087607442 18.734744848869301
12.000549316406250 0.081191739872441 18.768369136899302
12.000274658203125 0.057410572847068 18.792147100667190
12.000137329101562 0.040595173087846 18.808961367874172
12.000068664550781 0.028705040048666 18.820851100490483
12.000034332275391 0.020297499436941 18.829258499530262
12.000017166137695 0.014352489227309 18.835203459686653
12.000008583068848 0.010148738830069 18.839407192387284
12.000004291534424 0.007176240764022 18.842379684196636
12.000002145767212 0.005074368053983 18.844481554694596
12.000001072883606 0.003588119900806 18.845967802065690
12.000000536441803 0.002537183856160 18.847018737833125
12.000000268220901 0.001794059890005 18.847761861701972
12.000000134110451 0.001268591908476 18.848287329648926
12.000000067055225 0.000897029939062 18.848658891607279
12.000000033527613 0.000634295950037 18.848921625588428
12.000000016763806 0.000448514967551 18.849107406571104
12.000000008381903 0.000317147975019 18.849238773563705
12.000000004190952 0.000224257483775 18.849331664054972
12.000000002095476 0.000158573987509 18.849397347551246
12.000000001047738 0.000112128741888 18.849443792796869
12.000000000523869 0.000079286993755 18.849476634545006
12.000000000261934 0.000056064370944 18.849499857167814
12.000000000130967 0.000039643496877 18.849516278041882
12.000000000065484 0.000028032185472 18.849527889353286
12.000000000032742 0.000019821748439 18.849536099790321
12.000000000016371 0.000014016092736 18.849541905446021
12.000000000008185 0.000009910874219 18.849546010664540
12.000000000004093 0.000007008046368 18.849548913492391
12.000000000002046 0.000004955437110 18.849550966101649
12.000000000001023 0.000003504023184 18.849552417515575
12.000000000000512 0.000002477718555 18.849553443820202
15.000000000000000
*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 4152kb

input:

5
5 4
100 50
252 52
3 0
10 10

output:

58.000000000000000 49.355850717012267 13.851895837974457
37.000000000000000 27.874719729532707 14.802262271306388
ok 37.000000000000000
47.500000000000000 38.681390874682883 14.197910257264237
42.250000000000000 33.302589989368698 14.452406294287238
ok 42.250000000000000
44.875000000000000 35.996744...

result:

wrong answer 1st lines differ - expected: '4 2', found: '58.000000000000000 49.355850717012267 13.851895837974457'