QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#95717 | #2301. Jet Set | chen_zexing | WA | 2ms | 3572kb | C++17 | 1.0kb | 2023-04-11 16:14:19 | 2023-04-11 16:14:20 |
Judging History
answer
#pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
int a[1005],b[1005];
map <int,int> mp;
int main(){
int T = 1, kase = 0;
//cin >> T;
while (T--) {
int n;
scanf("%d",&n);
for(int i=1;i<=n;i++) scanf("%d%d",&a[i],&b[i]);
b[n+1]=b[1];
for(int i=2;i<=n+1;i++){
int x=b[i-1],y=b[i];
int len=(y+360-x)%360;
if(len==180){
puts("yes");
exit(0);
}
if(len>180) swap(x,y);
//cout<<x<<" "<<y<<endl;
if(x<y){
for(int j=x;j<y;j++) mp[j]=1;
}
else{
for(int j=x;j<180;j++) mp[j]=1;
for(int j=-180;j<y;j++) mp[j]=1;
}
}
for(int i=-180;i<180;i++)
if(!mp[i]){
printf("no %.1lf\n",i+0.5);
exit(0);
}
puts("yes");
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3572kb
input:
6 0 -180 0 60 0 -60 0 -179 0 -60 0 60
output:
no -179.5
result:
ok correct
Test #2:
score: 0
Accepted
time: 2ms
memory: 3556kb
input:
6 0 -180 0 60 0 -60 0 -180 0 -60 0 60
output:
yes
result:
ok correct
Test #3:
score: 0
Accepted
time: 2ms
memory: 3540kb
input:
6 0 -180 0 60 0 -60 0 179 0 -60 0 60
output:
yes
result:
ok correct
Test #4:
score: -100
Wrong Answer
time: 2ms
memory: 3484kb
input:
2 0 0 1 0
output:
yes
result:
wrong answer Wrong answer: expected 'no', got 'yes'.