QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#434694#8782. Schoolgirlsucup-team112#Compile Error//C++201.9kb2024-06-08 17:02:012024-06-08 17:02:03

Judging History

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

  • [2024-06-14 13:48:47]
  • hack成功,自动添加数据
  • (/hack/679)
  • [2024-06-14 13:05:18]
  • hack成功,自动添加数据
  • (/hack/678)
  • [2024-06-14 12:22:35]
  • hack成功,自动添加数据
  • (/hack/676)
  • [2024-06-08 17:02:03]
  • 评测
  • [2024-06-08 17:02:01]
  • 提交

answer

// #pragma GCC target("avx2")
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")
// #define INTERACTIVE

#include "kyopro-cpp/template.hpp"

void solve() {
    LL(n, m, Q);
    using Point = complex<double>;

    vec(Point, P, n + m);
    fori(i, n) {
        double x = cos(2 * PI * i / n) * 100;
        double y = sin(2 * PI * i / n) * 100;
        P[i]     = Point(x, y);
    }

    fori(i, n, n + m) {
        INT(a, b, c);
        a--;
        b--;
        c--;
        P[i] = P[c] + P[a] - P[b];
    }

    const double eps = 1e-7;
    fori(Q) {
        LL(r);
        VEC(int, A, r);
        Point tot;
        for (auto a : A) {
            tot += P[a - 1];
        }
        tot /= r;

        vec(Point, P2, r);
        fori(i, r) {
            P2[i] = P[A[i] - 1] - tot;
        }
        sort(all(P2), [](Point a, Point b) {
            return atan2(a.imag(), a.real()) < atan2(b.imag(), b.real());
        });

        double d_min = 1e9;
        double d_max = 0;
        for (auto &p : P2) {
            d_min = min(d_min, abs(p));
            d_max = max(d_max, abs(p));
        }

        if (d_max < eps) {
            Yes();
            continue;
        }

        auto b         = P2.back();
        double arg_min = 1e9;
        double arg_max = 0;
        for (auto &p : P2) {
            double deg = atan2(p.imag(), p.real()) - atan2(b.imag(), b.real());
            if (deg < 0) deg += 2 * PI;

            arg_min = min(arg_min, deg);
            arg_max = max(arg_max, deg);

            b = p;
        }

        Yes(d_max - d_min < eps and arg_max - arg_min < eps);
    }
}

int main() {
#ifndef INTERACTIVE
    cin.tie(0)->sync_with_stdio(0);
#endif
    // cout << fixed << setprecision(12);
    int t;
    t = 1;
    // cin >> t;
    while (t--) solve();
    return 0;
}

详细

answer.code:6:10: fatal error: kyopro-cpp/template.hpp: No such file or directory
    6 | #include "kyopro-cpp/template.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.