結果

問題 No.1952 xooooooooooor
ユーザー KudeKude
提出日時 2022-05-20 23:35:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 493 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 81,816 KB
実行使用メモリ 53,552 KB
最終ジャッジ日時 2023-10-20 14:32:18
合計ジャッジ時間 2,840 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
53,552 KB
testcase_01 AC 32 ms
53,552 KB
testcase_02 AC 33 ms
53,552 KB
testcase_03 AC 32 ms
53,552 KB
testcase_04 AC 30 ms
53,552 KB
testcase_05 AC 39 ms
53,552 KB
testcase_06 AC 33 ms
53,552 KB
testcase_07 AC 36 ms
53,552 KB
testcase_08 AC 30 ms
53,552 KB
testcase_09 AC 31 ms
53,552 KB
testcase_10 AC 33 ms
53,552 KB
testcase_11 AC 33 ms
53,552 KB
testcase_12 AC 39 ms
53,552 KB
testcase_13 AC 32 ms
53,552 KB
testcase_14 AC 32 ms
53,552 KB
testcase_15 AC 33 ms
53,552 KB
testcase_16 AC 32 ms
53,552 KB
testcase_17 AC 32 ms
53,552 KB
testcase_18 AC 39 ms
53,552 KB
testcase_19 AC 35 ms
53,552 KB
testcase_20 AC 31 ms
53,552 KB
testcase_21 AC 31 ms
53,552 KB
testcase_22 AC 39 ms
53,552 KB
testcase_23 AC 32 ms
53,552 KB
testcase_24 AC 32 ms
53,552 KB
testcase_25 AC 32 ms
53,552 KB
testcase_26 AC 32 ms
53,552 KB
testcase_27 AC 33 ms
53,552 KB
testcase_28 AC 32 ms
53,552 KB
testcase_29 AC 31 ms
53,552 KB
testcase_30 AC 32 ms
53,552 KB
testcase_31 AC 31 ms
53,552 KB
testcase_32 AC 32 ms
53,552 KB
testcase_33 AC 34 ms
53,552 KB
testcase_34 AC 31 ms
53,552 KB
testcase_35 AC 39 ms
53,552 KB
testcase_36 AC 32 ms
53,552 KB
testcase_37 AC 31 ms
53,552 KB
testcase_38 AC 29 ms
53,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
MOD = 998244353
if m <= 33:
    ans = 0
    for i in range(m):
        ans ^= n << i
    print(ans % MOD)
    exit()
d = [n >> i & 1 for i in range(30)]
d2 = [0] * (30 * 2 - 1)
for i in range(30):
    for j in range(30):
        d2[i+j] ^= d[j]
ans = 0
for i in range(30):
    ans |= d2[i] << i
tmp = 0
for i in range(30, 30 * 2 - 1):
    tmp |= d2[i] << (i - 30)
ans += tmp * pow(2, m, MOD)
x = d2[29]
ans += x * (pow(2, m, MOD) - pow(2, 30))
print(ans % MOD)
0