Submission #19724115


Source Code Expand

Copy
/*
LL         JJ  SSSS    ii  ssss     SSSS BBBB
LL         JJ S           s        S     B   B
LL         JJ  SSS     ii  sss      SSS  BBBB
LL     JJ  JJ     S    ii     s        S B   B
LLLLLL  JJJJ  SSSS     ii ssss     SSSS  BBBB

 SSSS BBBB     ii  ssss    LL         JJ  SSSS
S     B   B       s        LL         JJ S
 SSS  BBBB     ii  sss     LL         JJ  SSS
    S B   B    ii     s    LL     JJ  JJ     S
SSSS  BBBB     ii ssss     LLLLLL  JJJJ  SSSS
*/
#include<bits/stdc++.h>
using namespace std;
int Abs(int x){return x<0?-x:x;}
int Check(int a,int b,int c)
{
	int s=min({a,b,c});
	return (s!=a)+(s!=b)+(s!=c);
}
int Recheck(int x,int y){return int(x==y && x!=0 && x!=1);}
int main(){
	int T;
	scanf("%d",&T);
	while(T-->0)
	{
		int ax,ay,bx,by,cx,cy;
		scanf("%d %d %d %d %d %d",&ax,&ay,&bx,&by,&cx,&cy);
		int disx=Check(ax,bx,cx),disy=Check(ay,by,cy);
		int dx=min({ax,bx,cx})*2+disx-1,dy=min({ay,by,cy})*2+disy-1;
		printf("%d\n",max(Abs(dx),Abs(dy))+Recheck(dx,dy));
	}
	return 0;
}

Submission Info

Submission Time
Task D - L
User C20211711LJS
Language C++ (GCC 9.2.1)
Score 600
Code Size 1038 Byte
Status AC
Exec Time 12 ms
Memory 3816 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:25:7: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   25 |  scanf("%d",&T);
      |  ~~~~~^~~~~~~~~
./Main.cpp:29:8: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   29 |   scanf("%d %d %d %d %d %d",&ax,&ay,&bx,&by,&cx,&cy);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 600 / 600
Status
AC × 2
AC × 15
Set Name Test Cases
Sample sample.txt, sample_2.txt
All edge.txt, edge_2.txt, edge_3.txt, edge_4.txt, edge_5.txt, edge_6.txt, edge_7.txt, edge_8.txt, random.txt, random_2.txt, random_3.txt, random_4.txt, random_5.txt, sample.txt, sample_2.txt
Case Name Status Exec Time Memory
edge.txt AC 12 ms 3592 KB
edge_2.txt AC 3 ms 3660 KB
edge_3.txt AC 4 ms 3664 KB
edge_4.txt AC 4 ms 3816 KB
edge_5.txt AC 4 ms 3816 KB
edge_6.txt AC 4 ms 3728 KB
edge_7.txt AC 3 ms 3584 KB
edge_8.txt AC 3 ms 3664 KB
random.txt AC 5 ms 3712 KB
random_2.txt AC 3 ms 3664 KB
random_3.txt AC 3 ms 3720 KB
random_4.txt AC 4 ms 3708 KB
random_5.txt AC 5 ms 3636 KB
sample.txt AC 2 ms 3592 KB
sample_2.txt AC 3 ms 3636 KB