# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
96388 | DiegoGarcia | NLO (COCI18_nlo) | C++11 | 148 ms | 16376 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>
#define optimiza_io ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pb push_back
#define ft first
#define sd second
#define ll long long
#define ld long double
#define ull unsigned long long
#define INF 1E5
#define LINF 1E18
using namespace std;
ll n,m,k,xi,yi,ri,ans=0;
ll mat[1006][1006];
int main()
{
scanf("%lld %lld",&n,&m);
scanf("%lld",&k);
// for( ll i=1; i<=n; i++ ) for( ll j=1; j<=n; j++ ) mat[i][j] = 1;
for( ll s=1; s<=k; s++ )
{
scanf("%lld %lld %lld",&xi,&yi,&ri);
for( ll i=1; i<=n; i++ ) for( ll j=1; j<=m; j++ )mat[i][j]++;
for( ll x=1; x<=n; x++ )
{
for( ll y=1; y<=m; y++ )
{
if( xi*xi + yi*yi - ri*ri <= 2*(xi*x + yi*y) - x*x - y*y )
mat[x][y] = 0;
}
}
}
if( k == 0 )
ans = n*m;
for( ll i=1; i<=n; i++ )
{
for( ll j=1; j<=m; j++ )
{
ans += mat[i][j];
}
}
printf("%lld",ans);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |