QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#361052 | #4569. Connect the Points | mc020207# | AC ✓ | 0ms | 3980kb | C++14 | 1.8kb | 2024-03-22 18:43:21 | 2024-03-22 18:43:21 |
Judging History
answer
#include <bits/stdc++.h>
#define For(i, a, b) for(int i = (a); i <= (b);i++)
#define Rof(i, a, b) for(int i = (a); i >= (b);i--)
using namespace std;
int x[5];
int y[5];
int rk[3];
bool cmp (int a, int b)
{
return x[a] < x[b];
}
int main()
{
For(i, 1, 3) scanf("%d%d", &x[i], &y[i]);
int ymin = 1000000009, ymax = -1000000009;
int xmin = 1000000009, xmax = -1000000009;
For(i, 1, 3) rk[i] = i, ymin = min(ymin, y[i]), ymax = max(ymax, y[i]), xmin = min(xmin, x[i]), xmax = max(xmax, x[i]);
sort(rk + 1, rk + 1 + 3, cmp);
if(x[1] == x[2] && x[2] == x[3]) {
printf("1\n");
printf("%d %d %d %d\n", x[1] ,ymin, x[1], ymax);
}
else if(y[1] == y[2] && y[2] == y[3]) {
printf("1\n");
printf("%d %d %d %d\n", xmin, y[1], xmax, y[1]);
}
else if(x[1] == x[2]) {
printf("2\n");
printf("%d %d %d %d\n", x[1], ymin, x[1], ymax);
printf("%d %d %d %d\n", x[1], y[3], x[3], y[3]);
}
else if(x[2] == x[3]) {
printf("2\n");
printf("%d %d %d %d\n", x[2], ymin, x[2], ymax);
printf("%d %d %d %d\n", x[2], y[1], x[1], y[1]);
}
else if(y[1] == y[2]) {
printf("2\n");
printf("%d %d %d %d\n", xmin, y[1], xmax, y[1]);
printf("%d %d %d %d\n", x[3], y[3], x[3], y[1]);
}
else if(y[2] == y[3]) {
printf("2\n");
printf("%d %d %d %d\n", xmin, y[2], xmax, y[2]);
printf("%d %d %d %d\n", x[1], y[1], x[1], y[3]);
}
else {
printf("3\n");
printf("%d %d %d %d\n", x[rk[2]], ymin, x[rk[2]], ymax);
printf("%d %d %d %d\n", x[rk[1]], y[rk[1]], x[rk[2]], y[rk[1]]);
printf("%d %d %d %d\n", x[rk[3]], y[rk[3]], x[rk[2]], y[rk[3]]);
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3868kb
input:
1 1 3 5 8 6
output:
3 3 1 3 6 1 1 3 1 8 6 3 6
result:
ok Total length is 12
Test #2:
score: 0
Accepted
time: 0ms
memory: 3912kb
input:
1 1 2 2 3 3
output:
3 2 1 2 3 1 1 2 1 3 3 2 3
result:
ok Total length is 4
Test #3:
score: 0
Accepted
time: 0ms
memory: 3964kb
input:
1 1 2 3 3 2
output:
3 2 1 2 3 1 1 2 1 3 2 2 2
result:
ok Total length is 4
Test #4:
score: 0
Accepted
time: 0ms
memory: 3848kb
input:
1 2 2 1 3 3
output:
3 2 1 2 3 1 2 2 2 3 3 2 3
result:
ok Total length is 4
Test #5:
score: 0
Accepted
time: 0ms
memory: 3916kb
input:
1 2 2 3 3 1
output:
3 2 1 2 3 1 2 2 2 3 1 2 1
result:
ok Total length is 4
Test #6:
score: 0
Accepted
time: 0ms
memory: 3788kb
input:
1 3 2 1 3 2
output:
3 2 1 2 3 1 3 2 3 3 2 2 2
result:
ok Total length is 4
Test #7:
score: 0
Accepted
time: 0ms
memory: 3912kb
input:
1 3 2 2 3 1
output:
3 2 1 2 3 1 3 2 3 3 1 2 1
result:
ok Total length is 4
Test #8:
score: 0
Accepted
time: 0ms
memory: 3916kb
input:
-811089219 -147580223 -131318959 -47863115 180743101 601547107
output:
3 -131318959 -147580223 -131318959 601547107 -811089219 -147580223 -131318959 -147580223 180743101 601547107 -131318959 601547107
result:
ok Total length is 1740959650
Test #9:
score: 0
Accepted
time: 0ms
memory: 3924kb
input:
-953648657 -254962225 -198962039 539064186 536177467 -81912224
output:
3 -198962039 -254962225 -198962039 539064186 -953648657 -254962225 -198962039 -254962225 536177467 -81912224 -198962039 -81912224
result:
ok Total length is 2283852535
Test #10:
score: 0
Accepted
time: 0ms
memory: 3792kb
input:
170075350 644693857 -70945648 -531201615 -813420873 75995752
output:
3 -70945648 -531201615 -70945648 644693857 -813420873 75995752 -70945648 75995752 170075350 644693857 -70945648 644693857
result:
ok Total length is 2159391695
Test #11:
score: 0
Accepted
time: 0ms
memory: 3928kb
input:
-598308052 155442794 -752953801 111986435 782202531 -333732768
output:
3 -598308052 -333732768 -598308052 155442794 -752953801 111986435 -598308052 111986435 782202531 -333732768 -598308052 -333732768
result:
ok Total length is 2024331894
Test #12:
score: 0
Accepted
time: 0ms
memory: 3912kb
input:
140537651 392873314 856272625 199854620 284394957 -862945504
output:
3 284394957 -862945504 284394957 392873314 140537651 392873314 284394957 392873314 856272625 199854620 284394957 199854620
result:
ok Total length is 1971553792
Test #13:
score: 0
Accepted
time: 0ms
memory: 3928kb
input:
-531600195 66788696 495972018 -828643104 -537934741 235845303
output:
3 -531600195 -828643104 -531600195 235845303 -537934741 235845303 -531600195 235845303 495972018 -828643104 -531600195 -828643104
result:
ok Total length is 2098395166
Test #14:
score: 0
Accepted
time: 0ms
memory: 3792kb
input:
-565864098 -762723255 903590907 -762723255 -486054726 -762723255
output:
1 -565864098 -762723255 903590907 -762723255
result:
ok Total length is 1469455005
Test #15:
score: 0
Accepted
time: 0ms
memory: 3796kb
input:
80565983 -977814210 80565983 384343197 80565983 102575609
output:
1 80565983 -977814210 80565983 384343197
result:
ok Total length is 1362157407
Test #16:
score: 0
Accepted
time: 0ms
memory: 3928kb
input:
435839201 -838682337 435839201 821052661 499609215 273341058
output:
2 435839201 -838682337 435839201 821052661 435839201 273341058 499609215 273341058
result:
ok Total length is 1723505012
Test #17:
score: 0
Accepted
time: 0ms
memory: 3904kb
input:
435839201 273341058 499609215 821052661 435839201 -838682337
output:
3 435839201 -838682337 435839201 821052661 435839201 273341058 435839201 273341058 499609215 821052661 435839201 821052661
result:
ok Total length is 1723505012
Test #18:
score: 0
Accepted
time: 0ms
memory: 3980kb
input:
-550183491 -223052429 756776472 349902936 239047012 -223052429
output:
3 239047012 -223052429 239047012 349902936 -550183491 -223052429 239047012 -223052429 756776472 349902936 239047012 349902936
result:
ok Total length is 1879915328
Test #19:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
1000000000 894586329 -444648850 -239939045 -733796075 -301669878
output:
3 -444648850 -301669878 -444648850 894586329 -733796075 -301669878 -444648850 -301669878 1000000000 894586329 -444648850 894586329
result:
ok Total length is 2930052282
Test #20:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
669699982 91018932 438054159 1000000000 -364758687 -418769264
output:
3 438054159 -418769264 438054159 1000000000 -364758687 -418769264 438054159 -418769264 669699982 91018932 438054159 91018932
result:
ok Total length is 2453227933
Test #21:
score: 0
Accepted
time: 0ms
memory: 3928kb
input:
-1000000000 -167957680 247368494 215997643 -384275539 -796580213
output:
3 -384275539 -796580213 -384275539 215997643 -1000000000 -167957680 -384275539 -167957680 247368494 215997643 -384275539 215997643
result:
ok Total length is 2259946350
Test #22:
score: 0
Accepted
time: 0ms
memory: 3848kb
input:
-619431287 -131966997 616405883 224993162 793394764 -1000000000
output:
3 616405883 -1000000000 616405883 224993162 -619431287 -131966997 616405883 -131966997 793394764 -1000000000 616405883 -1000000000
result:
ok Total length is 2637819213
Test #23:
score: 0
Accepted
time: 0ms
memory: 3848kb
input:
1000000000 127343545 -28934934 951599244 274060166 -1000000000
output:
3 274060166 -1000000000 274060166 951599244 -28934934 951599244 274060166 951599244 1000000000 127343545 274060166 127343545
result:
ok Total length is 2980534178
Test #24:
score: 0
Accepted
time: 0ms
memory: 3868kb
input:
-950000000 950000000 629494532 268139913 853768075 -8108129
output:
3 629494532 -8108129 629494532 950000000 -950000000 950000000 629494532 950000000 853768075 -8108129 629494532 -8108129
result:
ok Total length is 2761876204