QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#420748#8669. 正方形计数yswn0 2ms3704kbC++14672b2024-05-24 21:40:202024-05-24 21:40:21

Judging History

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

  • [2024-05-24 21:40:21]
  • 评测
  • 测评结果:0
  • 用时:2ms
  • 内存:3704kb
  • [2024-05-24 21:40:20]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int MAX=10;
#define int long long
int n,m,ans;
struct node{
    int x,y;
} a[MAX];
inline int read(){
	int x=0,f=1;char c=getchar();
	while(c>'9'||c<'0'){if(c=='-')f=-1;c=getchar();}
	while(c<='9'&&c>='0'){x=(x<<3)+(x<<1)+(c^48);c=getchar();}
	return x*f;
}
signed main(){
    n=read();
    for(int i=1;i<=n;++i)  a[i]={read(),read()};
    n=a[3].x-a[1].x;m=a[2].y-a[1].y;
    // ans=n*(n+1)/2*m*(m+1)/2;
    // m=min(n,m);
    for(int i=1;i<=n;++i)
        for(int j=0;i+j<=m&&i+j<=n;++j){
            ans+=(n-i-j+1)*(m-i-j+1);
            // cout<<i<<" "<<j<<endl;
        }
    cout<<ans;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 10
Accepted
time: 1ms
memory: 3572kb

input:

4
131 603
131 1828
1919 1828
1919 603

output:

361182910200

result:

ok 1 number(s): "361182910200"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

4
239 211
239 962
261 962
261 211

output:

1498772

result:

ok 1 number(s): "1498772"

Test #3:

score: 0
Accepted
time: 2ms
memory: 3704kb

input:

4
0 0
0 2000
2000 2000
2000 0

output:

1336001667000

result:

ok 1 number(s): "1336001667000"

Test #4:

score: 0
Accepted
time: 0ms
memory: 3560kb

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: 0ms
memory: 3648kb

input:

4
0 100
100 200
200 100
100 0

output:

25840850

result:

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

Subtask #2:

score: 0
Wrong Answer

Test #6:

score: 0
Wrong Answer
time: 1ms
memory: 3628kb

input:

3
131 603
131 1828
1919 603

output:

361182910200

result:

wrong answer 1st numbers differ - expected: '63739309181', found: '361182910200'

Subtask #3:

score: 0
Wrong Answer

Test #11:

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

input:

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

output:

58

result:

wrong answer 1st numbers differ - expected: '4047', found: '58'

Subtask #4:

score: 0
Skipped

Dependency #3:

0%

Subtask #5:

score: 0
Skipped

Dependency #4:

0%

Subtask #6:

score: 0
Skipped

Dependency #1:

0%