結果

問題 No.305 鍵(2)
ユーザー nanophoto12nanophoto12
提出日時 2015-12-06 12:51:43
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 1,173 bytes
コンパイル時間 3,129 ms
コンパイル使用メモリ 105,280 KB
実行使用メモリ 38,708 KB
平均クエリ数 78.08
最終ジャッジ日時 2023-09-23 08:14:25
合計ジャッジ時間 6,434 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
36,444 KB
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 AC 78 ms
36,912 KB
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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
{
	class MainClass
	{
		private static long MulValue(int d)
		{
			long s = 1L;
			for(int i =0;i < d;i++)
			{
				s *= 10L;
			}
			return s;
		}

		public static void Main (string[] args)
		{
			long output = 0;
			Console.WriteLine (output.ToString ("D10"));
			var line = Console.ReadLine ();
			if (line == "10 unlocked") {
				return;
			}
			var firstMatched = Convert.ToInt32(line.Split (' ')[0]);
			int[] results = new int[10];
			for (int digit = 0; digit < 10; digit++) {
				long mul = MulValue (digit);
				long maxValue = 0;
				int maxCount = firstMatched;
				for (long i = 1; i < 10; i++) {
					long f = i * mul;
					Console.WriteLine (f.ToString ("D10"));
					var currentLine = Console.ReadLine ();
					if (currentLine == "10 unlocked") {
						return;
					}
					var currentMatched = Convert.ToInt32(line.Split (' ')[0]);
					if (currentMatched > maxCount) {
						maxValue = i;
						maxCount = currentMatched;
					}
				}
				results [digit] = (int)maxValue;
			}
			Console.WriteLine (string.Join (string.Empty, results));
			if (Console.ReadLine () != "10 unlocked") {
				throw new Exception();
			}

		}
	}
}
0