# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
779200 | 1075508020060209tc | NLO (COCI18_nlo) | C++14 | 160 ms | 16576 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 |
---|---|---|---|---|
Fetching results... |