結果

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

ソースコード

diff #

/*
	yukicoder No.98 円を描こう
	解答者:ヒロソフ(HiroakiSoftware)
*/
#include <stdio.h>
#include <math.h>

int main(void) {
	int Px, Py;
	scanf("%d %d", &Px, &Py);
	double r = sqrt((double)(Px * Px + Py * Py));
	printf("%d\n", (int)(2 * r + 1));
	return 0;
}
0