結果

問題 No.305 鍵(2)
ユーザー AreTrashAreTrash
提出日時 2016-09-03 20:03:52
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 806 bytes
コンパイル時間 2,005 ms
コンパイル使用メモリ 104,812 KB
実行使用メモリ 39,000 KB
平均クエリ数 52.15
最終ジャッジ日時 2023-09-24 00:30:30
合計ジャッジ時間 4,016 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
37,004 KB
testcase_01 AC 76 ms
36,828 KB
testcase_02 AC 76 ms
36,564 KB
testcase_03 AC 74 ms
36,468 KB
testcase_04 AC 78 ms
37,256 KB
testcase_05 AC 79 ms
38,904 KB
testcase_06 AC 72 ms
34,264 KB
testcase_07 AC 77 ms
36,756 KB
testcase_08 AC 77 ms
36,636 KB
testcase_09 AC 76 ms
39,000 KB
testcase_10 AC 76 ms
38,916 KB
testcase_11 AC 76 ms
36,612 KB
testcase_12 AC 79 ms
38,940 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace No305{
    public class Program{
        public static void Main(string[] args){
            var res = new int[10];

            Func<int> output = () =>{
                Console.WriteLine(string.Join("", res));
                return int.Parse(Console.ReadLine().Split(' ')[0]);
            };

            for(var i = 0; i < 10; i++){
                var x = output(); if(x == 10) return;

                for(var j = 1; j < 10; j++){
                    res[i] = j;
                    var y = output(); if(y == 10) return;

                    if(y > x){
                        break;
                    }
                    if(y < x){
                        res[i] = 0;
                        break;
                    }
                }
            }
        }
    }
}
0