結果

問題 No.1304 あなたは基本が何か知っていますか?私は知っています.
ユーザー tamatotamato
提出日時 2020-12-01 09:02:18
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 654 bytes
コンパイル時間 435 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 406,176 KB
最終ジャッジ日時 2024-06-12 09:44:59
合計ジャッジ時間 6,074 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 6 RE * 1 TLE * 1 -- * 66
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    from collections import deque
    input = sys.stdin.readline

    N, K, x, y = map(int, input().split())
    A = list(map(int, input().split()))
    A = list(set(A))
    K = len(A)

    que = deque()
    for i in range(K):
        que.append([A[i]])
    while len(que[0]) < N:
        B = que.popleft()
        for a in A:
            if a != B[-1]:
                que.append(B[:] + [a])
    ans = 0
    while que:
        B = que.pop()
        z = 0
        for b in B:
            z ^= b
        if x <= z <= y:
            ans += 1
    print(ans)


if __name__ == '__main__':
    main()
0