結果

問題 No.98 円を描こう
ユーザー monburan_0401monburan_0401
提出日時 2018-09-16 04:16:15
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 284 bytes
コンパイル時間 105 ms
コンパイル使用メモリ 28,712 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-25 08:53:53
合計ジャッジ時間 746 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,376 KB
testcase_01 AC 0 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 0 ms
4,380 KB
testcase_06 WA -
testcase_07 AC 0 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <math.h>
int main(void){
	int xp,yp;
	int r;
	double L;
	
	scanf("%d %d",&xp,&yp);
	
	L = sqrt(xp*xp + yp*yp);
	r = L / 1;		//	整数化
/*	if(L % 1 > 0){
		r++;
	}
*/
	if(L > r){
		r++;
		printf("%d\n",2*r);
	}else{
		printf("%d\n",2*r+1);
	}
	return 0;
}
0