結果

問題 No.130 XOR Minimax
ユーザー NetSeedNetSeed
提出日時 2016-02-06 20:26:33
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 703 bytes
コンパイル時間 1,195 ms
コンパイル使用メモリ 110,536 KB
実行使用メモリ 49,988 KB
最終ジャッジ日時 2023-10-21 19:31:36
合計ジャッジ時間 5,615 ms
ジャッジサーバーID
(参考情報)
judge11 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 32 ms
25,364 KB
testcase_02 AC 32 ms
25,364 KB
testcase_03 AC 31 ms
25,364 KB
testcase_04 AC 168 ms
41,980 KB
testcase_05 AC 192 ms
46,196 KB
testcase_06 AC 186 ms
48,940 KB
testcase_07 WA -
testcase_08 AC 202 ms
49,776 KB
testcase_09 AC 57 ms
27,152 KB
testcase_10 AC 70 ms
28,576 KB
testcase_11 WA -
testcase_12 AC 46 ms
26,708 KB
testcase_13 AC 133 ms
38,216 KB
testcase_14 AC 165 ms
42,260 KB
testcase_15 AC 38 ms
25,692 KB
testcase_16 AC 125 ms
37,308 KB
testcase_17 AC 128 ms
37,808 KB
testcase_18 AC 136 ms
38,564 KB
testcase_19 AC 157 ms
41,356 KB
testcase_20 AC 93 ms
31,692 KB
testcase_21 AC 162 ms
42,092 KB
testcase_22 WA -
testcase_23 AC 43 ms
26,636 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;

namespace ConsoleApplication2
{
	class Program
	{
		static void Main(string[] args)
		{
			var mask = Enumerable.Range(0, 31).Select(x => 1 << x).Reverse().ToArray();
			Console.ReadLine();

			var current = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
			int[] candidate = Array.Empty<int>();



			foreach (var m in mask)
			{
				var currentMax = current.Max();
				candidate = current.Select(x => x ^ m).ToArray();
				var candidateMax = candidate.Max();

				//current = currentMax > candidateMax ? candidate : current;
				if (currentMax > candidateMax)
				{
					current = candidate;
				}
			}

			Console.WriteLine(current.Max());
		}
	}
}
0