結果

問題 No.355 数当てゲーム(2)
ユーザー AreTrashAreTrash
提出日時 2017-01-21 02:07:55
言語 C#(csc)
(csc 3.9.0)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,101 bytes
コンパイル時間 4,127 ms
コンパイル使用メモリ 104,628 KB
実行使用メモリ 42,268 KB
平均クエリ数 31.46
最終ジャッジ日時 2023-09-24 00:51:33
合計ジャッジ時間 11,192 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
41,488 KB
testcase_01 AC 92 ms
40,020 KB
testcase_02 AC 95 ms
42,056 KB
testcase_03 AC 93 ms
41,652 KB
testcase_04 AC 91 ms
40,224 KB
testcase_05 AC 91 ms
39,512 KB
testcase_06 AC 92 ms
39,744 KB
testcase_07 AC 94 ms
41,904 KB
testcase_08 RE -
testcase_09 AC 93 ms
39,548 KB
testcase_10 AC 93 ms
39,616 KB
testcase_11 AC 92 ms
40,192 KB
testcase_12 AC 92 ms
40,104 KB
testcase_13 AC 93 ms
39,644 KB
testcase_14 AC 94 ms
40,156 KB
testcase_15 AC 92 ms
40,116 KB
testcase_16 AC 94 ms
39,504 KB
testcase_17 AC 93 ms
40,012 KB
testcase_18 AC 91 ms
39,816 KB
testcase_19 AC 92 ms
39,540 KB
testcase_20 AC 89 ms
37,840 KB
testcase_21 AC 93 ms
41,588 KB
testcase_22 AC 93 ms
39,504 KB
testcase_23 AC 95 ms
39,508 KB
testcase_24 AC 93 ms
40,128 KB
testcase_25 AC 92 ms
40,088 KB
testcase_26 AC 93 ms
39,844 KB
testcase_27 AC 93 ms
39,756 KB
testcase_28 AC 94 ms
39,984 KB
testcase_29 AC 92 ms
39,612 KB
testcase_30 AC 90 ms
40,012 KB
testcase_31 AC 93 ms
39,464 KB
testcase_32 AC 94 ms
40,064 KB
testcase_33 AC 90 ms
38,076 KB
testcase_34 AC 93 ms
39,864 KB
testcase_35 AC 89 ms
39,896 KB
testcase_36 AC 94 ms
37,480 KB
testcase_37 AC 91 ms
40,044 KB
testcase_38 AC 90 ms
41,488 KB
testcase_39 AC 95 ms
41,488 KB
testcase_40 AC 96 ms
40,008 KB
testcase_41 AC 95 ms
39,896 KB
testcase_42 AC 89 ms
39,352 KB
testcase_43 AC 93 ms
37,560 KB
testcase_44 AC 92 ms
37,888 KB
testcase_45 AC 92 ms
39,632 KB
testcase_46 AC 93 ms
42,084 KB
testcase_47 AC 91 ms
39,788 KB
testcase_48 AC 92 ms
42,012 KB
testcase_49 AC 91 ms
39,636 KB
testcase_50 AC 93 ms
42,268 KB
testcase_51 AC 92 ms
39,532 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