QOJ.ac
QOJ
The 2nd Universal Cup Finals is coming! Check out our event page, schedule, and competition rules!
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#121611 | #6412. Classical Geometry Problem | SolitaryDream# | WA | 1ms | 3680kb | C++20 | 1.3kb | 2023-07-08 15:34:46 | 2023-07-08 15:34:50 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int A=255;
int T;
int main()
{
scanf("%d",&T);
while(T--)
{
vector<double>c(3);
vector<int>x(3);
scanf("%lf%lf%lf",&c[0],&c[1],&c[2]);
x[2]=min_element(c.begin(),c.end())-c.begin();
vector<double>cc(3);
double R=c[x[2]];
for(int i=0;i<3;i++)
cc[i]=c[i]-1.*(255-c[i])*R/(255-R);
cc[x[2]]=0;
int mn=-1;
for(int i=0;i<3;i++)
if((mn==-1||cc[i]<cc[mn])&&i!=x[2])
mn=i;
x[1]=mn;
vector<double>ccc(3);
R=cc[x[1]];
for(int i=0;i<3;i++)
if(i!=x[2])
ccc[i]=cc[i]-1.*(255-cc[i])*R/(255-R);
x[0]=3^x[1]^x[2];
vector<double>p(3);
vector<double>v(3);
puts("3");
for(int i=0;i<3;i++)
{
auto tar=!i?ccc:(i==1?cc:c);
v[x[i]]=255;
double L=0;
for(int j=0;j<3;j++)
L+=(p[j]-v[j])*(p[j]-v[j]);
L=sqrtl(L);
double t=tar[x[i]]-p[x[i]]<1e-6?0:(tar[x[i]]-p[x[i]])*L/(v[x[i]]-p[x[i]]);
for(int j=0;j<3;j++)
printf("%.10lf ",v[j]);
printf("%.10lf\n",t);
p=tar;
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3680kb
input:
3 105 255 175 174 174 174 0 0 0
output:
3 0.0000000000 255.0000000000 0.0000000000 255.0000000000 0.0000000000 255.0000000000 255.0000000000 119.0000000000 255.0000000000 255.0000000000 255.0000000000 119.0000000000 3 0.0000000000 0.0000000000 255.0000000000 0.0000000000 0.0000000000 255.0000000000 255.0000000000 0.0000000000 255.00000000...
result:
wrong output format Expected integer, but "0.0000000000" found (test case 1)