QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#88127#2301. Jet SetBitrollWA 2ms3364kbC++111.0kb2023-03-15 11:26:472023-03-15 11:26:49

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-15 11:26:49]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3364kb
  • [2023-03-15 11:26:47]
  • 提交

answer

#include<bits/stdc++.h>
#include <iomanip>
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;

	bool vis[720+1000] = {};

	int from, to, bk;
	cin >> from >> from;

	for (int i = 0; i < n; i++){
		cin >> to >> to;

		// get fastest route
		if ((-to +from) > (360 -from -to)){
			bk = from;
			from = to;
			to = bk;
		}

		deb(from);
		deb(to);

		int j = from;
		while(true){

			vis[1000 + j*2] = true;
			if (j != to)
				vis[1000 + j*2 +1] = true;
			else
				break;

			j++;
			if (j >= 180) j -= 360;
		}

		from = to;
	}

	for (int i = 1000-180*2; i < 1000+180*2; i++){
		if (!vis[i]){
			cout << "no " << fixed << setprecision(1) << (double)(i-1000)/2 << 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: 3364kb

input:

6
0 -180
0 60
0 -60
0 -179
0 -60
0 60

output:

yes

result:

wrong answer Wrong answer: expected 'no', got 'yes'.