結果
| 問題 |
No.305 鍵(2)
|
| コンテスト | |
| ユーザー |
mban
|
| 提出日時 | 2017-01-01 23:43:04 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 71 ms / 2,000 ms |
| コード長 | 1,611 bytes |
| コンパイル時間 | 2,659 ms |
| コンパイル使用メモリ | 105,728 KB |
| 実行使用メモリ | 36,056 KB |
| 平均クエリ数 | 51.23 |
| 最終ジャッジ日時 | 2024-07-17 00:43:51 |
| 合計ジャッジ時間 | 4,802 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 |
コンパイルメッセージ
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 void Main()
{
bool[] C = new bool[10];
int[] ans = new int[10];
while (true)
{
Write(ans);
string[] s = Console.ReadLine().Split(' ');
if (s[1] == "unlocked")
{
return;
}
int cnt = int.Parse(s[0]);
int[] copy = ans.ToArray();
for (int i = 0; i < 10; i++)
{
if (C[i])
{
continue;
}
int[] cp;
cp = ans.ToArray();
cp[i]++;
Write(cp);
string[] ss = Console.ReadLine().Split(' ');
if (ss[1] == "unlocked") {
return;
}
int a = int.Parse(ss[0]);
if (cnt > a)
{
C[i] = true;
}
else if (cnt < a)
{
C[i] = true;
copy[i] = cp[i];
}
else
{
copy[i] = cp[i];
}
}
ans = copy.ToArray();
}
}
static void Write(int[] ans)
{
for(int i = 0; i < 10; i++)
{
Console.Write(ans[i]);
}
Console.WriteLine();
}
}
mban