結果
問題 |
No.2061 XOR Sort
|
ユーザー |
|
提出日時 | 2023-10-09 14:24:27 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 787 bytes |
コンパイル時間 | 934 ms |
コンパイル使用メモリ | 108,588 KB |
実行使用メモリ | 47,656 KB |
最終ジャッジ日時 | 2024-07-26 18:32:29 |
合計ジャッジ時間 | 5,618 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 WA * 13 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); public static void Main() { Solve(); } static void Solve() { var n = NN; var a = NList; var ans = 1L; var mod = 998_244_353; for (var i = 0; i < 30; ++i) { var zero = 0; var one = 0; foreach (var ai in a) { if (((ai >> i) & 1) == 0) ++zero; else ++one; } if (zero > 0 && one > 0) ans = ans * 2 % mod; } WriteLine(ans); } }