QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#414608 | #8669. 正方形计数 | Network_Error | 0 | 31ms | 3648kb | C++14 | 902b | 2024-05-19 11:40:49 | 2024-05-19 11:40:50 |
Judging History
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=2000;
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: 30ms
memory: 3572kb
input:
4 131 603 131 1828 1919 1828 1919 603
output:
361182910200
result:
ok 1 number(s): "361182910200"
Test #2:
score: 10
Accepted
time: 30ms
memory: 3536kb
input:
4 239 211 239 962 261 962 261 211
output:
1498772
result:
ok 1 number(s): "1498772"
Test #3:
score: 10
Accepted
time: 31ms
memory: 3528kb
input:
4 0 0 0 2000 2000 2000 2000 0
output:
1336001667000
result:
ok 1 number(s): "1336001667000"
Test #4:
score: 10
Accepted
time: 30ms
memory: 3648kb
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: 31ms
memory: 3596kb
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: 3476kb
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: 3528kb
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%