結果
| 問題 | No.98 円を描こう |
| コンテスト | |
| ユーザー |
kichirb3
|
| 提出日時 | 2018-03-05 23:32:12 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 5,000 ms |
| + 674µs | |
| コード長 | 522 bytes |
| 記録 | |
| コンパイル時間 | 345 ms |
| コンパイル使用メモリ | 80,768 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-08-26 10:37:46 |
| 合計ジャッジ時間 | 1,304 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 6 |
ソースコード
// No.98 円を描こう
// https://yukicoder.me/problems/no/98
//
#include <iostream>
#include <cmath>
using namespace std;
int solve(int xp, int yp);
int main() {
std::cin.tie(nullptr);
std::ios::sync_with_stdio(false);
int xp, yp;
cin >> xp >> yp;
int ans = solve(xp, yp);
cout << ans << endl;
}
int solve(int xp, int yp) {
double r = sqrt(xp*xp + yp*yp);
double d = r * 2;
int ans = ceil(d);
if (pow((ans/2), 2) == pow(xp, 2) + pow(yp, 2))
++ans;
return ans;
}
kichirb3