QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#536100#4569. Connect the PointsLavine#AC ✓0ms3944kbC++141004b2024-08-28 18:33:242024-08-28 18:33:25

Judging History

你现在查看的是最新测评结果

  • [2024-08-28 18:33:25]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3944kb
  • [2024-08-28 18:33:24]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
long long x[5],y[5];
struct L{
    int x1,x2,y1,y2;
};
vector<L>ans;
void Link(int x1,int y1,int x2,int y2){
    if(x1==x2&&y1==y2)return;
    ans.push_back((L){x1,x2,y1,y2});
}
int main(){
    scanf("%lld %lld %lld %lld %lld %lld",&x[1],&y[1],&x[2],&y[2],&x[3],&y[3]);
    if(x[1]>x[2])swap(x[1],x[2]),swap(y[1],y[2]);
    if(x[1]>x[3])swap(x[1],x[3]),swap(y[1],y[3]);
    if(x[2]>x[3])swap(x[2],x[3]),swap(y[2],y[3]);
    if(y[2]>y[1]&&y[2]>y[3]){
        Link(x[1],y[1],x[2],y[1]),Link(x[3],y[3],x[2],y[3]);
        Link(x[2],y[2],x[2],min(y[1],y[3]));
    }else if(y[2]<y[1]&&y[2]<y[3]){
        Link(x[1],y[1],x[2],y[1]),Link(x[3],y[3],x[2],y[3]);
        Link(x[2],y[2],x[2],max(y[1],y[3]));
    }else {
        Link(x[1],y[1],x[2],y[1]),Link(x[3],y[3],x[2],y[3]);
        Link(x[2],y[1],x[2],y[3]);
    }
    printf("%d\n",(int)ans.size());
    for(auto t:ans){
        printf("%d %d %d %d\n",t.x1,t.y1,t.x2,t.y2);
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3792kb

input:

1 1
3 5
8 6

output:

3
1 1 3 1
8 6 3 6
3 1 3 6

result:

ok Total length is 12

Test #2:

score: 0
Accepted
time: 0ms
memory: 3872kb

input:

1 1
2 2
3 3

output:

3
1 1 2 1
3 3 2 3
2 1 2 3

result:

ok Total length is 4

Test #3:

score: 0
Accepted
time: 0ms
memory: 3796kb

input:

1 1
2 3
3 2

output:

3
1 1 2 1
3 2 2 2
2 3 2 1

result:

ok Total length is 4

Test #4:

score: 0
Accepted
time: 0ms
memory: 3872kb

input:

1 2
2 1
3 3

output:

3
1 2 2 2
3 3 2 3
2 1 2 3

result:

ok Total length is 4

Test #5:

score: 0
Accepted
time: 0ms
memory: 3860kb

input:

1 2
2 3
3 1

output:

3
1 2 2 2
3 1 2 1
2 3 2 1

result:

ok Total length is 4

Test #6:

score: 0
Accepted
time: 0ms
memory: 3940kb

input:

1 3
2 1
3 2

output:

3
1 3 2 3
3 2 2 2
2 1 2 3

result:

ok Total length is 4

Test #7:

score: 0
Accepted
time: 0ms
memory: 3860kb

input:

1 3
2 2
3 1

output:

3
1 3 2 3
3 1 2 1
2 3 2 1

result:

ok Total length is 4

Test #8:

score: 0
Accepted
time: 0ms
memory: 3944kb

input:

-811089219 -147580223
-131318959 -47863115
180743101 601547107

output:

3
-811089219 -147580223 -131318959 -147580223
180743101 601547107 -131318959 601547107
-131318959 -147580223 -131318959 601547107

result:

ok Total length is 1740959650

Test #9:

score: 0
Accepted
time: 0ms
memory: 3820kb

input:

-953648657 -254962225
-198962039 539064186
536177467 -81912224

output:

3
-953648657 -254962225 -198962039 -254962225
536177467 -81912224 -198962039 -81912224
-198962039 539064186 -198962039 -254962225

result:

ok Total length is 2283852535

Test #10:

score: 0
Accepted
time: 0ms
memory: 3944kb

input:

170075350 644693857
-70945648 -531201615
-813420873 75995752

output:

3
-813420873 75995752 -70945648 75995752
170075350 644693857 -70945648 644693857
-70945648 -531201615 -70945648 644693857

result:

ok Total length is 2159391695

Test #11:

score: 0
Accepted
time: 0ms
memory: 3768kb

input:

-598308052 155442794
-752953801 111986435
782202531 -333732768

output:

3
-752953801 111986435 -598308052 111986435
782202531 -333732768 -598308052 -333732768
-598308052 155442794 -598308052 -333732768

result:

ok Total length is 2024331894

Test #12:

score: 0
Accepted
time: 0ms
memory: 3940kb

input:

140537651 392873314
856272625 199854620
284394957 -862945504

output:

3
140537651 392873314 284394957 392873314
856272625 199854620 284394957 199854620
284394957 -862945504 284394957 392873314

result:

ok Total length is 1971553792

Test #13:

score: 0
Accepted
time: 0ms
memory: 3872kb

input:

-531600195 66788696
495972018 -828643104
-537934741 235845303

output:

3
-537934741 235845303 -531600195 235845303
495972018 -828643104 -531600195 -828643104
-531600195 235845303 -531600195 -828643104

result:

ok Total length is 2098395166

Test #14:

score: 0
Accepted
time: 0ms
memory: 3856kb

input:

-565864098 -762723255
903590907 -762723255
-486054726 -762723255

output:

2
-565864098 -762723255 -486054726 -762723255
903590907 -762723255 -486054726 -762723255

result:

ok Total length is 1469455005

Test #15:

score: 0
Accepted
time: 0ms
memory: 3860kb

input:

80565983 -977814210
80565983 384343197
80565983 102575609

output:

1
80565983 384343197 80565983 -977814210

result:

ok Total length is 1362157407

Test #16:

score: 0
Accepted
time: 0ms
memory: 3752kb

input:

435839201 -838682337
435839201 821052661
499609215 273341058

output:

2
499609215 273341058 435839201 273341058
435839201 821052661 435839201 -838682337

result:

ok Total length is 1723505012

Test #17:

score: 0
Accepted
time: 0ms
memory: 3728kb

input:

435839201 273341058
499609215 821052661
435839201 -838682337

output:

2
499609215 821052661 435839201 821052661
435839201 -838682337 435839201 821052661

result:

ok Total length is 1723505012

Test #18:

score: 0
Accepted
time: 0ms
memory: 3864kb

input:

-550183491 -223052429
756776472 349902936
239047012 -223052429

output:

3
-550183491 -223052429 239047012 -223052429
756776472 349902936 239047012 349902936
239047012 -223052429 239047012 349902936

result:

ok Total length is 1879915328

Test #19:

score: 0
Accepted
time: 0ms
memory: 3944kb

input:

1000000000 894586329
-444648850 -239939045
-733796075 -301669878

output:

3
-733796075 -301669878 -444648850 -301669878
1000000000 894586329 -444648850 894586329
-444648850 -301669878 -444648850 894586329

result:

ok Total length is 2930052282

Test #20:

score: 0
Accepted
time: 0ms
memory: 3868kb

input:

669699982 91018932
438054159 1000000000
-364758687 -418769264

output:

3
-364758687 -418769264 438054159 -418769264
669699982 91018932 438054159 91018932
438054159 1000000000 438054159 -418769264

result:

ok Total length is 2453227933

Test #21:

score: 0
Accepted
time: 0ms
memory: 3792kb

input:

-1000000000 -167957680
247368494 215997643
-384275539 -796580213

output:

3
-1000000000 -167957680 -384275539 -167957680
247368494 215997643 -384275539 215997643
-384275539 -796580213 -384275539 215997643

result:

ok Total length is 2259946350

Test #22:

score: 0
Accepted
time: 0ms
memory: 3872kb

input:

-619431287 -131966997
616405883 224993162
793394764 -1000000000

output:

3
-619431287 -131966997 616405883 -131966997
793394764 -1000000000 616405883 -1000000000
616405883 224993162 616405883 -1000000000

result:

ok Total length is 2637819213

Test #23:

score: 0
Accepted
time: 0ms
memory: 3944kb

input:

1000000000 127343545
-28934934 951599244
274060166 -1000000000

output:

3
-28934934 951599244 274060166 951599244
1000000000 127343545 274060166 127343545
274060166 -1000000000 274060166 951599244

result:

ok Total length is 2980534178

Test #24:

score: 0
Accepted
time: 0ms
memory: 3872kb

input:

-950000000 950000000
629494532 268139913
853768075 -8108129

output:

3
-950000000 950000000 629494532 950000000
853768075 -8108129 629494532 -8108129
629494532 950000000 629494532 -8108129

result:

ok Total length is 2761876204