QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#180051 | #7242. Mr.~Credo | xaphoenix# | WA | 1ms | 7784kb | C++14 | 1.7kb | 2023-09-15 15:05:16 | 2023-09-15 15:05:17 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pf push_front
#define LC k<<1
#define RC k<<1|1
#define IO cin.sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repn(i, a, n) for (int i = a; i <= n; i++)
#define per(i, a, n) for (int i = (n) - 1; i >= a; i--)
#define pern(i, a, n) for (int i = n; i >= a; i--)
typedef long long LL;
typedef long double LD;
typedef unsigned long long ull;
typedef pair<int, int> PII;
typedef pair<int, LL> PIL;
typedef pair<LL, int> PLI;
typedef pair<double, double> PDD;
typedef pair<ull, ull> PUU;
typedef pair<LL, LL> PLL;
const int N = 2100000;
const int M = 1100000;
const int mod = 1e9+7;
const int inf = (int)1e9;
const LL INF = 1e18;
const double eps = 1e-9;
mt19937_64 Rand((unsigned long long)new char);
#define rand Rand
const int L = 1296000;
const LD pi = acos(-1.0);
int n, f[N];
int main() {
IO;
cin >> n;
repn(i, 1, n) {
int x, y, d, a;
cin >> x >> y >> d >> a;
d--;
if (a + d >= L) f[a]++, f[0]++, f[a + d - L + 1]--;
else f[a]++, f[a + d + 1]--;
}
int cur = 0, pos;
rep(i, 0, L) {
cur += f[i];
if (cur == 0) {
pos = i;
break;
}
}
LD ang = (LD)pos / (L / 2) * pi, dx = cos(ang), dy = sin(ang), r = 1.0;
int ax, ay;
while (1) {
if (dx * r < -inf + eps || dx * r > inf - eps || dy * r < -inf + eps || dy * r > inf + eps) break;
ax = (int)(dx * r + 0.1);
ay = (int)(dy * r + 0.1);
r *= 2;
}
cout << "YES\n";
cout << ax << " " << ay << "\n";
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 7732kb
input:
4 1 2 486000 0 -1 1 324000 648000 1 0 108000 0 1 0 108000 1188000
output:
YES -759250124 759250125
result:
ok Seems ok, min distance to light = 1.41421
Test #2:
score: 0
Accepted
time: 0ms
memory: 7716kb
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 536870912 0
result:
ok Seems ok, min distance to light = 3.88011e+08
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 7784kb
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
output:
YES -501872394 190668497
result:
wrong answer The circle is partially or fully lit by a 1-th spotlight