結果

問題 No.1027 U+1F4A0
ユーザー joybeeee
提出日時 2020-05-13 22:00:52
言語 Java
(openjdk 23)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 421 bytes
コンパイル時間 2,146 ms
コンパイル使用メモリ 73,840 KB
実行使用メモリ 41,712 KB
最終ジャッジ日時 2024-09-14 15:42:00
合計ジャッジ時間 6,258 ms
ジャッジサーバーID
(参考情報)
judge3 / judge6
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Main {

  public static void main(String[] args) { 
      Scanner sc = new Scanner(System.in);
      double D1 = sc.nextInt();
      double D2 = sc.nextInt();
      double d1 = Math.sqrt(D1);
      double d2 = Math.sqrt(D2);

      int res = 0;
      if(D1 == D2 || D1 * 2 == D2) res = 4;
      else if(d1 > Math.sqrt(2) * d2 / 2 && d1 < d2) res = 8;

      System.out.println(res);
  }
}
0