結果
| 問題 |
No.355 数当てゲーム(2)
|
| コンテスト | |
| ユーザー |
AreTrash
|
| 提出日時 | 2016-09-05 09:55:48 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,154 bytes |
| コンパイル時間 | 1,012 ms |
| コンパイル使用メモリ | 106,880 KB |
| 実行使用メモリ | 46,224 KB |
| 平均クエリ数 | 34.54 |
| 最終ジャッジ日時 | 2024-07-16 11:01:03 |
| 合計ジャッジ時間 | 10,987 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 WA * 28 RE * 4 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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 -1;
Console.WriteLine(string.Join(" ", s.ToCharArray()));
return int.Parse(Console.ReadLine().Split(' ')[0]);
};
int[] res;
for(var i = 1234;; i++){
var x = output(i.ToString());
if(x == 4) return;
if(x == 0){
res = i.ToString().Select(c => c - '0').ToArray();
break;
}
}
for(var i = 0; i < 4; i++){
var max = 0;
var t = 0;
for(var j = 0; j < 10; j++){
res[i] = j;
var x = output(string.Join("", res));
if(x == 4) return;
if(x > max){
t = j;
max = x;
}
}
res[i] = t;
}
}
}
}
AreTrash