結果
問題 | No.662 スロットマシーン |
ユーザー | iwkjosec |
提出日時 | 2018-03-10 00:43:41 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 3,390 bytes |
コンパイル時間 | 1,100 ms |
コンパイル使用メモリ | 108,160 KB |
実行使用メモリ | 20,224 KB |
最終ジャッジ日時 | 2024-10-11 00:02:25 |
合計ジャッジ時間 | 25,562 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1,062 ms
19,584 KB |
testcase_01 | AC | 1,253 ms
19,712 KB |
testcase_02 | AC | 1,078 ms
19,584 KB |
testcase_03 | AC | 1,180 ms
19,584 KB |
testcase_04 | AC | 1,077 ms
19,584 KB |
testcase_05 | AC | 1,219 ms
19,712 KB |
testcase_06 | AC | 1,194 ms
19,584 KB |
testcase_07 | AC | 1,086 ms
19,712 KB |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | AC | 1,055 ms
19,840 KB |
testcase_17 | WA | - |
testcase_18 | WA | - |
コンパイルメッセージ
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 static System.Console; class Program { static void Main() { var s = new string[5]; var v = new int[5]; for (int i = 0; i < 5; i++) { var inp = ReadLine().Split(); s[i] = inp[0]; v[i] = int.Parse(inp[1]); } var reel = new string[3][]; var n = new int[3]; n[0] = int.Parse(ReadLine()); reel[0] = new string[n[0]]; for (int i = 0; i < n[0]; i++) { reel[0][i] = ReadLine(); } n[1] = int.Parse(ReadLine()); reel[1] = new string[n[1]]; for (int i = 0; i < n[1]; i++) { reel[1][i] = ReadLine(); } n[2] = int.Parse(ReadLine()); reel[2] = new string[n[2]]; for (int i = 0; i < n[2]; i++) { reel[2][i] = ReadLine(); } var g = new int[3][] { new int[5], new int[5], new int[5] }; for (int i = 0; i < 3; i++) { for (int j = 0; j < 5; j++) { g[i][j] = reel[i].Count(x => x == s[j]); } } var u = new int[5]; for (int i = 0; i < 5; i++) { u[i] = g[0][i] * g[1][i] * g[2][i] * 5; } var r = new Random(); var rsa = 0L; for (int i = 0; i < 5000000; i++) { var rs = 0; var r0 = r.Next(n[0] ); var r1 = r.Next(n[1] ); var r2 = r.Next(n[2] ); if (reel[0][r0] == reel[1][r1] && reel[0][r0] == reel[2][r2]) { rs += reel[0][r0] == s[0] ? v[0] : reel[0][r0] == s[1] ? v[1] : reel[0][r0] == s[2] ? v[2] : reel[0][r0] == s[3] ? v[3] : reel[0][r0] == s[4] ? v[4] : 0; } if (reel[0][(r0 + 1)%n[0]] == reel[1][(r1 + 1)%n[1]] && reel[0][(r0 + 1)%n[0]] == reel[2][(r2 + 1)%n[2]]) { rs += reel[0][(r0 + 1)%n[0]] == s[0] ? v[0] : reel[0][(r0 + 1)%n[0]] == s[1] ? v[1] : reel[0][(r0 + 1)%n[0]] == s[2] ? v[2] : reel[0][(r0 + 1)%n[0]] == s[3] ? v[3] : reel[0][(r0 + 1)%n[0]] == s[4] ? v[4] : 0; } if (reel[0][(r0 + 2)%n[0]] == reel[1][(r1 + 2)%n[1]] && reel[0][(r0 + 2)%n[0]] == reel[2][(r2 + 2)%n[2]]) { rs += reel[0][(r0 + 2)%n[0]] == s[0] ? v[0] : reel[0][(r0 + 2)%n[0]] == s[1] ? v[1] : reel[0][(r0 + 2)%n[0]] == s[2] ? v[2] : reel[0][(r0 + 2)%n[0]] == s[3] ? v[3] : reel[0][(r0 + 2)%n[0]] == s[4] ? v[4] : 0; } if (reel[0][r0] == reel[1][(r1 + 1)%n[1]] && reel[0][r0] == reel[2][(r2 + 2)%n[2]]) { rs += reel[0][r0] == s[0] ? v[0] : reel[0][r0] == s[1] ? v[1] : reel[0][r0] == s[2] ? v[2] : reel[0][r0] == s[3] ? v[3] : reel[0][r0] == s[4] ? v[4] : 0; } if (reel[0][(r0 + 2)%n[0]] == reel[1][(r1 + 1)%n[1]] && reel[0][(r0 + 2)%n[0]] == reel[2][r2]) { rs += reel[0][(r0 + 2)%n[0]] == s[0] ? v[0] : reel[0][(r0 + 2)%n[0]] == s[1] ? v[1] : reel[0][(r0 + 2)%n[0]] == s[2] ? v[2] : reel[0][(r0 + 2)%n[0]] == s[3] ? v[3] : reel[0][(r0 + 2)%n[0]] == s[4] ? v[4] : 0; } rsa += rs ; } WriteLine($@"{rsa/5000000.0} {u[0]} {u[1]} {u[2]} {u[3]} {u[4]}"); } }