QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#320161#8209. Curly Palindromesucup-team133#Compile Error//C++232.3kb2024-02-03 14:15:232024-02-03 14:15:23

Judging History

This is the latest submission verdict.

  • [2024-02-03 14:15:23]
  • Judged
  • [2024-02-03 14:15:23]
  • Submitted

answer

#include <bits/stdc++.h>
#ifdef LOCAL
#include <debug.hpp>
#else
#define debug(...) void(0)
#endif

#include "geometry/ccw.hpp"

using namespace std;

typedef long long ll;
#define all(x) begin(x), end(x)
constexpr int INF = (1 << 30) - 1;
constexpr long long IINF = (1LL << 60) - 1;
constexpr int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

template <class T> istream& operator>>(istream& is, vector<T>& v) {
    for (auto& x : v) is >> x;
    return is;
}

template <class T> ostream& operator<<(ostream& os, const vector<T>& v) {
    auto sep = "";
    for (const auto& x : v) os << exchange(sep, " ") << x;
    return os;
}

template <class T, class U = T> bool chmin(T& x, U&& y) { return y < x and (x = forward<U>(y), true); }

template <class T, class U = T> bool chmax(T& x, U&& y) { return x < y and (x = forward<U>(y), true); }

template <class T> void mkuni(vector<T>& v) {
    sort(begin(v), end(v));
    v.erase(unique(begin(v), end(v)), end(v));
}

template <class T> int lwb(const vector<T>& v, const T& x) { return lower_bound(begin(v), end(v), x) - begin(v); }

using namespace geometry;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    vector<Point<ll>> ps;
    vector<char> labels(n);
    for (int i = 0; i < n; i++) {
        int x, y;
        cin >> x >> y >> labels[i];
        ps.emplace_back(x, y);
    }

    auto f = [&](int i, int j, int k) {
        int res = ccw(ps[i], ps[j], ps[k]);
        if (res == Position::COUNTER_CLOCKWISE) return 1;
        if (res == Position::CLOCKWISE) return -1;
        return 0;
    };
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (i == j) continue;
            if (labels[i] != labels[j]) continue;
            for (int k = 0; k < n; k++) {
                if (i == k or j == k) continue;
                if (f(i, j, k) and f(j, k, i) and f(k, i, j)) {
                    cout << "Infinity\n";
                    return 0;
                }
            }
        }
    }

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (i == j) continue;
            if (labels[i] == labels[j]) {
                cout << 2 << '\n';
                return 0;
            }
        }
    }

    cout << 1 << '\n';
    return 0;
}

详细

answer.code:8:10: fatal error: geometry/ccw.hpp: No such file or directory
    8 | #include "geometry/ccw.hpp"
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.