結果

問題 No.130 XOR Minimax
ユーザー NetSeedNetSeed
提出日時 2016-02-06 20:32:39
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 704 bytes
コンパイル時間 2,067 ms
コンパイル使用メモリ 110,764 KB
実行使用メモリ 50,100 KB
最終ジャッジ日時 2023-10-21 19:32:01
合計ジャッジ時間 5,149 ms
ジャッジサーバーID
(参考情報)
judge15 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 32 ms
25,408 KB
testcase_02 AC 32 ms
25,408 KB
testcase_03 AC 32 ms
25,408 KB
testcase_04 AC 185 ms
42,540 KB
testcase_05 AC 218 ms
46,352 KB
testcase_06 AC 195 ms
49,100 KB
testcase_07 WA -
testcase_08 AC 211 ms
49,940 KB
testcase_09 AC 58 ms
27,372 KB
testcase_10 AC 72 ms
28,828 KB
testcase_11 WA -
testcase_12 AC 45 ms
26,880 KB
testcase_13 AC 137 ms
38,636 KB
testcase_14 AC 171 ms
42,748 KB
testcase_15 AC 38 ms
25,864 KB
testcase_16 AC 132 ms
37,696 KB
testcase_17 AC 135 ms
38,208 KB
testcase_18 AC 142 ms
38,980 KB
testcase_19 AC 164 ms
41,824 KB
testcase_20 AC 96 ms
32,000 KB
testcase_21 AC 183 ms
42,576 KB
testcase_22 WA -
testcase_23 AC 41 ms
26,828 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, 32).Select(x => (uint)1 << x).Reverse().ToArray();
			Console.ReadLine();

			var current = Console.ReadLine().Split().Select(x => uint.Parse(x)).ToArray();
			uint[] candidate = new uint[0];



			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