結果
問題 | No.2061 XOR Sort |
ユーザー |
![]() |
提出日時 | 2022-08-27 13:14:39 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 749 ms / 2,000 ms |
コード長 | 417 bytes |
コンパイル時間 | 174 ms |
コンパイル使用メモリ | 82,104 KB |
実行使用メモリ | 214,496 KB |
最終ジャッジ日時 | 2024-10-14 11:15:25 |
合計ジャッジ時間 | 10,096 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 41 |
ソースコード
N=int(input())ans=1A=set()I=tuple(set([int(x) for x in input().split()]))A.add(I)mod=998244353for i in reversed(range(30)):B=set()flag=Falsefor La in A:u=set()v=set()for a in La:if (a>>i)&1:u.add(a)else:v.add(a)if len(u)>=1 and len(v)>=1:flag=Trueif len(u)>=2:B.add(tuple(u))if len(v)>=2:B.add(tuple(v))if flag:ans*=2ans%=modA=B.copy()print(ans)