QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#366904#6378. LaLa and Monster Hunting (Part 1)Liberty12619WA 0ms3968kbC++201.2kb2024-03-25 14:08:122024-03-25 14:08:13

Judging History

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

  • [2024-03-25 14:08:13]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3968kb
  • [2024-03-25 14:08:12]
  • 提交

answer

#include <bits/stdc++.h>
#define x first
#define y second
#define int long long
using namespace std;
using ld = long double;
typedef pair<int,int> PII;
typedef pair<int,PII>PIII;
typedef long long LL;

const int N = 2e5+10,M=105,mod = 998244353;
const ld pi = acos(-1);
ld normal(ld x)
{
    if(x>pi)    x-=2*pi;
    if(x<=-pi)   x+=2*pi;
    return x;
}
void solve()
{
    int n;
    cin>>n;
    bool ok = false;
    vector<ld>nums;
    for(int i=1;i<=n;i++)
    {
        int x,y,r;
        cin>>x>>y>>r;
        if(x*x+y*y<=r*r)    ok=true;
        else
        {
            ld dist = sqrtl(x*x+y*y);
            ld angles = atan2(y,x),delta=asin(r/dist);
            nums.push_back(normal(angles-delta));
            nums.push_back(normal(angles+delta));
        }
    }
    if(ok)
    {
        cout<<"Yes\n";
        return;
    }
    sort(nums.begin(),nums.end());
    for(int i=1;i<nums.size();i++)
        if(nums[i]-nums[i-1]>pi)
            ok=true;
    if(ok)  cout<<"No\n";
    else    cout<<"Yes\n";
}



signed main()
{
    int T=1;
    cin.tie(0)->sync_with_stdio(false);
    //cin>>T;
    //init();
    while(T--) 
    {
        solve();
    }
    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3968kb

input:

3
-3 0 1
0 0 3
3 0 1

output:

Yes

result:

ok answer is YES

Test #2:

score: 0
Accepted
time: 0ms
memory: 3916kb

input:

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

output:

Yes

result:

ok answer is YES

Test #3:

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

input:

1
3 3 1

output:

Yes

result:

wrong answer expected NO, found YES