QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#414609#8669. 正方形计数Network_Error0 118ms3616kbC++14902b2024-05-19 11:41:212024-05-19 11:41:21

Judging History

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

  • [2024-05-19 11:41:21]
  • 评测
  • 测评结果:0
  • 用时:118ms
  • 内存:3616kb
  • [2024-05-19 11:41:21]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define pii pair<int,int>
#define piii tuple<int,int,int>
#define mp make_pair
#define mt make_tuple
#define fi first
#define x first
#define y second
#define se second
#define ins insert
#define let(a...) int a;tie(a)
#define deb(var) cerr<<#var<<'='<<(var)<<"; "
#define int long long

const int W=4000;
int n;
pii g[10];
void acrec(){
	int w=g[3].x-g[2].x,h=g[2].y-g[1].y,ans=0;
	for(int x=-W;x<=W;x++){
		for(int y=-W;y<=W;y++){
			if(x==0&&y==0)continue;
			int b=abs(x)+abs(y);
			ans+=max(w-b+1,0ll)*max(h-b+1,0ll);
		}
	}							cout<<ans/4<<'\n';
}
void actri(){
	
}
void work(){
	cin>>n;
	for(int i=1;i<=n;i++)
		cin>>g[i].x>>g[i].y;
	if(n==4)return acrec();
	if(n==3)return actri();
}
signed main(){
	ios::sync_with_stdio(0),
	cin.tie(0),cout.tie(0);
	int T=1;while(T--)work();
}


Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 10
Accepted
time: 118ms
memory: 3608kb

input:

4
131 603
131 1828
1919 1828
1919 603

output:

361182910200

result:

ok 1 number(s): "361182910200"

Test #2:

score: 0
Accepted
time: 118ms
memory: 3616kb

input:

4
239 211
239 962
261 962
261 211

output:

1498772

result:

ok 1 number(s): "1498772"

Test #3:

score: 0
Accepted
time: 118ms
memory: 3572kb

input:

4
0 0
0 2000
2000 2000
2000 0

output:

1336001667000

result:

ok 1 number(s): "1336001667000"

Test #4:

score: 0
Accepted
time: 118ms
memory: 3540kb

input:

4
36 771
36 786
672 786
672 771

output:

427720

result:

ok 1 number(s): "427720"

Test #5:

score: -10
Wrong Answer
time: 118ms
memory: 3560kb

input:

4
0 100
100 200
200 100
100 0

output:

8670850

result:

wrong answer 1st numbers differ - expected: '34001650', found: '8670850'

Subtask #2:

score: 0
Wrong Answer

Test #6:

score: 0
Wrong Answer
time: 0ms
memory: 3616kb

input:

3
131 603
131 1828
1919 603

output:


result:

wrong answer Answer contains longer sequence [length = 1], but output contains 0 elements

Subtask #3:

score: 0
Wrong Answer

Test #11:

score: 0
Wrong Answer
time: 0ms
memory: 3544kb

input:

8
0 13
4 15
15 15
15 6
13 1
12 0
5 0
0 6

output:


result:

wrong answer Answer contains longer sequence [length = 1], but output contains 0 elements

Subtask #4:

score: 0
Skipped

Dependency #3:

0%

Subtask #5:

score: 0
Skipped

Dependency #4:

0%

Subtask #6:

score: 0
Skipped

Dependency #1:

0%