QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#414607 | #8669. 正方形计数 | Network_Error | 0 | 24ms | 3656kb | C++14 | 902b | 2024-05-19 11:40:01 | 2024-05-19 11:40:02 |
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: 0
Wrong Answer
time: 24ms
memory: 3616kb
input:
4 131 603 131 1828 1919 1828 1919 603
output:
360146633700
result:
wrong answer 1st numbers differ - expected: '361182910200', found: '360146633700'
Subtask #2:
score: 0
Wrong Answer
Test #6:
score: 0
Wrong Answer
time: 0ms
memory: 3608kb
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: 3656kb
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%