QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#88091 | #2301. Jet Set | Bitroll | WA | 2ms | 3524kb | C++17 | 1.4kb | 2023-03-15 09:56:19 | 2023-03-15 09:56:23 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
// debug util
#ifdef DEBUG
#define deb(x) cerr << #x << " = " << x << endl
#else
#define deb(x)
#endif
// useful
#define ll long long
#define umap unordered_map
bool multi = false;
void solve(){
int n;
cin >> n;
int firstVal;
bool vis[720] = {};
int from, to, bk;
// get input
for (int h = 0; h <= n; h++){
if (h != n)
cin >> to >> to;
else
to = firstVal;
to += 360;
to %= 360;
if (h == 0){
firstVal = to;
from = to;
continue;
}
int i = from, j = to;
if ((abs(j-i) != 180)){
// make sure i is less than j
if (((i) > (j))){
bk = i;
i = j;
j = bk;
}
// get shortest path
if (((j - i) > (360 - j + i))){
bk = i;
i = j;
j = bk;
}
}
deb(i);
deb(j);
int f = i;
while (true){
int s = f*2;
vis[s] = true;
//cout << (s) << " ";
if (f != j){
vis[s+1] = true;
//cout << s+1 << " ";
}
else{
deb(f);
break;
}
f++;
f %= 360;
}
//cout << endl;
from = to;
}
// check everything is visited
for (int i = 0; i < 720; i++){
//cout << vis[i] << " ";
if (!vis[i]){
cout << "no" << endl;
return;
}
}
cout << "yes" << endl;
}
int main(){
ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
int t=1;
if(multi)cin>>t;
while(t--)solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 3524kb
input:
6 0 -180 0 60 0 -60 0 -179 0 -60 0 60
output:
no
result:
wrong output format Unexpected end of file - token expected