結果

問題 No.939 and or
ユーザー titiatitia
提出日時 2019-12-02 02:31:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 536 bytes
コンパイル時間 245 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-05-01 21:26:30
合計ジャッジ時間 2,260 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,880 KB
testcase_01 AC 26 ms
10,752 KB
testcase_02 AC 26 ms
10,752 KB
testcase_03 AC 27 ms
10,752 KB
testcase_04 AC 28 ms
10,752 KB
testcase_05 WA -
testcase_06 AC 27 ms
10,752 KB
testcase_07 AC 25 ms
10,752 KB
testcase_08 AC 26 ms
10,752 KB
testcase_09 AC 25 ms
10,752 KB
testcase_10 AC 26 ms
10,752 KB
testcase_11 AC 26 ms
10,752 KB
testcase_12 AC 26 ms
10,752 KB
testcase_13 WA -
testcase_14 AC 28 ms
10,624 KB
testcase_15 AC 26 ms
10,752 KB
testcase_16 AC 28 ms
10,752 KB
testcase_17 AC 28 ms
10,752 KB
testcase_18 AC 26 ms
10,880 KB
testcase_19 AC 26 ms
10,752 KB
testcase_20 WA -
testcase_21 AC 26 ms
10,752 KB
testcase_22 AC 25 ms
10,752 KB
testcase_23 AC 25 ms
10,752 KB
testcase_24 AC 28 ms
10,752 KB
testcase_25 AC 26 ms
10,752 KB
testcase_26 AC 26 ms
10,624 KB
testcase_27 AC 26 ms
10,752 KB
testcase_28 AC 27 ms
10,752 KB
testcase_29 WA -
testcase_30 AC 26 ms
10,880 KB
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

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)
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