用户输出
0 0
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#25440 | #1138. ddd和鹦鹉 | Wrong Answer | 0 | 32 ms | 360 K | C++ / 1.3 K | Eric | 2020-05-01 21:02:47 |
#include <iostream>
using namespace std;
bool isin(int Ax, int Ay, int Bx, int By, int Cx, int Cy, int Px, int Py) {
if ((Bx - Ax) * (Py - Ay) > (By - Ay) * (Px - Ax) && (Bx - Cx) * (Py - Cy) > (By - Cy) * (Px - Cx) &&
(Cx - Ax) * (Py - Ay) > (Cy - Ay) * (Px - Ax))
return true;
else
return false;
}
int dis(int x, int y, int x1, int y1) {
int dis = (x - x1) * (x - x1) + (y - y1) * (y - y1);
return dis;
}
int main() {
int ax, bx, cx, ay, by, cy;
cin >> ax >> ay >> bx >> by >> cx >> cy;
long int min = 10000000, ans[2] = {};
int minx = ax, miny = ay, maxx, maxy;
if (minx > bx)
minx = bx;
if (minx > cx)
minx = cx;
if (maxx < bx)
maxx = bx;
if (maxx < cx)
maxx = cx;
if (miny > by)
miny = by;
if (miny > cy)
miny = cy;
if (maxy < by)
maxy = by;
if (maxy < cy)
maxy = cy;
for (int i = minx; i <= maxx; ++i)
for (int j = miny; j <= maxy; ++j) {
if (!isin(ax, ay, bx, by, cx, cy, i, j)) {
continue;
}
int u = 3 * dis(ax, ay, i, j);
int v = 2 * dis(bx, by, i, j);
int w = dis(cx, cy, i, j);
if (u + v + w < min) {
min = u + v + w;
ans[0] = i;
ans[1] = j;
}
}
cout << ans[0] << " " << ans[1];
return 0;
}
用户输出
0 0
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
0 0
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
0 0
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
-629 -48
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
0 0
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
428 -68
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
0 0
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
183 -346
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
0 0
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0