QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#584228 | #8270. Mineral deposits | hansiyuan | 0 | 1283ms | 3896kb | C++14 | 1.9kb | 2024-09-23 10:34:10 | 2024-09-23 10:34:10 |
Judging History
answer
#include <bits/stdc++.h>
#define pii pair<int,int>
#define X first
#define Y second
using namespace std;
const int bor = 1e8;
int b,k,w,d;
int D[100];
set<pii> ta;
vector<pii> a;
set<int> s,key;
vector<pii> ques;
multiset<int> res;
int dis[405];
int Dis(pii u,pii v){
return abs(u.X-v.X)+abs(u.Y-v.Y);
}
bool chk(int i,int dx,int dy){
pii u = a[i];
pii p = {u.X+dx,u.Y+dy};
int dt = Dis(u,p);
if(p.X < -bor || p.X > bor || p.Y < -bor || p.Y > bor) return false;
for(int j=i+1;j<a.size();j++){
pii v = a[j];
if(key.count(Dis(v,p)) || Dis(v,p)==dt) return false;
}
//printf("%d %d\n",p.X,p.Y);
key.insert(dt);
for(int i=0;i<a.size();i++)
s.insert(Dis(a[i],p));
ques.push_back(p);
return true;
}
int main(){
scanf("%d%d%d",&b,&k,&w);
printf("? %d %d %d %d\n",-b,-b,-b,b);
fflush(stdout);
for(int i=1;i<=k*2;i++)
scanf("%d",&D[i]);
for(int i=1;i<=k*2;i++)
for(int j=1;j<=k*2;j++){
ta.insert({(D[i]+D[j])/2-b*2,(D[i]-D[j])/2});
}
while(ta.size()){
pii p = *ta.begin();
ta.erase(p);
a.push_back(p);
//printf("%d %d\n",p.X,p.Y);
}
for(int i=0;i<a.size();i++){
pii p = a[i];
while(!chk(i,-d,0) && !chk(i,d,0) && !chk(i,0,-d) && !chk(i,0,d)) d++;
dis[i] = d;
while(s.count(d)) d++;
}
printf("? ");
for(pii p:ques) printf("%d %d ",p.X,p.Y);
puts(""); fflush(stdout);
for(int i=1;i<=ques.size()*k;i++){
int x; scanf("%d",&x);
res.insert(x);
}
printf("! ");
for(int i=0;i<a.size();i++){
pii u = a[i];
if(res.find(dis[i])!=res.end()){
printf("%d %d ",u.X,u.Y);
for(pii q:ques){
res.erase(Dis(u,q));
}
}
}
fflush(stdout);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Time Limit Exceeded
Test #1:
score: 9
Accepted
time: 0ms
memory: 3760kb
input:
10 1 10000 20 30 2 7 10 11
output:
? -10 -10 -10 10 ? 0 0 4 -5 3 5 7 0 ! 5 5
result:
ok correct answer
Test #2:
score: 9
Accepted
time: 1ms
memory: 3840kb
input:
10 1 10000 28 30 2 3 4 5
output:
? -10 -10 -10 10 ? 8 0 8 -1 5 1 5 0 ! 9 1
result:
ok correct answer
Test #3:
score: 9
Accepted
time: 1ms
memory: 3892kb
input:
10 1 10000 13 29 2 13 16 17
output:
? -10 -10 -10 10 ? -7 0 0 -8 -1 8 6 0 ! 1 8
result:
ok correct answer
Test #4:
score: 9
Accepted
time: 0ms
memory: 3756kb
input:
10 1 10000 20 20 0
output:
? -10 -10 -10 10 ? 0 0 ! 0 0
result:
ok correct answer
Test #5:
score: 9
Accepted
time: 0ms
memory: 3884kb
input:
10 1 10000 30 30 0
output:
? -10 -10 -10 10 ? 10 0 ! 10 0
result:
ok correct answer
Test #6:
score: 9
Accepted
time: 1ms
memory: 3760kb
input:
10 1 10000 10 30 2 17 20 21
output:
? -10 -10 -10 10 ? -10 0 -1 -10 -2 10 7 0 ! 0 10
result:
ok correct answer
Test #7:
score: 9
Accepted
time: 0ms
memory: 3880kb
input:
10 1 10000 20 40 2 17 20 21
output:
? -10 -10 -10 10 ? 0 0 9 -10 8 10 17 0 ! 10 10
result:
ok correct answer
Test #8:
score: 9
Accepted
time: 415ms
memory: 3836kb
input:
100000000 1 10000 165772754 332220904 1 134227246 166448150 166448152
output:
? -100000000 -100000000 -100000000 100000000 ? -34227246 0 48996828 -83224075 48996827 83224075 100000000 0 ! 48996829 -83224075
result:
ok correct answer
Test #9:
score: 9
Accepted
time: 1ms
memory: 3892kb
input:
100000000 1 10000 120187009 222454927 2 102267915 102267918 102267919
output:
? -100000000 -100000000 -100000000 100000000 ? -79812991 0 -28679033 -51133959 -28679034 51133959 22454924 0 ! -28679032 51133959
result:
ok correct answer
Test #10:
score: 9
Accepted
time: 1283ms
memory: 3876kb
input:
100000000 1 10000 200000000 400000000 2 100000000 200000000 200000001
output:
? -100000000 -100000000 -100000000 100000000 ? 0 0 99999999 -100000000 99999998 100000000 100000000 0 ! 100000000 100000000
result:
ok correct answer
Test #11:
score: 9
Accepted
time: 1277ms
memory: 3896kb
input:
100000000 1 10000 200000000 400000000 1 100000000 200000000 200000002
output:
? -100000000 -100000000 -100000000 100000000 ? 0 0 99999999 -100000000 99999998 100000000 100000000 0 ! 100000000 -100000000
result:
ok correct answer
Test #12:
score: 0
Time Limit Exceeded
input:
100000000 1 10000 0 200000000
output:
? -100000000 -100000000 -100000000 100000000
result:
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Skipped
Dependency #3:
0%
Subtask #5:
score: 0
Runtime Error
Test #116:
score: 0
Runtime Error
input:
100 20 3 64 75 90 91 93 99 113 132 136 152 158 162 166 174 177 179 188 189 190 197 197 200 202 205 214 225 226 227 229 229 242 254 261 268 270 277 283 314 327 335
output:
? -100 -100 -100 100
result:
Subtask #6:
score: 0
Skipped
Dependency #5:
0%
Subtask #7:
score: 0
Skipped
Dependency #1:
0%