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