結果

問題 No.1531 く2
ユーザー convexineqconvexineq
提出日時 2021-06-09 22:19:55
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 579 bytes
コンパイル時間 480 ms
コンパイル使用メモリ 86,924 KB
実行使用メモリ 76,024 KB
最終ジャッジ日時 2023-08-19 08:42:07
合計ジャッジ時間 6,091 ms
ジャッジサーバーID
(参考情報)
judge9 / judge10
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
75,804 KB
testcase_01 AC 75 ms
75,716 KB
testcase_02 AC 74 ms
75,888 KB
testcase_03 AC 73 ms
75,892 KB
testcase_04 AC 74 ms
75,796 KB
testcase_05 AC 73 ms
75,680 KB
testcase_06 AC 73 ms
75,704 KB
testcase_07 AC 73 ms
75,888 KB
testcase_08 AC 74 ms
75,700 KB
testcase_09 AC 73 ms
75,732 KB
testcase_10 AC 74 ms
75,700 KB
testcase_11 AC 73 ms
75,784 KB
testcase_12 AC 73 ms
75,680 KB
testcase_13 AC 73 ms
75,948 KB
testcase_14 AC 72 ms
75,708 KB
testcase_15 AC 75 ms
75,712 KB
testcase_16 AC 74 ms
75,680 KB
testcase_17 AC 73 ms
75,900 KB
testcase_18 AC 74 ms
75,676 KB
testcase_19 AC 75 ms
75,700 KB
testcase_20 AC 74 ms
75,716 KB
testcase_21 AC 75 ms
75,720 KB
testcase_22 AC 76 ms
75,808 KB
testcase_23 AC 74 ms
75,564 KB
testcase_24 AC 73 ms
75,816 KB
testcase_25 AC 74 ms
75,712 KB
testcase_26 AC 72 ms
75,640 KB
testcase_27 AC 72 ms
71,408 KB
testcase_28 AC 73 ms
75,724 KB
testcase_29 AC 77 ms
75,884 KB
testcase_30 AC 74 ms
76,024 KB
testcase_31 AC 75 ms
75,712 KB
testcase_32 AC 74 ms
75,952 KB
testcase_33 AC 73 ms
75,884 KB
testcase_34 AC 72 ms
75,696 KB
testcase_35 AC 72 ms
75,808 KB
testcase_36 AC 75 ms
75,820 KB
testcase_37 AC 75 ms
75,848 KB
testcase_38 AC 73 ms
75,736 KB
testcase_39 AC 74 ms
75,956 KB
testcase_40 AC 73 ms
75,716 KB
testcase_41 AC 75 ms
75,956 KB
testcase_42 AC 75 ms
75,868 KB
testcase_43 AC 72 ms
75,692 KB
testcase_44 AC 74 ms
75,856 KB
testcase_45 AC 75 ms
75,900 KB
testcase_46 AC 73 ms
75,964 KB
testcase_47 AC 72 ms
75,716 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
M = 64
d0 = [0]*M
d1 = [0]*M
d0[0] = 1
for i in range(M):
    if n>>i&1:
        if k>>i&1:
            for i in range(M)[::-1]:
                d1[i] += d1[i-1] + d0[i]
            d0.insert(0,0)
            d0.pop()
        else:
            for i in range(M-1)[::-1]:
                d0[i] += d0[i-1] + d1[i-1]
    else:
        if k>>i&1:
            d0.pop()
            d0.insert(0,0)
        else:
            for i in range(M-1):
                d0[i+1] += d1[i]
            d1 = [0]*M

print(sum(2**i*v for i,v in enumerate(d0))%998244353)
0