結果
| 問題 |
No.98 円を描こう
|
| コンテスト | |
| ユーザー |
srup٩(๑`н´๑)۶
|
| 提出日時 | 2016-08-08 10:15:50 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 535 bytes |
| コンパイル時間 | 455 ms |
| コンパイル使用メモリ | 58,488 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-07 07:09:04 |
| 合計ジャッジ時間 | 994 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 4 WA * 2 |
ソースコード
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
int main(void){
int x, y; cin >> x >> y;
double d = x * x + y * y;
// cout << d << endl;
int ans;
// cout << sqrt(d) << endl;
if(sqrt(d) == (int)sqrt(d)){
ans = 2 * sqrt(d) + 1;
}else{
int i = 0;
// 少しずと大きくしていく調べていく
while(1){
if(2 * ((int)sqrt(d) + i) > 2 * sqrt(d)){
ans = 2 * ((int)sqrt(d) + i);
break;
}
i++;
}
}
printf("%d\n", ans);
return 0;
}
srup٩(๑`н´๑)۶