QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#298072 | #77. Dazzling Stars | grass8cow | WA | 20ms | 6460kb | C++17 | 600b | 2024-01-05 17:04:17 | 2024-01-05 17:04:18 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int n,x[1010],y[1010],p[1010];
struct no{
int x,y,hf;
no(){}
no(int x_,int y_){x=x_,y=y_,hf=(x>0)||(x==0&&y>0);}
inline int cro(no a){return x*a.y-y*a.x;}
}a[1001000];
int m;
int main(){
scanf("%d",&n);
for(int i=1;i<=n;i++)scanf("%d%d%d",&x[i],&y[i],&p[i]);
for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)if(p[i]>p[j])
a[++m]=no(x[j]-x[i],y[j]-y[i]);
sort(a+1,a+m+1,[&](no a,no b){if(a.hf!=b.hf)return a.hf<b.hf;return a.cro(b)>0;});
for(int i=1;i<=m;i++)if(a[i].cro(a[i%m+1])<=0){
puts("Y");return 0;
}
return puts("N"),0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3580kb
input:
4 2 2 1 2 5 2 5 5 3 5 2 4
output:
Y
result:
ok single line: 'Y'
Test #2:
score: -100
Wrong Answer
time: 20ms
memory: 6460kb
input:
1000 948 1040 5 8222 9897 5 227 -2641 5 7927 -779 5 8288 865 5 1626 -3327 5 3849 -6795 5 3468 7081 5 8003 -6418 5 4603 3061 5 7459 690 5 3780 -6692 5 1982 4037 5 9069 2764 5 248 -5372 5 7575 -3451 5 7273 2061 5 8378 2182 5 6238 406 5 1847 226 5 1704 1876 5 9124 7138 5 977 7813 5 1036 -5564 5 6767 -2...
output:
Y
result:
wrong answer 1st lines differ - expected: 'N', found: 'Y'