結果

問題 No.211 素数サイコロと合成数サイコロ (1)
ユーザー FVRChanFVRChan
提出日時 2017-10-03 09:57:15
言語 Java19
(openjdk 21)
結果
AC  
実行時間 130 ms / 1,000 ms
コード長 426 bytes
コンパイル時間 2,966 ms
コンパイル使用メモリ 72,440 KB
実行使用メモリ 56,512 KB
最終ジャッジ日時 2023-09-08 06:23:16
合計ジャッジ時間 8,426 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,536 KB
testcase_01 AC 130 ms
55,700 KB
testcase_02 AC 126 ms
55,968 KB
testcase_03 AC 129 ms
55,984 KB
testcase_04 AC 123 ms
55,536 KB
testcase_05 AC 125 ms
55,532 KB
testcase_06 AC 127 ms
56,140 KB
testcase_07 AC 128 ms
55,816 KB
testcase_08 AC 125 ms
56,072 KB
testcase_09 AC 125 ms
55,648 KB
testcase_10 AC 122 ms
55,776 KB
testcase_11 AC 125 ms
55,904 KB
testcase_12 AC 124 ms
56,180 KB
testcase_13 AC 122 ms
56,004 KB
testcase_14 AC 122 ms
56,388 KB
testcase_15 AC 123 ms
55,912 KB
testcase_16 AC 125 ms
55,512 KB
testcase_17 AC 121 ms
55,972 KB
testcase_18 AC 121 ms
55,764 KB
testcase_19 AC 120 ms
56,068 KB
testcase_20 AC 121 ms
56,228 KB
testcase_21 AC 123 ms
55,688 KB
testcase_22 AC 125 ms
55,808 KB
testcase_23 AC 125 ms
55,912 KB
testcase_24 AC 123 ms
55,676 KB
testcase_25 AC 124 ms
55,780 KB
testcase_26 AC 127 ms
56,512 KB
testcase_27 AC 125 ms
55,552 KB
testcase_28 AC 127 ms
56,116 KB
testcase_29 AC 125 ms
56,220 KB
testcase_30 AC 128 ms
55,904 KB
testcase_31 AC 126 ms
55,680 KB
testcase_32 AC 126 ms
55,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class Main{
	private static Scanner sc=new Scanner(System.in);
	public static void main(String args[])throws Exception{
		int n=sc.nextInt(),all=36,counter=0;
		int p[]={2,3,5,7,11,13};
		int np[]={4,6,8,9,10,12};
		for(int i=0;i<p.length;i++){
			for(int j=0;j<np.length;j++){
				if(p[i]*np[j]==n){
					counter++;
				}
			}
		}System.out.printf("%.18f",(double)(counter*1.0/all*1.0));
	}
}
0