結果

問題 No.98 円を描こう
ユーザー prog470prog470
提出日時 2016-09-11 10:46:17
言語 C++11
(gcc 11.4.0)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 465 bytes
コンパイル時間 365 ms
コンパイル使用メモリ 63,420 KB
最終ジャッジ日時 2024-04-27 02:22:08
合計ジャッジ時間 631 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:33:23: error: ‘sqrt’ was not declared in this scope
   33 |         cout << (int)(sqrt(r2) * 2 + 1) << endl;
      |                       ^~~~

ソースコード

diff #

#include<stdio.h>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <string>
#include <stdio.h>

using namespace std;

int main() {

	double xp, yp;
	cin >> xp >> yp;

	double r2 = xp*xp + yp*yp;

	/*
	int r = 0;
	for (;;) {
		if (r > 2 * sqrt(r2)) break;
		r++;
	}

	cout <<  r << endl;
	*/

	cout << (int)(sqrt(r2) * 2 + 1) << endl;

	return 0;
}
0