编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#48453 #1138. ddd和鹦鹉 Wrong Answer 0 141 ms 356 K C++ 17 (Clang) / 921 B XYZ 2021-05-14 19:41:57
显示原始代码
#include <iostream>
#include <cmath>
using namespace std;

const int maxbound = 1000;
const int minbound = -1000;
float a_x, a_y, b_x, b_y, c_x, c_y;

float resD = 10000;
int resx = 0;
int resy = 0;

float dist(float ax, float ay, float bx, float by) {
    int dx = ax - bx;
    int dy = ay - by;
    return sqrt(dx * dx + dy * dy);
}

void update(int x, int y) {
    float newd = 3 * dist(a_x, a_y, x, y) + 2 * dist(b_x, b_y, x, y) + dist(c_x, c_y, x, y);
    if (newd < resD) {
        resD = newd;
        resx = x;
        resy = y;
    }
}

int main() {
    cin >> a_x >> a_y >> b_x >> b_y >> c_x >> c_y;
    int maxX = max(a_x, max(b_x, c_x));
    int minX = min(a_x, min(b_x, c_x));
    int maxY = max(a_y, max(b_y, c_y));
    int minY = min(a_y, min(b_y, c_y));
    for (int i = minX; i <= maxX; i++) {
        for (int j = minY; j <= maxY; j++) {
            update(i, j);
        }
    }
    cout << resx << resy;
    return 0;
}
子任务 #1
Wrong Answer
得分:0
测试点 #1
Wrong Answer
得分:0
用时:26 ms
内存:352 KiB

输入文件(1.in

-211 -888 -552 114 -1000 759

答案文件(1.out

-211 -888

用户输出

-211-888

Special Judge 信息

Files user_out and answer differ

系统信息

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

输入文件(2.in

900 570 -119 902 -15 327

答案文件(2.out

900 570

用户输出

900570

Special Judge 信息

Files user_out and answer differ

系统信息

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

输入文件(3.in

143 999 -171 -662 696 691

答案文件(3.out

143 999

用户输出

143999

Special Judge 信息

Files user_out and answer differ

系统信息

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

输入文件(4.in

-498 -472 -789 470 701 656

答案文件(4.out

-498 -472

用户输出

-498-472

Special Judge 信息

Files user_out and answer differ

系统信息

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

输入文件(5.in

356 25 218 610 -269 875

答案文件(5.out

356 25

用户输出

35625

Special Judge 信息

Files user_out and answer differ

系统信息

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

输入文件(6.in

408 403 453 -659 -405 -338

答案文件(6.out

408 403

用户输出

408403

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #7
Wrong Answer
得分:0
用时:20 ms
内存:352 KiB

输入文件(7.in

418 -178 954 -328 -600 743

答案文件(7.out

418 -178

用户输出

418-178

Special Judge 信息

Files user_out and answer differ

系统信息

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

输入文件(8.in

-188 -598 684 -6 343 -341

答案文件(8.out

-188 -598

用户输出

-188-598

Special Judge 信息

Files user_out and answer differ

系统信息

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

输入文件(9.in

-295 -813 85 299 -431 323

答案文件(9.out

-295 -813

用户输出

-295-813

Special Judge 信息

Files user_out and answer differ

系统信息

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

输入文件(10.in

549 247 564 -263 -74 75

答案文件(10.out

549 247

用户输出

549247

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0