結果
問題 | No.98 円を描こう |
ユーザー |
|
提出日時 | 2024-02-07 15:47:26 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 980 bytes |
コンパイル時間 | 2,056 ms |
コンパイル使用メモリ | 199,580 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-28 12:31:02 |
合計ジャッジ時間 | 2,780 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 6 |
ソースコード
#include <bits/stdc++.h>using namespace std;#ifdef DEBUG_#include <compe/debug.hpp>#else#define dump(...)#endifusing llint = long long int;#define FastIO cin.tie(nullptr), ios_base::sync_with_stdio(false);#define rep(i, n) for (int i = 0; i < (int)(n); ++i)#define out(msg) cout << (msg) << '\n'#define die(msg) \do { \cout << msg << endl; \exit(0); \} while (0)#define all(k) k.begin(), k.end()#define rall(k) k.rbegin(), k.rend()#define INFi 1 << 30#define INFll 1LL << 60template <typename T> bool chmax(T& a, const T& b) {return ((a < b) ? (a = b, true) : (false));}template <typename T> bool chmin(T& a, const T& b) {return ((a > b) ? (a = b, true) : false);}int main() {FastIO;double x, y;cin >> x >> y;if (x == 0 && y == 0) die(1);double dist = sqrt(pow(x, 2) + pow(y, 2));if ((int)dist == dist) {out((int)dist * 2 + 1);} else {out(ceil(dist * 2));}}