結果

問題 No.98 円を描こう
ユーザー monburan_0401monburan_0401
提出日時 2018-09-16 14:27:50
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 295 bytes
コンパイル時間 312 ms
コンパイル使用メモリ 28,736 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-25 08:59:26
合計ジャッジ時間 981 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,376 KB
testcase_01 AC 1 ms
4,376 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 1 ms
4,376 KB
testcase_08 AC 1 ms
4,380 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 if(L == r){
		printf("%d\n",2*r+1);
	}
	return 0;
}
0