Submission #97456

#TimeUsernameProblemLanguageResultExecution timeMemory
97456KLPPNLO (COCI18_nlo)C++14
33 / 110
155 ms66560 KiB
#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 timeMemoryGrader output
Fetching results...