結果
| 問題 |
No.98 円を描こう
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-04-12 02:42:06 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 394 bytes |
| コンパイル時間 | 1,924 ms |
| コンパイル使用メモリ | 192,580 KB |
| 最終ジャッジ日時 | 2025-01-20 16:13:59 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 4 WA * 2 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
bool is_integer(double x){
return floor(x) == x;
}
int main(){
double xp,yp;
cin >> xp >> yp;
double ans = 0;
double dist = sqrt(xp*xp + yp*yp);
if(is_integer(dist)){
ans = dist + 0.5;
}else{
ans = ceil(dist);
}
ans *= 2;
cout << (ll)ans << endl;
}