結果
| 問題 |
No.58 イカサマなサイコロ
|
| ユーザー |
mban
|
| 提出日時 | 2017-01-05 14:26:05 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,350 bytes |
| コンパイル時間 | 3,395 ms |
| コンパイル使用メモリ | 110,492 KB |
| 実行使用メモリ | 28,144 KB |
| 最終ジャッジ日時 | 2024-12-16 09:24:50 |
| 合計ジャッジ時間 | 9,900 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 WA * 8 |
コンパイルメッセージ
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;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;
class Magatro
{
static int N, K;
static long[] Tcnt = new long[61], Zcnt = new long[61];
static void Main()
{
N = int.Parse(Console.ReadLine());
K = int.Parse(Console.ReadLine());
calc();
long cnt = 0;
for(int i = 1; i < 60; i++)
{
for(int j = i + 1; j <= 60; j++)
{
cnt += Tcnt[j] * Zcnt[i];
}
}
Console.WriteLine((double)cnt / (Tcnt.Sum() * Zcnt.Sum()));
}
static void calc()
{
int loop =(int) Math.Pow(6, N);
for(int i = 0; i < loop; i++)
{
int c = i;
int T=0, Z = 0;
for(int j = 0; j < N; j++)
{
int d = c % 6;
if (d == 0)
{
d = 6;
}
Z += d;
if (K - 1 > j)
{
T += (3 + (d + 1) / 2);
}
else
{
T += d;
}
c /= 6;
}
Tcnt[T]++;
Zcnt[Z]++;
}
}
}
mban