QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#366904 | #6378. LaLa and Monster Hunting (Part 1) | Liberty12619 | WA | 0ms | 3968kb | C++20 | 1.2kb | 2024-03-25 14:08:12 | 2024-03-25 14:08:13 |
Judging History
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