QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#180009 | #7242. Mr.~Credo | mendicillin2# | RE | 3ms | 8732kb | C++17 | 1.5kb | 2023-09-15 14:35:07 | 2023-09-15 14:35:08 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
template <class T> int sz(T&& a) { return int(size(forward<T>(a))); }
template <class T> using vc = vector<T>;
template <class T> using vvc = vc<vc<T>>;
using ll = int64_t;
using vi = vc<int>;
template <class F>
struct ycr {
F f;
template <class T>
explicit ycr(T&& f_) : f(forward<T>(f_)) {}
template <class... Args>
decltype(auto) operator()(Args&&... args) {
return f(ref(*this), forward<Args>(args)...);
}
};
template <class F>
decltype(auto) yc(F&& f) {
return ycr<decay_t<F>>(forward<F>(f));
}
int main() {
ios_base::sync_with_stdio(false), cin.tie(nullptr);
cout << fixed << setprecision(20);
int N; cin >> N;
const int A = 1296000;
auto norm = [&](int a) -> int {
return a % A;
};
vector<int> diffs(A+1);
vector<int> S(N), T(N);
vector<int> angles = {0, A};
int sum_covered = 0;
for (int i = 0; i < N; i++) {
{
int x, y; cin >> x >> y;
}
int s, t; cin >> s >> t;
sum_covered += s;
s += t;
swap(s, t);
if (t <= A) {
diffs[s] += 1;
diffs[t] -= 1;
} else {
diffs[s] += 1;
diffs[A] -= 1;
diffs[0] += 1;
diffs[t] -= 1;
}
}
assert(sum_covered < A);
int cur = 0;
for (int a = 0; a < A; a++) {
cur += diffs[a];
assert(cur >= 0);
if (cur == 0) {
int st = a;
int en = a+1;
//cerr << a << ' ' << a+1 << endl;
double real_ang = 2 * M_PI * (double(st + en) / 2) / A;
int x = int(1e9 * cos(real_ang));
int y = int(1e9 * sin(real_ang));
cout << "YES" << '\n';
cout << x << ' ' << y << '\n';
exit(0);
}
}
assert(false);
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 3ms
memory: 8732kb
input:
4 1 2 486000 0 -1 1 324000 648000 1 0 108000 0 1 0 108000 1188000
output:
YES -707108495 707105067
result:
ok Seems ok, min distance to light = 2426.08
Test #2:
score: 0
Accepted
time: 2ms
memory: 8632kb
input:
10 0 0 149605 640182 0 0 51924 760110 0 0 14531 370974 0 0 82864 1009818 0 0 13668 877773 0 0 27523 945102 0 0 216723 246382 0 0 268334 861058 0 0 142890 328031 0 0 223562 461949
output:
YES 999999999 2424
result:
ok Seems ok, min distance to light = 7.22728e+08
Test #3:
score: -100
Runtime Error
input:
10 32 -15 514796 11109 30 -12 181791 391320 -43 31 21111 151392 -43 -41 47933 1199789 48 37 57302 1953 6 -15 91381 1253012 -12 10 83332 988560 -35 3 144973 329169 -25 47 23208 576618 12 6 119845 830237