結果

問題 No.172 UFOを捕まえろ
ユーザー 沙耶花
提出日時 2021-11-03 16:39:54
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 456 bytes
コンパイル時間 4,592 ms
コンパイル使用メモリ 249,404 KB
最終ジャッジ日時 2025-01-25 11:01:44
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 2000000000



int main(){	
	
	int x,y,r;
	cin>>x>>y>>r;
	
	int ans = 0;
	
	for(int i=-r;i<=r;i++){
		for(int j=-r;j<=r;j++){
	
			if(i*i+j*j>r*r)continue;
			int X = x+i;
			int Y = y+j;
			ans = max(ans,abs(X)+abs(Y)+1);
		}
	}
	cout<<ans<<endl;
	
	return 0;
	
}
0