QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#859230#9668. Isoball: 2D Versionshiyahahaya#WA 1ms3840kbC++201.6kb2025-01-17 16:40:452025-01-17 16:40:45

Judging History

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

  • [2025-01-17 16:40:45]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3840kb
  • [2025-01-17 16:40:45]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main() 
{
    int t;
    cin >> t;
    while (t--) 
    {
       double x1,y1,x2,y2,r;//x2=v1,y2=v2
       cin>>x1>>y1>>r>>x2>>y2;
       double xx1,yy1,xx2,yy2,xx3,yy3,xx4,yy4;
       cin>>xx4>>yy4>>xx2>>yy2;
       yy1=yy2;
       xx1=xx4;
       yy3=yy4;
       xx3=xx2;
       xx1+=r;
       xx4+=r;
       xx2-=r;
       xx3-=r;
       yy1-=r;
       yy2-=r;
       yy3+=r;
       yy4+=r;
       if(xx1>xx2)
       {
               cout<<"No"<<endl;
               continue;
       }
       if(yy1<yy4)
       {
             cout<<"No"<<endl;
             continue;
       }
       
       
       double x,y;
       int t=0;
       t=(xx1-x1)/x2;
       if(t>0)
       {
             y=y2*t+y1;
             if(y<=yy1&&y>=yy4)
             {
                 
                 cout<<"Yes"<<endl;
                 continue;
             }
       }
       t=(xx2-x1)/x2;
       if(t>0)
       {
             y=y2*t+y1;
             if(y<=yy2&&y>=yy3)
             {
                 cout<<"Yes"<<endl;
                 continue;
             }
       }
       t=(yy1-y1)/y2;
       if(t>0)
       {
             x=x2*t+x1;
             if(x<=xx2&&x>=xx1)
             {
                 cout<<"Yes"<<endl;
                 continue;
             }
       }
       t=(yy3-y1)/y2;
       if(t>0)
       {
             x=x2*t+x1;
             if(x<=xx2&&x>=xx1)
             {
                 cout<<"Yes"<<endl;
                 continue;
             }
       }
       cout<<"No"<<endl;
    }
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3840kb

input:

5
0 0 1 1 0
2 -2 6 2
0 0 1 1 0
2 0 6 2
0 0 1 1 1
1 1 3 3
0 0 1 -1 -1
1 1 3 3
0 0 1 -1 1
-5 -5 5 5

output:

Yes
No
Yes
No
Yes

result:

ok 5 lines

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3840kb

input:

2
0 0 1000000 1000000 1000000
-1000000 -1000000 1000000 1000000
1000000 1000000 1 -1000000 -1000000
-1000000 -1000000 -999999 -999999

output:

No
No

result:

wrong answer 1st lines differ - expected: 'Yes', found: 'No'