QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#54212 | #4569. Connect the Points | not_so_organic# | AC ✓ | 3ms | 3856kb | C++23 | 1.1kb | 2022-10-07 16:07:33 | 2022-10-07 16:07:36 |
Judging History
answer
#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
int a[4],b[4],c[4],d[4],e[4],f[4];long long mx=0x3f3f3f3f3f3f3f3fll;
int ans[5][4],gs;
int main(){
scanf("%lld %lld %lld %lld %lld %lld",&a[1],&b[1],&a[2],&b[2],&a[3],&b[3]);
for(int i=1;i<=3;i++)e[i]=a[i],f[i]=b[i];sort(e+1,e+4);sort(f+1,f+4);
int dqa=e[2],dqb=f[2];
if(dqa!=a[1]){
gs++;ans[gs][0]=dqa,ans[gs][1]=dqb;
dqa=ans[gs][2]=a[1],ans[gs][3]=dqb;
}
if(dqb!=b[1]){
gs++;ans[gs][0]=dqa,ans[gs][1]=dqb;
ans[gs][2]=dqa,dqb=ans[gs][3]=b[1];
}dqa=e[2],dqb=f[2];
if(dqa!=a[2]){
gs++;ans[gs][0]=dqa,ans[gs][1]=dqb;
dqa=ans[gs][2]=a[2],ans[gs][3]=dqb;
}
if(dqb!=b[2]){
gs++;ans[gs][0]=dqa,ans[gs][1]=dqb;
ans[gs][2]=dqa,dqb=ans[gs][3]=b[2];
}dqa=e[2],dqb=f[2];
if(dqa!=a[3]){
gs++;ans[gs][0]=dqa,ans[gs][1]=dqb;
dqa=ans[gs][2]=a[3],ans[gs][3]=dqb;
}
if(dqb!=b[3]){
gs++;ans[gs][0]=dqa,ans[gs][1]=dqb;
ans[gs][2]=dqa,dqb=ans[gs][3]=b[3];
}
printf("%d\n",gs);
for(int i=1;i<=gs;i++){
printf("%d %d %d %d\n",ans[i][0],ans[i][1],ans[i][2],ans[i][3]);
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 3ms
memory: 3804kb
input:
1 1 3 5 8 6
output:
4 3 5 1 5 1 5 1 1 3 5 8 5 8 5 8 6
result:
ok Total length is 12
Test #2:
score: 0
Accepted
time: 2ms
memory: 3736kb
input:
1 1 2 2 3 3
output:
4 2 2 1 2 1 2 1 1 2 2 3 2 3 2 3 3
result:
ok Total length is 4
Test #3:
score: 0
Accepted
time: 2ms
memory: 3784kb
input:
1 1 2 3 3 2
output:
4 2 2 1 2 1 2 1 1 2 2 2 3 2 2 3 2
result:
ok Total length is 4
Test #4:
score: 0
Accepted
time: 2ms
memory: 3768kb
input:
1 2 2 1 3 3
output:
4 2 2 1 2 2 2 2 1 2 2 3 2 3 2 3 3
result:
ok Total length is 4
Test #5:
score: 0
Accepted
time: 2ms
memory: 3696kb
input:
1 2 2 3 3 1
output:
4 2 2 1 2 2 2 2 3 2 2 3 2 3 2 3 1
result:
ok Total length is 4
Test #6:
score: 0
Accepted
time: 2ms
memory: 3856kb
input:
1 3 2 1 3 2
output:
4 2 2 1 2 1 2 1 3 2 2 2 1 2 2 3 2
result:
ok Total length is 4
Test #7:
score: 0
Accepted
time: 2ms
memory: 3732kb
input:
1 3 2 2 3 1
output:
4 2 2 1 2 1 2 1 3 2 2 3 2 3 2 3 1
result:
ok Total length is 4
Test #8:
score: 0
Accepted
time: 2ms
memory: 3764kb
input:
-811089219 -147580223 -131318959 -47863115 180743101 601547107
output:
4 -131318959 -47863115 -811089219 -47863115 -811089219 -47863115 -811089219 -147580223 -131318959 -47863115 180743101 -47863115 180743101 -47863115 180743101 601547107
result:
ok Total length is 1740959650
Test #9:
score: 0
Accepted
time: 2ms
memory: 3784kb
input:
-953648657 -254962225 -198962039 539064186 536177467 -81912224
output:
4 -198962039 -81912224 -953648657 -81912224 -953648657 -81912224 -953648657 -254962225 -198962039 -81912224 -198962039 539064186 -198962039 -81912224 536177467 -81912224
result:
ok Total length is 2283852535
Test #10:
score: 0
Accepted
time: 2ms
memory: 3804kb
input:
170075350 644693857 -70945648 -531201615 -813420873 75995752
output:
4 -70945648 75995752 170075350 75995752 170075350 75995752 170075350 644693857 -70945648 75995752 -70945648 -531201615 -70945648 75995752 -813420873 75995752
result:
ok Total length is 2159391695
Test #11:
score: 0
Accepted
time: 2ms
memory: 3780kb
input:
-598308052 155442794 -752953801 111986435 782202531 -333732768
output:
4 -598308052 111986435 -598308052 155442794 -598308052 111986435 -752953801 111986435 -598308052 111986435 782202531 111986435 782202531 111986435 782202531 -333732768
result:
ok Total length is 2024331894
Test #12:
score: 0
Accepted
time: 1ms
memory: 3812kb
input:
140537651 392873314 856272625 199854620 284394957 -862945504
output:
4 284394957 199854620 140537651 199854620 140537651 199854620 140537651 392873314 284394957 199854620 856272625 199854620 284394957 199854620 284394957 -862945504
result:
ok Total length is 1971553792
Test #13:
score: 0
Accepted
time: 2ms
memory: 3780kb
input:
-531600195 66788696 495972018 -828643104 -537934741 235845303
output:
4 -531600195 66788696 495972018 66788696 495972018 66788696 495972018 -828643104 -531600195 66788696 -537934741 66788696 -537934741 66788696 -537934741 235845303
result:
ok Total length is 2098395166
Test #14:
score: 0
Accepted
time: 2ms
memory: 3848kb
input:
-565864098 -762723255 903590907 -762723255 -486054726 -762723255
output:
2 -486054726 -762723255 -565864098 -762723255 -486054726 -762723255 903590907 -762723255
result:
ok Total length is 1469455005
Test #15:
score: 0
Accepted
time: 2ms
memory: 3856kb
input:
80565983 -977814210 80565983 384343197 80565983 102575609
output:
2 80565983 102575609 80565983 -977814210 80565983 102575609 80565983 384343197
result:
ok Total length is 1362157407
Test #16:
score: 0
Accepted
time: 2ms
memory: 3636kb
input:
435839201 -838682337 435839201 821052661 499609215 273341058
output:
3 435839201 273341058 435839201 -838682337 435839201 273341058 435839201 821052661 435839201 273341058 499609215 273341058
result:
ok Total length is 1723505012
Test #17:
score: 0
Accepted
time: 2ms
memory: 3772kb
input:
435839201 273341058 499609215 821052661 435839201 -838682337
output:
3 435839201 273341058 499609215 273341058 499609215 273341058 499609215 821052661 435839201 273341058 435839201 -838682337
result:
ok Total length is 1723505012
Test #18:
score: 0
Accepted
time: 2ms
memory: 3776kb
input:
-550183491 -223052429 756776472 349902936 239047012 -223052429
output:
3 239047012 -223052429 -550183491 -223052429 239047012 -223052429 756776472 -223052429 756776472 -223052429 756776472 349902936
result:
ok Total length is 1879915328
Test #19:
score: 0
Accepted
time: 2ms
memory: 3784kb
input:
1000000000 894586329 -444648850 -239939045 -733796075 -301669878
output:
4 -444648850 -239939045 1000000000 -239939045 1000000000 -239939045 1000000000 894586329 -444648850 -239939045 -733796075 -239939045 -733796075 -239939045 -733796075 -301669878
result:
ok Total length is 2930052282
Test #20:
score: 0
Accepted
time: 2ms
memory: 3636kb
input:
669699982 91018932 438054159 1000000000 -364758687 -418769264
output:
4 438054159 91018932 669699982 91018932 438054159 91018932 438054159 1000000000 438054159 91018932 -364758687 91018932 -364758687 91018932 -364758687 -418769264
result:
ok Total length is 2453227933
Test #21:
score: 0
Accepted
time: 2ms
memory: 3772kb
input:
-1000000000 -167957680 247368494 215997643 -384275539 -796580213
output:
4 -384275539 -167957680 -1000000000 -167957680 -384275539 -167957680 247368494 -167957680 247368494 -167957680 247368494 215997643 -384275539 -167957680 -384275539 -796580213
result:
ok Total length is 2259946350
Test #22:
score: 0
Accepted
time: 2ms
memory: 3772kb
input:
-619431287 -131966997 616405883 224993162 793394764 -1000000000
output:
4 616405883 -131966997 -619431287 -131966997 616405883 -131966997 616405883 224993162 616405883 -131966997 793394764 -131966997 793394764 -131966997 793394764 -1000000000
result:
ok Total length is 2637819213
Test #23:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
1000000000 127343545 -28934934 951599244 274060166 -1000000000
output:
4 274060166 127343545 1000000000 127343545 274060166 127343545 -28934934 127343545 -28934934 127343545 -28934934 951599244 274060166 127343545 274060166 -1000000000
result:
ok Total length is 2980534178
Test #24:
score: 0
Accepted
time: 2ms
memory: 3812kb
input:
-950000000 950000000 629494532 268139913 853768075 -8108129
output:
4 629494532 268139913 -950000000 268139913 -950000000 268139913 -950000000 950000000 629494532 268139913 853768075 268139913 853768075 268139913 853768075 -8108129
result:
ok Total length is 2761876204