結果

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

コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:24:16: error: ‘hypot’ was not declared in this scope
   24 |    rep = (int)(hypot(a,b)*2);
      |                ^~~~~

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <stack>
using namespace std;

#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
#define SQR(X) ((X)*(X))

typedef long long ll;
typedef unsigned long long ull;
typedef long double lb;
/* ここからが本編 */

int main(void)
{
   int i,j;
   int n;
   double a,b;
   int rep;
   cin >> a >> b;
   rep = (int)(hypot(a,b)*2);
   if(rep <= hypot(a,b)*2 ) rep++;
   cout << rep << endl;
   return 0;
}
0