QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#121611#6412. Classical Geometry ProblemSolitaryDream#WA 1ms3680kbC++201.3kb2023-07-08 15:34:462023-07-08 15:34:50

Judging History

This is the latest submission verdict.

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-08 15:34:50]
  • Judged
  • Verdict: WA
  • Time: 1ms
  • Memory: 3680kb
  • [2023-07-08 15:34:46]
  • Submitted

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)