比赛 2026.4.4 评测结果 WAAAA
题目名称 For the Champion 最终得分 80
用户昵称 郑霁桓 运行时间 0.015 s
代码语言 C++ 内存使用 3.68 MiB
提交时间 2026-04-04 10:27:28
显示代码纯文本
#include "robot.h"
#include <bits/stdc++.h>
using namespace std;
void init(int c, int t) {
    return;
}
pair<int, int> robot(int n, vector<int> x, vector<int> y) {
    long long s1,s2;
    int mx=1e9,my=1e9,mn=1e9,xy=-1e9,xx=-1e9,nx=1e9;
    for(int i=0;i<n;i++){
        if(x[i]+y[i]<mn) mn=x[i]+y[i],mx=x[i],my=y[i];
        if(x[i]+1e9-y[i]<nx) nx=x[i]+1e9-y[i],xx=x[i],xy=y[i];
    }
    move(2,1e9);
    move(2,1e9);
    move(3,1e9);
    s1=move(3,1e9);
    s1=mx+my+4e9-s1;
    move(1,1e9);
    move(1,1e9);
    move(1,1e9);
    s2=move(1,1e9);
    s2=s2+xy-xx-4e9;
    return {(s1-s2)/2,(s1+s2)/2};
}//g++ 未命名1.cpp grader.cpp -o robot.exe -std=c++14
//mx-x+2e9+my-y+2e9=s1
//x+y=mx+my+4e9-s1;
//mx-x+2e9+y+2e9-xy=s2
//y-x=s2-mx-4e9+xy