結果
| 問題 |
No.58 イカサマなサイコロ
|
| ユーザー |
No
|
| 提出日時 | 2015-06-07 22:27:52 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,638 bytes |
| コンパイル時間 | 958 ms |
| コンパイル使用メモリ | 111,952 KB |
| 実行使用メモリ | 29,196 KB |
| 最終ジャッジ日時 | 2024-07-06 14:37:13 |
| 合計ジャッジ時間 | 2,077 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 WA * 4 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace foryuki
{
class Program
{
static void Main(string[] args)
{
Random r = new Random();
int N = int.Parse(Console.ReadLine());
int K = int.Parse(Console.ReadLine());
//二郎
double k1;
//太郎
double k2;
double cnt = 0;
for (int i = 0; i < 100000; i++)
{
k1 = 0;
k2 = 0;
for (int j = 0; j < N; j++)
{
k1 += r.Next(1, 7);
if (j < K)
{
k2 += r.Next(4, 7);
}
else
{
k2 += r.Next(1, 7);
}
}
if (k1 < k2)
{
cnt++;
}
}
double ans = cnt / 100000;
Console.WriteLine(ans);
Console.ReadLine();
}
//-------------------------------------------------------------
static int[] ConvertStringArrayToIntArray(string[] str, int defaultValue)
{
int[] b = Array.ConvertAll<string, int>(str, delegate(string value)
{
return int.Parse(value);
});
for (int i = 0; i < b.Length; i++)
{
b[i] = defaultValue;
}
return b;
}
}
}
No