Submission #97456

# Submission time Handle Problem Language Result Execution time Memory
97456 2019-02-16T10:07:07 Z KLPP NLO (COCI18_nlo) C++14
33 / 110
155 ms 66560 KB
#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
1 Correct 14 ms 3840 KB Output is correct
2 Correct 31 ms 4224 KB Output is correct
3 Correct 155 ms 62684 KB Output is correct
4 Runtime error 70 ms 66560 KB Execution killed with signal 9 (could be triggered by violating memory limits)
5 Runtime error 58 ms 66560 KB Execution killed with signal 9 (could be triggered by violating memory limits)
6 Runtime error 3 ms 384 KB Execution killed with signal 11 (could be triggered by violating memory limits)
7 Runtime error 3 ms 384 KB Execution killed with signal 11 (could be triggered by violating memory limits)
8 Runtime error 2 ms 384 KB Execution killed with signal 11 (could be triggered by violating memory limits)
9 Runtime error 6 ms 384 KB Execution killed with signal 11 (could be triggered by violating memory limits)
10 Runtime error 2 ms 484 KB Execution killed with signal 11 (could be triggered by violating memory limits)