結果

問題 No.1443 Andd
ユーザー mkawa2mkawa2
提出日時 2022-11-02 10:47:22
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 992 bytes
コンパイル時間 365 ms
コンパイル使用メモリ 86,788 KB
実行使用メモリ 250,856 KB
最終ジャッジ日時 2023-09-23 18:02:04
合計ジャッジ時間 17,804 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
71,096 KB
testcase_01 AC 81 ms
71,004 KB
testcase_02 AC 80 ms
71,248 KB
testcase_03 AC 144 ms
80,184 KB
testcase_04 AC 171 ms
82,292 KB
testcase_05 AC 145 ms
79,428 KB
testcase_06 AC 136 ms
78,864 KB
testcase_07 AC 170 ms
81,480 KB
testcase_08 AC 157 ms
79,836 KB
testcase_09 AC 89 ms
75,800 KB
testcase_10 AC 185 ms
82,724 KB
testcase_11 AC 173 ms
81,308 KB
testcase_12 AC 172 ms
81,584 KB
testcase_13 AC 604 ms
119,292 KB
testcase_14 AC 617 ms
119,440 KB
testcase_15 AC 595 ms
119,456 KB
testcase_16 AC 599 ms
118,936 KB
testcase_17 AC 604 ms
119,080 KB
testcase_18 TLE -
testcase_19 TLE -
testcase_20 TLE -
testcase_21 TLE -
testcase_22 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# sys.setrecursionlimit(200005)
int1 = lambda x: int(x)-1
pDB = lambda *x: print(*x, end="\n", file=sys.stderr)
p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr)
def II(): return int(sys.stdin.readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def SI(): return sys.stdin.readline().rstrip()

dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
inf = (1 << 63)-1
# inf = (1 << 31)-1
# md = 10**9+7
md = 998244353

n = II()
aa = LI()

mask = (1 << 10)-1
now = [0]
ans = set([0])
cs = 0
for i, a in enumerate(aa):
    nxt = set()
    cs += a
    for s in now:
        t = s & a
        ans.add(t-cs)
        nxt.add(t)
        nxt.add((s+a) & mask)
    now = nxt
    print(len(ans))
0