# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
97456 | KLPP | NLO (COCI18_nlo) | C++14 | 155 ms | 66560 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
typedef long long int lld;
int main(){
int n,m;
cin>>n>>m;
int arr[n][m];
for(int i=0;i<n;i++){
for(int j=0;j<m;j++)arr[i][j]=0;
}int k;
cin>>k;
for(int i=1;i<=k;i++){
int x,y,r;
cin>>x>>y>>r;
x--;y--;
for(int j=0;j<=r;j++){
for(int k=0;k*k+j*j<=r*r;k++){
arr[x-j][y-k]=i;
arr[x+j][y-k]=i;
arr[x-j][y+k]=i;
arr[x+j][y+k]=i;
}
}
}
lld ans=0;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
ans+=k-arr[i][j];
}
}cout<<ans<<endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |