QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#355197#2301. Jet Setckiseki#WA 1ms3788kbC++201.7kb2024-03-16 14:25:412024-03-16 14:25:42

Judging History

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

  • [2024-03-16 14:25:42]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3788kb
  • [2024-03-16 14:25:41]
  • 提交

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() {
  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 << (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: 1ms
memory: 3788kb

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.