QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#412189 | #8669. 正方形计数 | ANIG# | 0 | 3094ms | 3620kb | C++14 | 517b | 2024-05-16 10:10:02 | 2024-05-16 10:10:03 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int inf=1e18;
int n,mnx=inf,mny=inf,mxx=-inf,mxy=-inf,res;
signed main(){
cin>>n;
for(int i=1;i<=n;i++){
int x,y;
cin>>x>>y;
mnx=min(mnx,x);
mny=min(mny,y);
mxx=max(mxx,x);
mxy=max(mxy,y);
}
int a=mxx-mnx,b=mxy-mny;
for(int i=1;i<=a;i++){
for(int j=1;j<=b;j++){
for(int k=1;k<i;k++){
if(j-(i-k)<0)continue;
if(b<k+j)res+=b-j;
else res+=k;
}
res+=min(i,j);
}
}
cout<<res;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 10
Accepted
time: 1455ms
memory: 3552kb
input:
4 131 603 131 1828 1919 1828 1919 603
output:
361182910200
result:
ok 1 number(s): "361182910200"
Test #2:
score: 10
Accepted
time: 1ms
memory: 3392kb
input:
4 239 211 239 962 261 962 261 211
output:
1498772
result:
ok 1 number(s): "1498772"
Test #3:
score: 10
Accepted
time: 3094ms
memory: 3544kb
input:
4 0 0 0 2000 2000 2000 2000 0
output:
1336001667000
result:
ok 1 number(s): "1336001667000"
Test #4:
score: 10
Accepted
time: 3ms
memory: 3460kb
input:
4 36 771 36 786 672 786 672 771
output:
427720
result:
ok 1 number(s): "427720"
Test #5:
score: 0
Wrong Answer
time: 4ms
memory: 3380kb
input:
4 0 100 100 200 200 100 100 0
output:
136016700
result:
wrong answer 1st numbers differ - expected: '34001650', found: '136016700'
Subtask #2:
score: 0
Wrong Answer
Test #6:
score: 0
Wrong Answer
time: 1453ms
memory: 3384kb
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: 3620kb
input:
8 0 13 4 15 15 15 15 6 13 1 12 0 5 0 0 6
output:
5440
result:
wrong answer 1st numbers differ - expected: '4047', found: '5440'
Subtask #4:
score: 0
Skipped
Dependency #3:
0%
Subtask #5:
score: 0
Skipped
Dependency #4:
0%
Subtask #6:
score: 0
Skipped
Dependency #1:
0%