結果

問題 No.130 XOR Minimax
ユーザー NetSeedNetSeed
提出日時 2016-02-06 21:30:51
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 797 bytes
コンパイル時間 962 ms
コンパイル使用メモリ 111,040 KB
実行使用メモリ 50,116 KB
最終ジャッジ日時 2023-10-21 19:33:06
合計ジャッジ時間 5,180 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 36 ms
25,508 KB
testcase_02 AC 35 ms
25,512 KB
testcase_03 AC 35 ms
25,512 KB
testcase_04 AC 207 ms
42,680 KB
testcase_05 AC 240 ms
46,512 KB
testcase_06 AC 221 ms
49,236 KB
testcase_07 WA -
testcase_08 AC 234 ms
50,076 KB
testcase_09 AC 65 ms
27,512 KB
testcase_10 AC 79 ms
28,968 KB
testcase_11 AC 185 ms
41,564 KB
testcase_12 WA -
testcase_13 AC 155 ms
38,776 KB
testcase_14 AC 194 ms
42,888 KB
testcase_15 AC 40 ms
26,000 KB
testcase_16 AC 147 ms
37,836 KB
testcase_17 AC 150 ms
38,348 KB
testcase_18 WA -
testcase_19 AC 183 ms
41,964 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 70 ms
28,252 KB
testcase_23 AC 47 ms
26,964 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.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;


namespace ConsoleApplication2
{
	class Program
	{
		static void Main(string[] args)
		{
#if LOCAL
			Console.SetIn(new StreamReader("test04.txt"));
#endif
			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.Reverse())
			{


				var currentMax = current.Max();

				candidate = current.Select(x => x ^ m).ToArray();
				var candidateMax = candidate.Max();

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

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