QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#95717#2301. Jet Setchen_zexingWA 2ms3572kbC++171.0kb2023-04-11 16:14:192023-04-11 16:14:20

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-11 16:14:20]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3572kb
  • [2023-04-11 16:14:19]
  • 提交

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'.