QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#82085#2301. Jet SetlarryWA 2ms3260kbC++141.4kb2023-02-27 03:57:512023-02-27 03:57:52

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-02-27 03:57:52]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3260kb
  • [2023-02-27 03:57:51]
  • 提交

answer

#include <iostream>

using namespace std;
bool longtitude[720];

int main() {
    ios::sync_with_stdio(false);
    cout.tie(nullptr);
    cin.tie(nullptr);

    int n;
    cin >> n;
    int arr[n + 1];
    int latitude;
    for (int i = 0; i < n; i++) {
        cin >> latitude >> arr[i];
    }
    arr[n] = arr[0];
    bool flag = false;
    for (int i = 1; i <= n; i++) {
        int start = arr[i - 1], end = arr[i];
        int diff = abs(start - end);
        if (diff == 180) {
            flag = true;
            break;
        } else if (diff < 180) { // cross longtitude 0
            int newStart = (start + 180) * 2, newEnd = (end + 180) * 2;
            for (int j = newStart; j <= newEnd; j++) {
                longtitude[j] = true;
            }
        } else { // not cross longtitude 0
            int newStart = (start + 180) * 2, newEnd = (end + 180) * 2;
            for (int j = 0; j <= newStart; j++) {
                longtitude[j] = true;
            }
            for (int j = newEnd; j < 720; j++) {
                longtitude[j] = true;
            }
        }
    }
    int i;
    double res;
    for (i = 0; i < 720; i++) {
        if (!longtitude[i]) {
            res = i / 2 - 180;
            break;
        }
    }
    if (flag || i == 720) {
        cout << "yes" << endl;
    } else {
        printf("no %.1f", res);
    }
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 3260kb

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