编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#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;
}
子任务 #1
Wrong Answer
得分:10
测试点 #1
Wrong Answer
得分:0
用时:44 ms
内存:224 KiB

输入文件(1.in

-211 -888 -552 114 -1000 759

答案文件(1.out

-211 -888

用户输出

-552 114

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #2
Wrong Answer
得分:0
用时:22 ms
内存:232 KiB

输入文件(2.in

900 570 -119 902 -15 327

答案文件(2.out

900 570

用户输出

203 614

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #3
Wrong Answer
得分:0
用时:60 ms
内存:260 KiB

输入文件(3.in

143 999 -171 -662 696 691

答案文件(3.out

143 999

用户输出

207 817

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #4
Wrong Answer
得分:0
用时:56 ms
内存:276 KiB

输入文件(4.in

-498 -472 -789 470 701 656

答案文件(4.out

-498 -472

用户输出

-480 -60

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #5
Wrong Answer
得分:0
用时:22 ms
内存:228 KiB

输入文件(5.in

356 25 218 610 -269 875

答案文件(5.out

356 25

用户输出

217 609

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #6
Wrong Answer
得分:0
用时:33 ms
内存:268 KiB

输入文件(6.in

408 403 453 -659 -405 -338

答案文件(6.out

408 403

用户输出

252 -115

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #7
Accepted
得分:100
用时:54 ms
内存:224 KiB

输入文件(7.in

418 -178 954 -328 -600 743

答案文件(7.out

418 -178

用户输出

418 -178

系统信息

Exited with return code 0
测试点 #8
Wrong Answer
得分:0
用时:21 ms
内存:224 KiB

输入文件(8.in

-188 -598 684 -6 343 -341

答案文件(8.out

-188 -598

用户输出

343 -341

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #9
Wrong Answer
得分:0
用时:22 ms
内存:228 KiB

输入文件(9.in

-295 -813 85 299 -431 323

答案文件(9.out

-295 -813

用户输出

-168 47

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #10
Wrong Answer
得分:0
用时:16 ms
内存:264 KiB

输入文件(10.in

549 247 564 -263 -74 75

答案文件(10.out

549 247

用户输出

491 139

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0