用户输出
-211 -888
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#30670 | #1138. ddd和鹦鹉 | Accepted | 100 | 891 ms | 376 K | C++ 17 / 1.3 K | 2n8asm | 2020-07-03 12:37:41 |
#ifdef D
#include "hpp.hpp"
#else
#include <bits/stdc++.h>
#endif
using namespace std;
struct P {
int x;
int y;
P const &operator|(P &p) const {
cin >> p.x >> p.y;
return *this;
}
P &operator-=(P const &p) {
x -= p.x;
y -= p.y;
return *this;
}
P operator-(P const &p) const {
P q{ x, y };
return q -= p;
}
int operator*(P const &p) const { return x * p.y - y * p.x; }
long double abs() const { return hypotl(x, y); }
};
P a, b, c, o, oa, ob, oc, p;
long double d = 9e9, t;
int oaob, oboc, ocoa;
int main() {
o | a | b | c;
for (o.x = -1000; o.x <= 1000; ++o.x) {
for (o.y = -1000; o.y <= 1000; ++o.y) {
oa = o - a;
ob = o - b;
oc = o - c;
oaob = oa * ob;
oboc = ob * oc;
ocoa = oc * oa;
if (oaob * oboc < 0 || oboc * ocoa < 0 || ocoa * oaob < 0) {
continue;
}
if (d > (t = 3 * oa.abs() + 2 * ob.abs() + oc.abs())) {
d = t;
p = o;
}
}
}
cout << p.x << ' ' << p.y;
}
用户输出
-211 -888
系统信息
Exited with return code 0
用户输出
143 999
系统信息
Exited with return code 0
用户输出
-498 -472
系统信息
Exited with return code 0
用户输出
408 403
系统信息
Exited with return code 0
用户输出
418 -178
系统信息
Exited with return code 0
用户输出
-188 -598
系统信息
Exited with return code 0
用户输出
-295 -813
系统信息
Exited with return code 0