結果
| 問題 | 
                            No.98 円を描こう
                             | 
                    
| コンテスト | |
| ユーザー | 
                             takeya_okino
                         | 
                    
| 提出日時 | 2017-07-08 22:45:54 | 
| 言語 | Java  (openjdk 23)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 402 bytes | 
| コンパイル時間 | 1,841 ms | 
| コンパイル使用メモリ | 73,652 KB | 
| 実行使用メモリ | 55,892 KB | 
| 最終ジャッジ日時 | 2024-10-06 20:13:39 | 
| 合計ジャッジ時間 | 3,677 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 WA * 3 | 
| other | AC * 3 WA * 3 | 
ソースコード
import java.util.*;
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int xp = sc.nextInt();
    int yp = sc.nextInt();
    int s = xp * xp + yp * yp;
    int r = (int)Math.sqrt(s);
    int ans = 0;
    for(int i = r; i < r + 3; i++) {
      if(i * i > s) {
        ans = i;
        break; 
      }
    }
    System.out.println(2 * ans);
  }
}
            
            
            
        
            
takeya_okino