結果

問題 No.355 数当てゲーム(2)
ユーザー AreTrashAreTrash
提出日時 2016-09-05 10:17:50
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 100 ms / 2,000 ms
コード長 1,101 bytes
コンパイル時間 2,112 ms
コンパイル使用メモリ 107,060 KB
実行使用メモリ 42,208 KB
平均クエリ数 29.48
最終ジャッジ日時 2023-09-24 00:31:03
合計ジャッジ時間 9,854 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 100 ms
39,600 KB
testcase_01 AC 95 ms
40,096 KB
testcase_02 AC 95 ms
40,200 KB
testcase_03 AC 94 ms
39,848 KB
testcase_04 AC 94 ms
40,008 KB
testcase_05 AC 99 ms
39,908 KB
testcase_06 AC 98 ms
40,124 KB
testcase_07 AC 97 ms
39,676 KB
testcase_08 AC 95 ms
39,684 KB
testcase_09 AC 96 ms
40,320 KB
testcase_10 AC 96 ms
39,672 KB
testcase_11 AC 95 ms
40,172 KB
testcase_12 AC 95 ms
39,912 KB
testcase_13 AC 95 ms
39,664 KB
testcase_14 AC 97 ms
42,064 KB
testcase_15 AC 95 ms
41,504 KB
testcase_16 AC 97 ms
42,208 KB
testcase_17 AC 97 ms
39,688 KB
testcase_18 AC 97 ms
40,268 KB
testcase_19 AC 94 ms
39,776 KB
testcase_20 AC 95 ms
39,900 KB
testcase_21 AC 95 ms
39,964 KB
testcase_22 AC 94 ms
39,688 KB
testcase_23 AC 92 ms
39,520 KB
testcase_24 AC 95 ms
40,172 KB
testcase_25 AC 95 ms
40,060 KB
testcase_26 AC 100 ms
41,936 KB
testcase_27 AC 98 ms
40,216 KB
testcase_28 AC 99 ms
37,548 KB
testcase_29 AC 99 ms
40,020 KB
testcase_30 AC 99 ms
39,836 KB
testcase_31 AC 98 ms
40,160 KB
testcase_32 AC 97 ms
38,120 KB
testcase_33 AC 97 ms
39,704 KB
testcase_34 AC 98 ms
37,528 KB
testcase_35 AC 97 ms
41,500 KB
testcase_36 AC 97 ms
39,996 KB
testcase_37 AC 98 ms
39,948 KB
testcase_38 AC 97 ms
38,116 KB
testcase_39 AC 98 ms
41,924 KB
testcase_40 AC 96 ms
40,144 KB
testcase_41 AC 97 ms
39,652 KB
testcase_42 AC 98 ms
40,320 KB
testcase_43 AC 97 ms
39,648 KB
testcase_44 AC 94 ms
40,112 KB
testcase_45 AC 95 ms
40,244 KB
testcase_46 AC 95 ms
39,928 KB
testcase_47 AC 97 ms
41,668 KB
testcase_48 AC 93 ms
41,696 KB
testcase_49 AC 94 ms
39,712 KB
testcase_50 AC 99 ms
42,112 KB
testcase_51 AC 92 ms
39,748 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("0000").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