QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#628131#7717. BitsetsAfterlife#WA 0ms3768kbC++201.7kb2024-10-10 18:47:072024-10-10 18:47:08

Judging History

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

  • [2024-10-10 18:47:08]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3768kb
  • [2024-10-10 18:47:07]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int X1,Y1,Y2;
int Rl,Gl,Bl;
int X2,Y3,Y4;
int Rr,Gr,Br;
double calc(int t){
    return (Y2-Y1)*(1-t)+(Y4-Y3)*t;
}
double work(){
    double l=0,r=1;
    if(Rl<=Rr){
        if(Rl>=150){

        }
        else if(Rr<=150){
            return 0;
        }
        else{
            l=max(l,1.0*(150-Rl)/(Rr-Rl));
        }
    }
    else{
        if(Rr>=150){

        }
        else if(Rl<=150){
            return 0;
        }
        else{
            r=min(r,1.0*(Rl-150)/(Rl-Rr));
        }
    }
    if(Gl<=Gr){
        if(Gl>=75){
            return 0;
        }
        else if(Gr<=75){
            
        }
        else{
            r=min(r,1.0*(75-Gl)/(Gr-Gl));
        }
    }
    else{
        if(Gr>=75){
            return 0;
        }
        else if(Gl<=75){
            
        }
        else{
            l=max(l,1.0*(Gl-75)/(Gl-Gr));
        }
    }
    if(Bl<=Br){
        if(Bl>=75){
            return 0;
        }
        else if(Br<=75){
            
        }
        else{
            r=min(r,1.0*(75-Bl)/(Br-Bl));
        }
    }
    else{
        if(Br>=75){
            return 0;
        }
        else if(Bl<=75){
            
        }
        else{
            l=max(l,1.0*(Bl-75)/(Bl-Br));
        }
    }
    if(l>r)return 0;
    return 0.5*(X2-X1)*(r-l)*(calc(l)+calc(r));
}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.setf(ios::fixed);
    cout.precision(10);
    cin>>X1>>Y1>>Y2>>Rl>>Gl>>Bl;
    cin>>X2>>Y3>>Y4>>Rr>>Gr>>Br;
    cout<<work()<<'\n';
    swap(Rl,Gl);
    swap(Gl,Bl);
    cout<<work()<<'\n';
    swap(Rl,Gl);
    swap(Gl,Bl);
    cout<<work()<<'\n';
    return 0;
}

詳細信息

Test #1:

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

input:

4 10
1010110101
0101111001
1101101101
1011010000
4
10 5 4

output:

0.0000000000
0.0000000000
0.0000000000

result:

wrong output format Expected integer, but "0.0000000000" found