結果

問題 No.98 円を描こう
ユーザー mafuyu-aki
提出日時 2017-05-23 23:22:10
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 346 bytes
コンパイル時間 212 ms
コンパイル使用メモリ 31,488 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-19 11:51:41
合計ジャッジ時間 701 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 6
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main(int, char**)’:
main.cpp:15:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   15 |         scanf("%d %d", &X, &Y);
      |         ~~~~~^~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

#define READ_BUFSIZE ( 1024 )
#define READ_DELIMITER ( " " )


int main(int argc, char *argv[]) 
{

	int X = 0;
	int Y = 0;
	scanf("%d %d", &X, &Y);

	double R = X*X + Y*Y;
	R = sqrt (R);
	R *= 2;

	int r = R;
	if (r <= R)
		r++;


	printf("%d\n", r);

	return 0;

}

0