結果
| 問題 |
No.24 数当てゲーム
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-01-24 16:32:59 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 998 bytes |
| コンパイル時間 | 1,045 ms |
| コンパイル使用メモリ | 103,808 KB |
| 実行使用メモリ | 17,920 KB |
| 最終ジャッジ日時 | 2024-12-23 07:57:21 |
| 合計ジャッジ時間 | 2,097 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 WA * 5 |
コンパイルメッセージ
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)
{
int n = int.Parse(Console.ReadLine());
int[] b = new int[10];
string ans = "";
for (int i = 0; i < n; i++)
{
string[] s = Console.ReadLine().Split(' ');
if (s[4] == "YES")
{
for (int j = 0; j < 4; j++)
{
if (b[int.Parse(s[j])] == 1)
{
ans = s[j];
}
else
{
b[int.Parse(s[j])] = 1;
}
}
}
else
{
for (int j = 0; j < 4; j++)
{
b[int.Parse(s[j])] = -1;
}
}
}
if (ans == "")
{
ans = Array.IndexOf(b, 0).ToString();
}
Console.WriteLine(ans);
}
}