結果
問題 | No.305 鍵(2) |
ユーザー | nanophoto12 |
提出日時 | 2015-12-06 13:08:18 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 93 ms / 2,000 ms |
コード長 | 1,348 bytes |
コンパイル時間 | 2,358 ms |
コンパイル使用メモリ | 103,812 KB |
実行使用メモリ | 39,076 KB |
平均クエリ数 | 44.46 |
最終ジャッジ日時 | 2023-09-23 22:16:39 |
合計ジャッジ時間 | 4,587 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 93 ms
38,496 KB |
testcase_01 | AC | 91 ms
36,292 KB |
testcase_02 | AC | 88 ms
38,616 KB |
testcase_03 | AC | 89 ms
39,076 KB |
testcase_04 | AC | 89 ms
36,956 KB |
testcase_05 | AC | 90 ms
38,368 KB |
testcase_06 | AC | 79 ms
36,348 KB |
testcase_07 | AC | 89 ms
36,752 KB |
testcase_08 | AC | 90 ms
36,764 KB |
testcase_09 | AC | 89 ms
36,756 KB |
testcase_10 | AC | 90 ms
34,936 KB |
testcase_11 | AC | 90 ms
38,476 KB |
testcase_12 | AC | 90 ms
38,684 KB |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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(currentLine.Split (' ')[0]); if (currentMatched > firstMatched) { maxValue = i; break; } if (currentMatched < firstMatched) { maxValue = 0; break; } if (currentMatched > maxCount) { maxValue = i; maxCount = currentMatched; } } results [9 - digit] = (int)maxValue; } Console.WriteLine (string.Join (string.Empty, results)); if (Console.ReadLine () != "10 unlocked") { throw new Exception(); } } } }