結果

問題 No.2538 2進元ゲーム
ユーザー 👑 kakel-sankakel-san
提出日時 2024-02-11 00:07:22
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 339 ms / 2,000 ms
コード長 1,251 bytes
コンパイル時間 15,536 ms
コンパイル使用メモリ 158,024 KB
実行使用メモリ 209,764 KB
最終ジャッジ日時 2024-02-11 00:07:52
合計ジャッジ時間 12,872 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
33,060 KB
testcase_01 AC 73 ms
33,060 KB
testcase_02 AC 66 ms
33,060 KB
testcase_03 AC 65 ms
33,060 KB
testcase_04 AC 68 ms
33,060 KB
testcase_05 AC 69 ms
33,060 KB
testcase_06 AC 70 ms
33,060 KB
testcase_07 AC 69 ms
33,060 KB
testcase_08 AC 91 ms
33,060 KB
testcase_09 AC 66 ms
33,060 KB
testcase_10 AC 66 ms
33,060 KB
testcase_11 AC 65 ms
33,060 KB
testcase_12 AC 65 ms
33,060 KB
testcase_13 AC 68 ms
33,060 KB
testcase_14 AC 69 ms
33,060 KB
testcase_15 AC 70 ms
33,060 KB
testcase_16 AC 70 ms
33,060 KB
testcase_17 AC 74 ms
33,060 KB
testcase_18 AC 74 ms
33,060 KB
testcase_19 AC 72 ms
33,060 KB
testcase_20 AC 67 ms
33,060 KB
testcase_21 AC 68 ms
33,060 KB
testcase_22 AC 82 ms
33,060 KB
testcase_23 AC 66 ms
33,060 KB
testcase_24 AC 68 ms
33,060 KB
testcase_25 AC 66 ms
33,060 KB
testcase_26 AC 67 ms
33,060 KB
testcase_27 AC 66 ms
33,060 KB
testcase_28 AC 71 ms
33,060 KB
testcase_29 AC 73 ms
33,828 KB
testcase_30 AC 83 ms
36,388 KB
testcase_31 AC 181 ms
58,912 KB
testcase_32 AC 289 ms
67,172 KB
testcase_33 AC 270 ms
67,208 KB
testcase_34 AC 339 ms
67,208 KB
testcase_35 AC 269 ms
67,208 KB
testcase_36 AC 207 ms
209,764 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (104 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.0/publish/

ソースコード

diff #

using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;

class Program
{
    static int NN => int.Parse(ReadLine());
    static long[] NList => ReadLine().Split().Select(long.Parse).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var g = new int[64];
        for (var i = 0; i < g.Length; ++i)
        {
            var set = new HashSet<int>();
            for (var j = 0; j < 31; ++j)
            {
                if ((i & (1 << j)) != 0) set.Add(g[j]);
            }
            var tmp = 0;
            while (set.Contains(tmp)) ++tmp;
            g[i] = tmp;
        }
        var n = NN;
        var a = NList;
        var x = 0;
        foreach (var ai in a)
        {
            if (ai < 0) x ^= 1024;
            else
            {
                var set = new HashSet<int>();
                for (var j = 0; j < 61; ++j)
                {
                    if ((ai & (1L << j)) != 0) set.Add(g[j]);
                }
                var tmp = 0;
                while (set.Contains(tmp)) ++tmp;
                x ^= tmp;
            }
        }
        WriteLine(x == 0 ? 2 : 1);
    }
}
0