結果

問題 No.1751 Fortune Nim
ユーザー Eki1009Eki1009
提出日時 2021-11-19 23:09:14
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 252 bytes
コンパイル時間 1,018 ms
コンパイル使用メモリ 86,872 KB
実行使用メモリ 110,912 KB
最終ジャッジ日時 2023-08-30 10:17:40
合計ジャッジ時間 6,586 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,024 KB
testcase_01 AC 72 ms
71,020 KB
testcase_02 AC 71 ms
71,132 KB
testcase_03 AC 73 ms
71,220 KB
testcase_04 WA -
testcase_05 AC 72 ms
71,164 KB
testcase_06 AC 73 ms
71,256 KB
testcase_07 AC 73 ms
71,164 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 117 ms
102,060 KB
testcase_17 AC 108 ms
96,156 KB
testcase_18 AC 132 ms
99,584 KB
testcase_19 AC 106 ms
95,796 KB
testcase_20 AC 131 ms
99,920 KB
testcase_21 AC 113 ms
98,760 KB
testcase_22 AC 131 ms
100,228 KB
testcase_23 AC 126 ms
104,308 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 132 ms
100,452 KB
testcase_29 AC 132 ms
100,380 KB
testcase_30 AC 131 ms
100,308 KB
testcase_31 AC 134 ms
100,408 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353
n = int(input())
A = list(map(int,input().split()))
x = 0
for a in A:
    x ^= a
t = sum(A)
for a in A:
    if x^a < a:
        t -= a-(x^a)
        break
if x:
    t += 1
ans = (1-pow(pow(-3,mod-2,mod),t,mod))*(mod+1)//2%mod
print(ans)
0