結果

問題 No.211 素数サイコロと合成数サイコロ (1)
ユーザー kenji_shioyakenji_shioya
提出日時 2016-06-11 18:15:15
言語 Java19
(openjdk 21)
結果
AC  
実行時間 148 ms / 1,000 ms
コード長 734 bytes
コンパイル時間 3,383 ms
コンパイル使用メモリ 72,388 KB
実行使用メモリ 57,900 KB
最終ジャッジ日時 2023-09-08 05:47:24
合計ジャッジ時間 9,815 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 142 ms
54,544 KB
testcase_01 AC 141 ms
53,876 KB
testcase_02 AC 143 ms
55,976 KB
testcase_03 AC 147 ms
56,056 KB
testcase_04 AC 145 ms
56,148 KB
testcase_05 AC 144 ms
56,048 KB
testcase_06 AC 144 ms
55,892 KB
testcase_07 AC 143 ms
56,040 KB
testcase_08 AC 144 ms
57,900 KB
testcase_09 AC 141 ms
55,924 KB
testcase_10 AC 141 ms
57,884 KB
testcase_11 AC 148 ms
55,948 KB
testcase_12 AC 143 ms
56,056 KB
testcase_13 AC 140 ms
55,976 KB
testcase_14 AC 144 ms
56,204 KB
testcase_15 AC 141 ms
55,764 KB
testcase_16 AC 141 ms
55,980 KB
testcase_17 AC 141 ms
56,220 KB
testcase_18 AC 141 ms
56,392 KB
testcase_19 AC 142 ms
56,144 KB
testcase_20 AC 140 ms
55,968 KB
testcase_21 AC 140 ms
55,888 KB
testcase_22 AC 139 ms
56,412 KB
testcase_23 AC 139 ms
55,732 KB
testcase_24 AC 140 ms
56,260 KB
testcase_25 AC 140 ms
55,936 KB
testcase_26 AC 142 ms
56,004 KB
testcase_27 AC 141 ms
55,904 KB
testcase_28 AC 141 ms
56,068 KB
testcase_29 AC 139 ms
55,752 KB
testcase_30 AC 139 ms
56,348 KB
testcase_31 AC 144 ms
56,260 KB
testcase_32 AC 144 ms
54,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
//import java.text.*;

public class Exercise77{
  public static void main (String[] args){

    //DecimalFormat df = new DecimalFormat("#.############");
    Scanner sc = new Scanner(System.in);

    double n = sc.nextDouble();

    double[] pDice = new double[]{2, 3, 5, 7, 11, 13};
    double[] cDice = new double[]{4, 6, 8, 9, 10, 12};

    double count = 0;

    for (int i = 0; i < pDice.length; i++){
      if (n % pDice[i] != 0){
        continue;
      }
      double devided = n / pDice[i];
      for (int j = 0; j < cDice.length; j++){
        if (devided == cDice[j]){
          count++;
        }else{
        }
      }
    }
    System.out.println(count / (double)(pDice.length * cDice.length));
  }
}
0