結果
| 問題 |
No.24 数当てゲーム
|
| コンテスト | |
| ユーザー |
mrc1031
|
| 提出日時 | 2016-10-12 14:11:50 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,339 bytes |
| コンパイル時間 | 811 ms |
| コンパイル使用メモリ | 104,576 KB |
| 実行使用メモリ | 18,944 KB |
| 最終ジャッジ日時 | 2024-11-22 02:39:04 |
| 合計ジャッジ時間 | 1,650 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 WA * 7 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Linq;
class Program
{
static void Main(string[] args)
{
// No.24 数当てゲーム
var answer = new string[10];
for (int i = 1; i <= answer.Length - 1; i++)
answer[i] = i.ToString();
// ターン数
int n = int.Parse(Console.ReadLine());
var r = new string[5];
// ターン数分繰り返し
for (int i = 0; i < n; i++)
{
r = Console.ReadLine().Split(' ');
Array.Sort(r);
if ("NO".Equals(r[4]))
{
for (int j = 0; j < r.Length - 1; j++)
{
answer[int.Parse(r[j])] = null;
}
}
else
{
int idx = 0;
for (int j = 0; j <= answer.Length - 1; j++)
{
if (idx <= r.Length - 1 && r[idx].Equals(answer[j]))
{
idx++;
continue;
}
answer[j] = null;
}
}
}
for (int i = 0; i < answer.Length; i++)
{
if (answer[i] != null)
{
Console.WriteLine(answer[i]);
break;
}
}
}
}
mrc1031