結果
| 問題 |
No.24 数当てゲーム
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-08-08 01:27:03 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 27 ms / 5,000 ms |
| コード長 | 1,112 bytes |
| コンパイル時間 | 889 ms |
| コンパイル使用メモリ | 104,960 KB |
| 実行使用メモリ | 18,816 KB |
| 最終ジャッジ日時 | 2024-10-11 22:41:06 |
| 合計ジャッジ時間 | 1,746 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
コンパイルメッセージ
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.Collections;
class Program {
static void Main(string[] args) {
int n = int.Parse(Console.ReadLine());
List<string[]> ios = new List<string[]>();
BitArray rts = new BitArray(n);
for (int i = 0; i < n; i++) {
string read = Console.ReadLine();
string rt = read.Substring(8);
string inStr = read.Substring(0, 7);
string[] ins = inStr.Split(' ');
ios.Add(ins);
rts[i] = rt == "YES";
}
for (int ans = 0; ans < 10; ans++) {
bool success = true;
for (int j = 0; j < n; j++) {
if (ios[j].Contains(ans.ToString()) != rts[j]) {
success = false;
break;
}
}
if (success) {
Console.WriteLine(ans);
return;
}
}
}
}