結果

問題 No.355 数当てゲーム(2)
ユーザー AreTrashAreTrash
提出日時 2016-09-05 10:15:10
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 1,095 bytes
コンパイル時間 2,474 ms
コンパイル使用メモリ 108,332 KB
実行使用メモリ 42,432 KB
平均クエリ数 27.67
最終ジャッジ日時 2023-09-23 11:30:09
合計ジャッジ時間 11,836 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 104 ms
41,688 KB
testcase_01 AC 100 ms
40,256 KB
testcase_02 AC 99 ms
40,108 KB
testcase_03 RE -
testcase_04 AC 104 ms
42,160 KB
testcase_05 AC 95 ms
40,044 KB
testcase_06 RE -
testcase_07 AC 103 ms
42,264 KB
testcase_08 AC 101 ms
40,396 KB
testcase_09 AC 102 ms
39,772 KB
testcase_10 AC 103 ms
37,544 KB
testcase_11 AC 101 ms
39,876 KB
testcase_12 AC 100 ms
38,356 KB
testcase_13 AC 101 ms
39,540 KB
testcase_14 AC 100 ms
40,172 KB
testcase_15 AC 101 ms
39,716 KB
testcase_16 AC 100 ms
42,228 KB
testcase_17 AC 102 ms
42,248 KB
testcase_18 RE -
testcase_19 AC 101 ms
41,456 KB
testcase_20 AC 102 ms
42,256 KB
testcase_21 AC 101 ms
37,636 KB
testcase_22 AC 100 ms
38,252 KB
testcase_23 AC 100 ms
40,308 KB
testcase_24 RE -
testcase_25 AC 102 ms
40,000 KB
testcase_26 RE -
testcase_27 AC 100 ms
39,656 KB
testcase_28 RE -
testcase_29 RE -
testcase_30 AC 99 ms
41,980 KB
testcase_31 AC 102 ms
42,136 KB
testcase_32 AC 106 ms
39,688 KB
testcase_33 AC 101 ms
39,948 KB
testcase_34 RE -
testcase_35 AC 99 ms
42,432 KB
testcase_36 AC 102 ms
42,312 KB
testcase_37 AC 99 ms
39,908 KB
testcase_38 AC 100 ms
40,288 KB
testcase_39 AC 101 ms
40,380 KB
testcase_40 AC 100 ms
42,112 KB
testcase_41 AC 100 ms
42,132 KB
testcase_42 AC 99 ms
39,684 KB
testcase_43 AC 99 ms
41,664 KB
testcase_44 AC 99 ms
39,988 KB
testcase_45 AC 101 ms
42,004 KB
testcase_46 RE -
testcase_47 AC 100 ms
39,560 KB
testcase_48 RE -
testcase_49 AC 101 ms
39,744 KB
testcase_50 AC 101 ms
39,660 KB
testcase_51 AC 100 ms
42,008 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;

namespace No355{
    public class Program{
        public static void Main(string[] args){
            Func<string, int[]> output = s =>{
                if(s.Distinct().Count() != s.Length) return new [] {-1, -1};
                Console.WriteLine(string.Join(" ", s.ToCharArray()));
                return Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
            };

            int[] res;
            var random = new Random();
            while(true){
                var i = random.Next(10000);
                var x = output(i.ToString("0000"));
                if(x[0] == 4) return;
                if(x[0] == 0 && x[1] == 0){
                    res = i.ToString().Select(c => c - '0').ToArray();
                    break;
                }
            }
            
            for(var i = 0; i < 4; i++){
                for(var j = 0; j < 10; j++){
                    res[i] = j;
                    var x = output(string.Join("", res));
                    if(x[0] == i + 1) break;
                }
            }
        }
    }
}
0