結果
| 問題 |
No.172 UFOを捕まえろ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-11-01 23:51:13 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 542 bytes |
| コンパイル時間 | 361 ms |
| コンパイル使用メモリ | 51,708 KB |
| 最終ジャッジ日時 | 2024-11-14 19:23:39 |
| 合計ジャッジ時間 | 964 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:24:16: error: ‘sqrt’ was not declared in this scope
24 | dis = (int)(sqrt((double)2)*r);
| ^~~~
ソースコード
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
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 x,y,r;
int dis;
cin >> x >> y >> r;
if(x < 0) x *= -1;
if(y < 0) y *= -1;
dis = (int)(sqrt((double)2)*r);
if(dis < sqrt( (double)2)*r ) dis++;
cout << dis+x+y << endl;
return 0;
}