QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#376069 | #4569. Connect the Points | InfinityNS# | AC ✓ | 1ms | 4060kb | C++23 | 919b | 2024-04-03 20:18:22 | 2024-04-03 20:18:24 |
Judging History
answer
#include<bits/stdc++.h>
#define sz(x) (int)(x).size()
#define f first
#define s second
#define pb push_back
#define all(x) (x).begin(),(x).end()
using namespace std;
int main(){
vector<pair<int,int>> tc(3);
vector<pair<int,int>> x,y;
for(int i=0;i<3;i++){
scanf("%i %i",&tc[i].f,&tc[i].s);
x.pb({tc[i].f,i});
y.pb({tc[i].s,i});
}
sort(all(x));
vector<pair<pair<int,int>,pair<int,int>>> ans;
for(int i=0;i<2;i++){
if(x[i].f!=x[i+1].f){
int j=i==0?0:2;
ans.pb({{x[i].f,tc[x[j].s].s},{x[i+1].f,tc[x[j].s].s}});
}
}
int xc=x[1].f;
sort(all(y));
for(int i=0;i<2;i++){
if(y[i].f!=y[i+1].f){
ans.pb({{xc,y[i].f},{xc,y[i+1].f}});
}
}
printf("%i\n",sz(ans));
for(auto p:ans){
printf("%i %i %i %i\n",p.f.f,p.f.s,p.s.f,p.s.s);
}
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3780kb
input:
1 1 3 5 8 6
output:
4 1 1 3 1 3 6 8 6 3 1 3 5 3 5 3 6
result:
ok Total length is 12
Test #2:
score: 0
Accepted
time: 0ms
memory: 3728kb
input:
1 1 2 2 3 3
output:
4 1 1 2 1 2 3 3 3 2 1 2 2 2 2 2 3
result:
ok Total length is 4
Test #3:
score: 0
Accepted
time: 1ms
memory: 3784kb
input:
1 1 2 3 3 2
output:
4 1 1 2 1 2 2 3 2 2 1 2 2 2 2 2 3
result:
ok Total length is 4
Test #4:
score: 0
Accepted
time: 0ms
memory: 3728kb
input:
1 2 2 1 3 3
output:
4 1 2 2 2 2 3 3 3 2 1 2 2 2 2 2 3
result:
ok Total length is 4
Test #5:
score: 0
Accepted
time: 1ms
memory: 3784kb
input:
1 2 2 3 3 1
output:
4 1 2 2 2 2 1 3 1 2 1 2 2 2 2 2 3
result:
ok Total length is 4
Test #6:
score: 0
Accepted
time: 1ms
memory: 3780kb
input:
1 3 2 1 3 2
output:
4 1 3 2 3 2 2 3 2 2 1 2 2 2 2 2 3
result:
ok Total length is 4
Test #7:
score: 0
Accepted
time: 0ms
memory: 3820kb
input:
1 3 2 2 3 1
output:
4 1 3 2 3 2 1 3 1 2 1 2 2 2 2 2 3
result:
ok Total length is 4
Test #8:
score: 0
Accepted
time: 0ms
memory: 3728kb
input:
-811089219 -147580223 -131318959 -47863115 180743101 601547107
output:
4 -811089219 -147580223 -131318959 -147580223 -131318959 601547107 180743101 601547107 -131318959 -147580223 -131318959 -47863115 -131318959 -47863115 -131318959 601547107
result:
ok Total length is 1740959650
Test #9:
score: 0
Accepted
time: 0ms
memory: 3728kb
input:
-953648657 -254962225 -198962039 539064186 536177467 -81912224
output:
4 -953648657 -254962225 -198962039 -254962225 -198962039 -81912224 536177467 -81912224 -198962039 -254962225 -198962039 -81912224 -198962039 -81912224 -198962039 539064186
result:
ok Total length is 2283852535
Test #10:
score: 0
Accepted
time: 0ms
memory: 3764kb
input:
170075350 644693857 -70945648 -531201615 -813420873 75995752
output:
4 -813420873 75995752 -70945648 75995752 -70945648 644693857 170075350 644693857 -70945648 -531201615 -70945648 75995752 -70945648 75995752 -70945648 644693857
result:
ok Total length is 2159391695
Test #11:
score: 0
Accepted
time: 0ms
memory: 3784kb
input:
-598308052 155442794 -752953801 111986435 782202531 -333732768
output:
4 -752953801 111986435 -598308052 111986435 -598308052 -333732768 782202531 -333732768 -598308052 -333732768 -598308052 111986435 -598308052 111986435 -598308052 155442794
result:
ok Total length is 2024331894
Test #12:
score: 0
Accepted
time: 1ms
memory: 4060kb
input:
140537651 392873314 856272625 199854620 284394957 -862945504
output:
4 140537651 392873314 284394957 392873314 284394957 199854620 856272625 199854620 284394957 -862945504 284394957 199854620 284394957 199854620 284394957 392873314
result:
ok Total length is 1971553792
Test #13:
score: 0
Accepted
time: 1ms
memory: 3724kb
input:
-531600195 66788696 495972018 -828643104 -537934741 235845303
output:
4 -537934741 235845303 -531600195 235845303 -531600195 -828643104 495972018 -828643104 -531600195 -828643104 -531600195 66788696 -531600195 66788696 -531600195 235845303
result:
ok Total length is 2098395166
Test #14:
score: 0
Accepted
time: 0ms
memory: 3776kb
input:
-565864098 -762723255 903590907 -762723255 -486054726 -762723255
output:
2 -565864098 -762723255 -486054726 -762723255 -486054726 -762723255 903590907 -762723255
result:
ok Total length is 1469455005
Test #15:
score: 0
Accepted
time: 0ms
memory: 4024kb
input:
80565983 -977814210 80565983 384343197 80565983 102575609
output:
2 80565983 -977814210 80565983 102575609 80565983 102575609 80565983 384343197
result:
ok Total length is 1362157407
Test #16:
score: 0
Accepted
time: 0ms
memory: 3784kb
input:
435839201 -838682337 435839201 821052661 499609215 273341058
output:
3 435839201 273341058 499609215 273341058 435839201 -838682337 435839201 273341058 435839201 273341058 435839201 821052661
result:
ok Total length is 1723505012
Test #17:
score: 0
Accepted
time: 0ms
memory: 3828kb
input:
435839201 273341058 499609215 821052661 435839201 -838682337
output:
3 435839201 821052661 499609215 821052661 435839201 -838682337 435839201 273341058 435839201 273341058 435839201 821052661
result:
ok Total length is 1723505012
Test #18:
score: 0
Accepted
time: 0ms
memory: 3760kb
input:
-550183491 -223052429 756776472 349902936 239047012 -223052429
output:
3 -550183491 -223052429 239047012 -223052429 239047012 349902936 756776472 349902936 239047012 -223052429 239047012 349902936
result:
ok Total length is 1879915328
Test #19:
score: 0
Accepted
time: 1ms
memory: 3788kb
input:
1000000000 894586329 -444648850 -239939045 -733796075 -301669878
output:
4 -733796075 -301669878 -444648850 -301669878 -444648850 894586329 1000000000 894586329 -444648850 -301669878 -444648850 -239939045 -444648850 -239939045 -444648850 894586329
result:
ok Total length is 2930052282
Test #20:
score: 0
Accepted
time: 0ms
memory: 3760kb
input:
669699982 91018932 438054159 1000000000 -364758687 -418769264
output:
4 -364758687 -418769264 438054159 -418769264 438054159 91018932 669699982 91018932 438054159 -418769264 438054159 91018932 438054159 91018932 438054159 1000000000
result:
ok Total length is 2453227933
Test #21:
score: 0
Accepted
time: 0ms
memory: 3784kb
input:
-1000000000 -167957680 247368494 215997643 -384275539 -796580213
output:
4 -1000000000 -167957680 -384275539 -167957680 -384275539 215997643 247368494 215997643 -384275539 -796580213 -384275539 -167957680 -384275539 -167957680 -384275539 215997643
result:
ok Total length is 2259946350
Test #22:
score: 0
Accepted
time: 1ms
memory: 3764kb
input:
-619431287 -131966997 616405883 224993162 793394764 -1000000000
output:
4 -619431287 -131966997 616405883 -131966997 616405883 -1000000000 793394764 -1000000000 616405883 -1000000000 616405883 -131966997 616405883 -131966997 616405883 224993162
result:
ok Total length is 2637819213
Test #23:
score: 0
Accepted
time: 0ms
memory: 3768kb
input:
1000000000 127343545 -28934934 951599244 274060166 -1000000000
output:
4 -28934934 951599244 274060166 951599244 274060166 127343545 1000000000 127343545 274060166 -1000000000 274060166 127343545 274060166 127343545 274060166 951599244
result:
ok Total length is 2980534178
Test #24:
score: 0
Accepted
time: 0ms
memory: 3780kb
input:
-950000000 950000000 629494532 268139913 853768075 -8108129
output:
4 -950000000 950000000 629494532 950000000 629494532 -8108129 853768075 -8108129 629494532 -8108129 629494532 268139913 629494532 268139913 629494532 950000000
result:
ok Total length is 2761876204