結果

問題 No.1531 く2
ユーザー convexineqconvexineq
提出日時 2021-06-09 22:11:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 659 bytes
コンパイル時間 585 ms
コンパイル使用メモリ 87,244 KB
実行使用メモリ 76,024 KB
最終ジャッジ日時 2023-08-19 08:34:37
合計ジャッジ時間 7,910 ms
ジャッジサーバーID
(参考情報)
judge9 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
75,636 KB
testcase_01 AC 75 ms
75,668 KB
testcase_02 AC 75 ms
75,604 KB
testcase_03 AC 79 ms
75,628 KB
testcase_04 AC 75 ms
75,784 KB
testcase_05 AC 73 ms
75,592 KB
testcase_06 AC 74 ms
75,684 KB
testcase_07 AC 73 ms
75,760 KB
testcase_08 AC 73 ms
75,640 KB
testcase_09 AC 74 ms
75,780 KB
testcase_10 AC 75 ms
75,804 KB
testcase_11 AC 75 ms
75,740 KB
testcase_12 AC 74 ms
75,732 KB
testcase_13 AC 73 ms
75,704 KB
testcase_14 AC 74 ms
75,648 KB
testcase_15 AC 75 ms
75,612 KB
testcase_16 AC 77 ms
75,744 KB
testcase_17 AC 75 ms
75,688 KB
testcase_18 AC 74 ms
75,772 KB
testcase_19 AC 73 ms
75,644 KB
testcase_20 AC 75 ms
76,004 KB
testcase_21 AC 79 ms
75,920 KB
testcase_22 AC 76 ms
75,800 KB
testcase_23 AC 75 ms
75,596 KB
testcase_24 AC 75 ms
75,676 KB
testcase_25 AC 75 ms
75,712 KB
testcase_26 AC 75 ms
75,772 KB
testcase_27 AC 72 ms
71,400 KB
testcase_28 AC 74 ms
75,764 KB
testcase_29 AC 76 ms
75,856 KB
testcase_30 AC 73 ms
75,608 KB
testcase_31 AC 76 ms
75,748 KB
testcase_32 AC 77 ms
75,912 KB
testcase_33 AC 75 ms
75,636 KB
testcase_34 AC 75 ms
75,744 KB
testcase_35 AC 74 ms
75,772 KB
testcase_36 AC 76 ms
75,820 KB
testcase_37 AC 77 ms
75,788 KB
testcase_38 AC 76 ms
75,760 KB
testcase_39 AC 78 ms
76,024 KB
testcase_40 AC 76 ms
75,644 KB
testcase_41 AC 78 ms
75,912 KB
testcase_42 AC 80 ms
75,896 KB
testcase_43 AC 75 ms
75,692 KB
testcase_44 AC 76 ms
75,892 KB
testcase_45 AC 75 ms
75,620 KB
testcase_46 AC 75 ms
75,768 KB
testcase_47 AC 77 ms
75,920 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:
        nd0 = d0[:]
        nd1 = d1[:]
        if k>>i&1:
            nd0.insert(0,0)
            nd0.pop()
            for i in range(M-1):
                nd1[i+1] += d1[i]
                nd1[i] += d0[i]
        else:
            for i in range(M-1):
                nd0[i+1] += d0[i] + d1[i]
        d0,d1 = nd0,nd1
    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