QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#687703 | #692. Delete the Points | 0xyz | WA | 0ms | 3712kb | C++14 | 1.2kb | 2024-10-29 20:36:21 | 2024-10-29 20:36:21 |
Judging History
answer
#include<bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef pair<int,int> P;
int T,n;
set<P>s;
void ouc(P a,P b){
cout<<b.F<<' '<<b.S<<' '<<b.F+max(a.F-b.F,b.S-a.S)<<' '<<b.S-max(a.F-b.F,b.S-a.S)<<'\n';
s.erase(a);s.erase(b);
}
void oul(P a,P b){
cout<<a.F<<' '<<a.S<<' '<<a.F+a.S-b.S<<' '<<b.S<<'\n';
s.erase(a);s.erase(b);
}
int main(){
ios::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
cin>>T;
while(T--){
cin>>n;
for(int i=1,x,y;i<=n;i++)cin>>x>>y,s.insert({x,y});
cout<<"Yes\n";
while(s.size()){
set<P>::iterator p=s.end();
P a,b,c;
p--;a=*p;p--;b=*p;
if(a.F==b.F)oul(a,b);
else if(a.S>=b.S){
cout<<b.F<<' '<<b.S<<' '<<b.F+max(a.F-b.F,a.S-b.S)<<' '<<b.S+max(a.F-b.F,a.S-b.S)<<'\n';
s.erase(a);s.erase(b);
}else if(s.size()==2)ouc(a,b);
else{
p--;c=*p;
if(c.F!=b.F)ouc(a,b);
else if(c.S<a.S)ouc(a,b);
else if(c.S>a.S)oul(b,c);
else if(a.F-c.F>b.S-c.S)oul(b,c);
else if(a.F-c.F<b.S-c.S){
cout<<c.F<<' '<<c.S<<' '<<a.F<<' '<<c.S+a.F-c.F<<'\n';
s.erase(a);s.erase(c);
}else{
cout<<b.F-1<<".5 "<<b.S<<' '<<b.F+b.S-c.S-1<<".5 "<<c.S<<'\n';
s.erase(b);s.erase(c);
}
}
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3712kb
input:
4 1 1 2 2 5 5 6 6
output:
Yes 1 2 1 2 Yes 5 5 6 6 Yes 5 0 5 0 Yes 5 0 5 0
result:
wrong answer We have 0 point(s) in query 0