QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#355210#2301. Jet Setckiseki#WA 0ms3796kbC++201.7kb2024-03-16 14:30:282024-03-16 14:30:28

Judging History

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

  • [2024-03-16 14:30:28]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3796kb
  • [2024-03-16 14:30:28]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

#define all(x) begin(x), end(x)
#ifdef CKISEKI
#define safe cerr << __PRETTY_FUNCTION__ << " line " << __LINE__ << " safe\n"
#define debug(a...) debug_(#a, a)
#define orange(a...) orange_(#a, a)
void debug_(auto s, auto ...a) {
  cerr << "\e[1;32m(" << s << ") = (";
  int f = 0;
  (..., (cerr << (f++ ? ", " : "") << a));
  cerr << ")\e[0m\n";
}
#include <experimental/iterator>
void orange_(auto s, auto L, auto R) {
  cerr << "\e[1;33m[ " << s << " ] = [ ";
  using namespace experimental;
  copy(L, R, make_ostream_joiner(cerr, ", "));
  cerr << " ]\e[0m\n";
}
#else
#define safe ((void)0)
#define debug(...) safe
#define orange(...) safe
#endif

int main() {
  cout.precision(1);
  cout << fixed;
  int n;
  cin >> n;
  vector<int> b(n);
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a >> b[i];
    if (b[i] < 0) b[i] += 360;
  }

  b.push_back(b[0]);

  vector<int> vis(720);
  bool pole = false;
  for (int i = 1; i <= n; i++) {
    int x = (b[i] * 2 - b[i - 1] * 2 + 720) % 720;
    int y = (b[i - 1] * 2 - b[i] * 2 + 720) % 720;
    if (x == y) {
      pole = true;
      continue;
    }

    int l, r;
    if (x < y) {
      l = b[i - 1] * 2;
      r = b[i] * 2;
    } else {
      l = b[i] * 2;
      r = b[i - 1] * 2;
    }
    debug(l, r, x, y);

    debug(l, r);
    for (int t = l;; t = (t + 1) % 720) {
      vis[t] = true;
      if (t == r) break;
    }
  }

  if (pole) {
    cout << "yes\n";
    return 0;
  }

  for (int i = 0; i < 720; i++) {
    if (!vis[i]) {
      cout << "no ";
      if (i >= 360) {
        cout << fixed << setprecision(1) << (i - 360) / 2.0 << '\n';
      } else {
        cout << i / 2.0 << '\n';
      }
      return 0;
    }
  }

  cout << "yes\n";

  return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3796kb

input:

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

output:

no 0.5

result:

wrong answer Wrong answer: the route passes through the given meridian.