結果

問題 No.211 素数サイコロと合成数サイコロ (1)
ユーザー YamaKasa
提出日時 2018-04-27 02:47:17
言語 Java
(openjdk 23)
結果
AC  
実行時間 135 ms / 1,000 ms
コード長 438 bytes
コンパイル時間 2,210 ms
コンパイル使用メモリ 74,120 KB
実行使用メモリ 54,220 KB
最終ジャッジ日時 2024-06-27 21:34:13
合計ジャッジ時間 7,384 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int K = scan.nextInt();
		scan.close();
		int []a = {2, 3, 5, 7, 11, 13};
		int []b = {4, 6, 8, 9, 10, 12};
		int cnt = 0;
		for(int i = 0; i < 6; i++) {
			for(int j = 0; j < 6; j++) {
				if(K == a[i] * b[j]) {
					cnt ++;
				}
			}
		}
		double ans = (double) cnt / 36;
		System.out.println(ans);
	}
}
0