結果

問題 No.130 XOR Minimax
ユーザー NetSeedNetSeed
提出日時 2016-02-06 20:27:00
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 695 bytes
コンパイル時間 849 ms
コンパイル使用メモリ 110,560 KB
実行使用メモリ 49,984 KB
最終ジャッジ日時 2023-10-21 19:31:42
合計ジャッジ時間 4,578 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 31 ms
25,444 KB
testcase_02 AC 32 ms
25,448 KB
testcase_03 AC 31 ms
25,448 KB
testcase_04 AC 169 ms
42,092 KB
testcase_05 AC 192 ms
46,308 KB
testcase_06 AC 186 ms
49,052 KB
testcase_07 WA -
testcase_08 AC 198 ms
49,888 KB
testcase_09 AC 57 ms
27,264 KB
testcase_10 AC 69 ms
28,688 KB
testcase_11 WA -
testcase_12 AC 46 ms
26,816 KB
testcase_13 AC 130 ms
38,328 KB
testcase_14 AC 164 ms
42,372 KB
testcase_15 AC 38 ms
25,800 KB
testcase_16 AC 125 ms
37,420 KB
testcase_17 AC 128 ms
37,920 KB
testcase_18 AC 134 ms
38,676 KB
testcase_19 AC 155 ms
41,468 KB
testcase_20 AC 92 ms
31,804 KB
testcase_21 AC 162 ms
42,204 KB
testcase_22 WA -
testcase_23 AC 43 ms
26,744 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 = new int[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