QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#150905#6806. LandlordLFCode#WA 5ms1492kbC++14884b2023-08-26 14:27:062023-08-26 14:27:07

Judging History

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

  • [2023-08-26 14:27:07]
  • 评测
  • 测评结果:WA
  • 用时:5ms
  • 内存:1492kb
  • [2023-08-26 14:27:06]
  • 提交

answer

#include<cstdio>
#define int long long
int read(){
	char ch=getchar();int nn=0,ssss=1;
	while(ch<'0'||ch>'9'){if(ch=='-')ssss*=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){nn=nn*10+(ch-'0');ch=getchar();}
	return nn*ssss;
}
#define in1(x,y) ((x)>=x1&&(x)<=x2&&(y)>=y1&&(y)<=y2)
#define in2(x,y) ((x)>=x3&&(x)<=x4&&(y)>=y3&&(y)<=y4)
bool solve(){
	int x1=read();int y1=read();
	int x2=read();int y2=read();
	int x3=read();int y3=read();
	int x4=read();int y4=read();
	if(x1==x3&&y1==y3&&x2==y2&&x4==y4){
		puts("2");
		return true;
	}
	if(in2(x1,y1)&&in2(x2,y2)&&in2(x1,y2)&&in2(x2,y1)){
		puts("3");
		return true;
	}
	if(in1(x3,y3)&&in1(x4,y4)&&in1(x3,y4)&&in1(x4,y3)){
		puts("3");
		return true;
	}
	if(y2<=y3||y1>=y4||x2<=x3||x1>=x4){
		puts("3");
		return true;
	}
	puts("4");
	return true;
}
signed main(){
	int T=read();
	while(T--)solve();
}

详细

Test #1:

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

input:

3
0 0 1 1
2 2 3 4
1 0 3 2
0 1 2 3
0 0 1 1
0 0 1 1

output:

3
4
2

result:

ok 3 lines

Test #2:

score: -100
Wrong Answer
time: 5ms
memory: 1492kb

input:

10000
399413444 601729739 838979329 605646850
176742602 192902430 399413444 601729739
19226489 2915752 27806715 977516728
4075670 1872865 19226489 925008461
45547871 393001695 58201503 713825285
18241876 197851829 45547871 713825285
237513514 504913958 868997719 543598899
134432693 110279295 2375135...

output:

3
3
3
3
3
3
3
3
3
3
3
3
3
3
4
4
4
4
4
4
4
4
3
3
4
3
3
4
3
3
4
3
3
4
4
3
3
4
3
3
4
3
3
4
3
3
4
4
3
3
4
3
3
4
4
4
3
3
4
3
4
3
3
3
3
3
4
3
3
3
3
3
3
4
3
3
3
3
3
4
3
3
4
3
3
4
4
3
3
4
3
3
4
4
4
3
3
4
3
4
3
3
3
3
3
4
4
4
4
4
4
4
4
3
3
4
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
4
4
4
3
3
4
...

result:

wrong answer 38th lines differ - expected: '5', found: '4'