結果
| 問題 |
No.305 鍵(2)
|
| コンテスト | |
| ユーザー |
nanophoto12
|
| 提出日時 | 2015-12-06 12:51:43 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,173 bytes |
| コンパイル時間 | 1,016 ms |
| コンパイル使用メモリ | 112,592 KB |
| 実行使用メモリ | 42,780 KB |
| 平均クエリ数 | 78.08 |
| 最終ジャッジ日時 | 2024-07-16 08:03:25 |
| 合計ジャッジ時間 | 4,187 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 RE * 11 |
コンパイルメッセージ
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(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();
}
}
}
}
nanophoto12