結果
| 問題 | No.58 イカサマなサイコロ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2014-11-23 23:07:18 |
| 言語 | Java (openjdk 27 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1,055 ms / 5,000 ms |
| + 986µs | |
| コード長 | 568 bytes |
| 記録 | |
| コンパイル時間 | 2,232 ms |
| コンパイル使用メモリ | 86,340 KB |
| 実行使用メモリ | 47,708 KB |
| 最終ジャッジ日時 | 2026-10-10 08:28:59 |
| 合計ジャッジ時間 | 9,313 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
import java.util.Scanner;
public class Yukicoder58 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int K = sc.nextInt();
int taro = 0, jiro = 0;
int taroWin = 0;
for (int i = 0; i < 2000000; i++) {
taro = 0;
jiro = 0;
for (int j = 0; j < N; j++) {
taro += j < K ? (int) (Math.random() * 3 + 4) : (int) (Math.random() * 6 + 1);
jiro += (int) (Math.random() * 6 + 1);
}
if (taro > jiro) taroWin++;
}
System.out.println(taroWin / 2000000.0);
}
}