結果
| 問題 |
No.98 円を描こう
|
| コンテスト | |
| ユーザー |
chiyoda
|
| 提出日時 | 2016-06-27 00:45:35 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 273 bytes |
| コンパイル時間 | 429 ms |
| コンパイル使用メモリ | 54,396 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-11 23:26:35 |
| 合計ジャッジ時間 | 961 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 6 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:16:11: warning: ‘res’ may be used uninitialized in this function [-Wmaybe-uninitialized]
16 | cout << res << endl;
| ^~~
ソースコード
#include <iostream>
using namespace std;
int main() {
int x, y;
cin >> x >> y;
int res;
int sqr = x * x + y * y;
for (int i = 0; i < 150000; ++i) {
double tmp = i * i / 4.0;
if (tmp > sqr) {
res = i;
break;
}
}
cout << res << endl;
}
chiyoda