#include<bits/stdc++.h>
using namespace std;
#define int long long
#define X first
#define Y second
int n;int m;
int Q;
int gr[1010][1010];
signed main(){
cin>>n>>m;
cin>>Q;
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
gr[i][j]=1;
}
}
while(Q--){
int x;int y;int r;
cin>>x>>y>>r;
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
if( ((i-x)*(i-x)+(j-y)*(j-y))<=r*r ){
gr[i][j]=0;
}
}
}
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
// cout<<gr[i][j]<<" ";
gr[i][j]++;
}//cout<<endl;
}
//cout<<endl;
}
int ans=0;
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
ans+=gr[i][j]-1;
}
}
cout<<ans<<endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
126 ms |
7252 KB |
Output isn't correct |
2 |
Incorrect |
139 ms |
8148 KB |
Output isn't correct |
3 |
Runtime error |
11 ms |
16596 KB |
Execution killed with signal 11 |
4 |
Runtime error |
18 ms |
16588 KB |
Execution killed with signal 11 |
5 |
Runtime error |
35 ms |
16588 KB |
Execution killed with signal 11 |
6 |
Runtime error |
30 ms |
16528 KB |
Execution killed with signal 11 |
7 |
Runtime error |
50 ms |
16532 KB |
Execution killed with signal 11 |
8 |
Runtime error |
57 ms |
16528 KB |
Execution killed with signal 11 |
9 |
Runtime error |
56 ms |
16560 KB |
Execution killed with signal 11 |
10 |
Runtime error |
69 ms |
16508 KB |
Execution killed with signal 11 |