Submission #779200

# Submission time Handle Problem Language Result Execution time Memory
779200 2023-07-11T08:55:11 Z 1075508020060209tc NLO (COCI18_nlo) C++14
0 / 110
160 ms 16576 KB
#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 117 ms 7308 KB Output isn't correct
2 Incorrect 160 ms 8200 KB Output isn't correct
3 Runtime error 11 ms 16576 KB Execution killed with signal 11
4 Runtime error 23 ms 16540 KB Execution killed with signal 11
5 Runtime error 45 ms 16528 KB Execution killed with signal 11
6 Runtime error 31 ms 16532 KB Execution killed with signal 11
7 Runtime error 95 ms 16544 KB Execution killed with signal 11
8 Runtime error 59 ms 16564 KB Execution killed with signal 11
9 Runtime error 88 ms 16516 KB Execution killed with signal 11
10 Runtime error 70 ms 16544 KB Execution killed with signal 11