結果

問題 No.939 and or
ユーザー titiatitia
提出日時 2019-12-02 02:33:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 566 bytes
コンパイル時間 234 ms
コンパイル使用メモリ 10,856 KB
実行使用メモリ 7,876 KB
最終ジャッジ日時 2023-08-14 08:55:30
合計ジャッジ時間 2,136 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,780 KB
testcase_01 AC 15 ms
7,748 KB
testcase_02 AC 15 ms
7,752 KB
testcase_03 AC 15 ms
7,832 KB
testcase_04 AC 16 ms
7,844 KB
testcase_05 AC 15 ms
7,856 KB
testcase_06 AC 15 ms
7,780 KB
testcase_07 AC 16 ms
7,876 KB
testcase_08 AC 17 ms
7,716 KB
testcase_09 AC 15 ms
7,712 KB
testcase_10 AC 16 ms
7,796 KB
testcase_11 AC 16 ms
7,716 KB
testcase_12 AC 16 ms
7,780 KB
testcase_13 AC 15 ms
7,780 KB
testcase_14 AC 16 ms
7,664 KB
testcase_15 AC 16 ms
7,748 KB
testcase_16 AC 15 ms
7,824 KB
testcase_17 AC 16 ms
7,744 KB
testcase_18 AC 15 ms
7,748 KB
testcase_19 AC 15 ms
7,748 KB
testcase_20 AC 15 ms
7,748 KB
testcase_21 AC 16 ms
7,788 KB
testcase_22 AC 15 ms
7,744 KB
testcase_23 AC 15 ms
7,876 KB
testcase_24 AC 16 ms
7,736 KB
testcase_25 AC 15 ms
7,724 KB
testcase_26 AC 15 ms
7,736 KB
testcase_27 AC 16 ms
7,740 KB
testcase_28 AC 17 ms
7,752 KB
testcase_29 AC 16 ms
7,784 KB
testcase_30 AC 15 ms
7,748 KB
testcase_31 AC 16 ms
7,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

A,B=map(int,input().split())

A0=0
A1=0

for i in range(32):
    if A & (1<<i)==0 and B & (1<<i)!=0:
        A0+=1
    elif A & (1<<i)!=0 and B & (1<<i)==0:
        A1+=1
if A0 and A1:
    print(0)
elif A0==A1==0:
    print(1)
else:    
    N=50
    Combi=[[] for i in range(N+1)]
    Combi[0]=[1,0]

    for i in range(1,N+1):
        Combi[i].append(1)
        for j in range(i):
            Combi[i].append(Combi[i-1][j]+Combi[i-1][j+1])
        Combi[i].append(0)

    A=max(A0,A1)
    ANS=0

    for j in range(A+1):
        ANS+=Combi[A][j]

    print(ANS//2)
0