用户输出
-552 114
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#25325 | #1138. ddd和鹦鹉 | Wrong Answer | 10 | 350 ms | 276 K | C / 2.1 K | 呵呵 | 2020-04-25 20:39:09 |
#include <stdio.h>
#include <math.h>
float fun(int a, int b, int c, int d, int e, int f, int k, int z);
int check(int a, int b, int c, int d, int e, int f, int k, int z);
int max(int a, int c, int e);
int min(int b, int d, int f);
int area(float m, float n, float t);
int main() {
int a, b, c, d, e, f;
scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f);
int m, n, l, j, ai, koo, kooo, last1, last2;
koo = 0;
m = min(a, c, e);
n = max(a, c, e);
l = min(b, d, f);
j = max(b, d, f);
kooo = fun(a, b, c, d, e, f, m, l);
int i = 0;
int u = 0;
for (i = m; i < n + 1; i++) {
for (u = l; u < j + 1; u++) {
ai = check(a, b, c, d, e, f, i, u);
if (ai == 0)
continue;
else {
koo = fun(a, b, c, d, e, f, i, u);
if (kooo > koo) {
kooo = koo;
last1 = i;
last2 = u;
continue;
} else
continue;
}
}
}
printf("%d %d", last1, last2);
return 0;
}
float fun(int a, int b, int c, int d, int e, int f, int k, int z) {
float s;
s = sqrt(3 * ((k - a) * (k - a)) + 3 * ((z - b) * (z - b))) +
sqrt(2 * ((k - c) * (k - c)) + 2 * ((z - d) * (z - d))) + sqrt((k - e) * (k - e) + (z - f) * (z - f));
return s;
}
int area(float m, float n, float t) {
float p, ss;
p = (m + n + t) / 2;
ss = sqrt(p * (p - m) * (p - n) * (p - t));
return ss;
}
int check(int a, int b, int c, int d, int e, int f, int k, int z) {
float s0, s1, s2, s3;
float oa, ob, oc, ab, ac, bc;
oa = sqrt((k - a) * (k - a) + (z - b) * (z - b));
ob = sqrt((k - c) * (k - c) + (z - d) * (z - d));
oc = sqrt((k - e) * (k - e) + (z - f) * (z - f));
ab = sqrt((a - c) * (a - c) + (b - d) * (b - d));
bc = sqrt((c - e) * (c - e) + (d - f) * (d - f));
ac = sqrt((a - e) * (a - e) + (b - f) * (b - f));
s0 = area(ab, bc, ac);
s1 = area(oa, ob, ab);
s2 = area(oa, oc, ac);
s3 = area(ob, oc, bc);
if (s1 + s2 + s3 - s0 == 0)
return 1;
else
return 0;
}
int max(int a, int c, int e) {
if (a >= c && a >= e)
return a;
if (c >= a && c >= e)
return c;
else
return e;
}
int min(int b, int d, int f) {
if (b <= d && b <= f)
return b;
if (d <= b && d <= f)
return d;
else
return f;
}
用户输出
-552 114
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
203 614
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
207 817
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
-480 -60
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
217 609
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
252 -115
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
418 -178
系统信息
Exited with return code 0
用户输出
343 -341
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
-168 47
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0