답안 #96388

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
96388 2019-02-09T01:11:43 Z DiegoGarcia NLO (COCI18_nlo) C++11
22 / 110
148 ms 16376 KB
#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

nlo.cpp: In function 'int main()':
nlo.cpp:17:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%lld %lld",&n,&m);
     ~~~~~^~~~~~~~~~~~~~~~~~~
nlo.cpp:18:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%lld",&k);
     ~~~~~^~~~~~~~~~~
nlo.cpp:22:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%lld %lld %lld",&xi,&yi,&ri);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 124 ms 7288 KB Output is correct
2 Correct 148 ms 8188 KB Output is correct
3 Runtime error 21 ms 16376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Runtime error 25 ms 16376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
5 Runtime error 45 ms 16220 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Runtime error 36 ms 16376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
7 Runtime error 61 ms 16364 KB Execution killed with signal 11 (could be triggered by violating memory limits)
8 Runtime error 65 ms 16376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
9 Runtime error 60 ms 16376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
10 Runtime error 73 ms 16248 KB Execution killed with signal 11 (could be triggered by violating memory limits)