编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#69786 #1138. ddd和鹦鹉 Accepted 100 409 ms 440 K C++ 11 / 603 B yyf_0404 2022-06-23 17:37:53
显示原始代码
#include <bits/stdc++.h>
using namespace std;
int x[3], y[3];
double dist(int i, int x1, int y1) { return sqrt((x1 - x[i]) * (x1 - x[i]) + (y1 - y[i]) * (y1 - y[i])); }
int main() {
    int ansx, ansy;
    double d = 1e9, t;
    for (int i = 0; i < 3; i++) scanf("%d%d", &x[i], &y[i]);
    for (int x1 = -1000; x1 <= 1000; x1++)
        for (int y1 = -1000; y1 <= 1000; y1++)
            if ((t = 3 * dist(0, x1, y1) + 2 * dist(1, x1, y1) + dist(2, x1, y1)) < d) {
                ansx = x1, ansy = y1;
                d = t;
            }
    printf("%d %d\n", ansx, ansy);
    return 0;
}
子任务 #1
Accepted
得分:100
测试点 #1
Accepted
得分:100
用时:37 ms
内存:324 KiB

输入文件(1.in

-211 -888 -552 114 -1000 759

答案文件(1.out

-211 -888

用户输出

-211 -888

系统信息

Exited with return code 0
测试点 #2
Accepted
得分:100
用时:36 ms
内存:256 KiB

输入文件(2.in

900 570 -119 902 -15 327

答案文件(2.out

900 570

用户输出

900 570

系统信息

Exited with return code 0
测试点 #3
Accepted
得分:100
用时:37 ms
内存:432 KiB

输入文件(3.in

143 999 -171 -662 696 691

答案文件(3.out

143 999

用户输出

143 999

系统信息

Exited with return code 0
测试点 #4
Accepted
得分:100
用时:38 ms
内存:440 KiB

输入文件(4.in

-498 -472 -789 470 701 656

答案文件(4.out

-498 -472

用户输出

-498 -472

系统信息

Exited with return code 0
测试点 #5
Accepted
得分:100
用时:59 ms
内存:344 KiB

输入文件(5.in

356 25 218 610 -269 875

答案文件(5.out

356 25

用户输出

356 25

系统信息

Exited with return code 0
测试点 #6
Accepted
得分:100
用时:37 ms
内存:232 KiB

输入文件(6.in

408 403 453 -659 -405 -338

答案文件(6.out

408 403

用户输出

408 403

系统信息

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

输入文件(7.in

418 -178 954 -328 -600 743

答案文件(7.out

418 -178

用户输出

418 -178

系统信息

Exited with return code 0
测试点 #8
Accepted
得分:100
用时:36 ms
内存:248 KiB

输入文件(8.in

-188 -598 684 -6 343 -341

答案文件(8.out

-188 -598

用户输出

-188 -598

系统信息

Exited with return code 0
测试点 #9
Accepted
得分:100
用时:57 ms
内存:324 KiB

输入文件(9.in

-295 -813 85 299 -431 323

答案文件(9.out

-295 -813

用户输出

-295 -813

系统信息

Exited with return code 0
测试点 #10
Accepted
得分:100
用时:36 ms
内存:324 KiB

输入文件(10.in

549 247 564 -263 -74 75

答案文件(10.out

549 247

用户输出

549 247

系统信息

Exited with return code 0