QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#662884 | #4423. AMPPZ in the times of disease | ucup-team3474 | WA | 3173ms | 12412kb | C++20 | 1022b | 2024-10-21 11:44:42 | 2024-10-21 11:44:42 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N=1919810;
typedef long long ll;
typedef pair<ll,ll> PII;
ll n,m,k;
ll a[N],b[N];
char s[N];
bool tf[N];
int res[N];
void __(){
cin>>n>>m;
for(int i=1;i<=n;i++){
res[i]=m;
}
for(int i=1;i<=n;i++) scanf("%d%d",&a[i],&b[i]);
vector<PII> v;
v.push_back({a[1],b[1]});
res[1]=1;
for(int i=2;i<=m;i++){
ll dist=0,t=0;
for(int j=1;j<=n;j++){
if(res[j]!=m) continue;
ll mn=1e18;
for(auto [x,y]:v){
ll res=(x-a[j])*(x-a[j])+(y-b[j])*(y-b[j]);
mn=min(mn,res);
}
if(mn>dist){
dist=mn;
t=j;
}
}
v.push_back({a[t],b[t]});
res[t]=i;
}
// cout<<n<<" "<<m<<endl;
for(int i=1;i<=n;i++) printf("%d ",res[i]);
printf("\n");
}
int main(){
int _;
cin>>_;
while(_--){
__();
}
}
详细
Test #1:
score: 0
Wrong Answer
time: 3173ms
memory: 12412kb
input:
100 100000 20 270505 510725 245104 76414 131477 992924 781607 895592 562469 622976 564354 637966 980036 112090 522903 687218 113871 977855 6615 123673 13847 347618 657794 165707 420561 183995 11367 136391 507836 694877 985069 105115 774110 486921 14319 338715 774937 118145 981468 99089 803866 491315...
output:
1 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2...
result:
wrong answer wrong solution (test case 1)