結果

問題 No.1952 xooooooooooor
ユーザー prussian_coderprussian_coder
提出日時 2022-05-29 20:13:22
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 245 bytes
コンパイル時間 182 ms
コンパイル使用メモリ 81,828 KB
実行使用メモリ 63,888 KB
最終ジャッジ日時 2023-10-21 00:11:45
合計ジャッジ時間 5,542 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

N,K=map(int,input().split())
ans=0
mod=998244353
A=[int(a) for a in bin(N)[2:]][::-1]
M=len(A)
a=0
t=1
for i in range(M+K):
	if i<K:
		if i<M:
			a^=A[i]
	elif i<M:
		a^=A[i]^A[i-K]
	else:
		a^=A[i-K]
	ans+=a*t
	ans%=mod
	t*=2
	t%=mod
print(ans)
0