problem_id stringlengths 6 6 | user_id stringlengths 10 10 | time_limit float64 1k 8k | memory_limit float64 262k 1.05M | problem_description stringlengths 48 1.55k | codes stringlengths 35 98.9k | status stringlengths 28 1.7k | submission_ids stringlengths 28 1.41k | memories stringlengths 13 808 | cpu_times stringlengths 11 610 | code_sizes stringlengths 7 505 |
|---|---|---|---|---|---|---|---|---|---|---|
p03031 | u455354923 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['N,M=map(int,input().split())\nls=[]\ncnt,cnt2,ans=0,0,0\nfor i in range(M):\n ls1=list(map(int,input().split()))\n ls.append(list(ls1))\n ls1.clear()\nlsp = list(map(int,input().split()))\n#print(ls)\n#print(lsp)\nfor i in range(2**N):\n flg = True\n for j in range(M):\n cnt = 0\n for k i... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s354188701', 's694199001', 's300762245'] | [9204.0, 9004.0, 9212.0] | [48.0, 23.0, 53.0] | [478, 435, 480] |
p03031 | u455629561 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['N, M = map(int, input().split())\nS = []\nfor m in range(M):\n s = list(map(int, input().split()))\n S.append(s[1:])\nP = list(map(int, input().split()))\n\nans = 0\nfor c in product([0, 1], repeat=N):\n ok = True\n for m in range(M):\n sm = 0\n for s in S[m]:\n sm += c[s - 1]\n ... | ['Runtime Error', 'Accepted'] | ['s154090495', 's994446314'] | [3064.0, 3064.0] | [18.0, 27.0] | [408, 438] |
p03031 | u463655976 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['from collections import deque, _heapq\nN, K = map(int, input().split())\nV = deque(map(int, input().split()))\n\nclass Money:\n def __init__(self):\n self.yen = 0\n self.red = []\n\n def value(self):\n return self.yen + sum(self.red)\n\n def add(self, yen):\n if yen >= 0:\n ... | ['Wrong Answer', 'Accepted'] | ['s246016039', 's549110630'] | [3316.0, 3064.0] | [21.0, 35.0] | [1373, 501] |
p03031 | u472696272 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['n,m = map(int,input().split())\ns = []\nfor i in range(m):\n ks = list(map(int,input().split()))\n s.append(ks)\np = list(map(int,input().split()))\nans = 0\nfor i in range(2**n):\n flag = True\n for j in range(m):\n count = 0\n for k in range(s[m][0]):\n if i & (1<<(s[m][k+1]-1)): count += 1\n if c... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s221189078', 's688660302', 's056924299'] | [3064.0, 3064.0, 3064.0] | [17.0, 18.0, 47.0] | [369, 369, 368] |
p03031 | u484229314 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ["N, M = [int(v) for v in input().split()]\n\nS = []\nfor i in range(M):\n S.append(set([int(v) for v in input().split()][1:]))\nP = [int(v) for v in input().split()]\n\nlimit = int('1' * N, 2)\nres = 0\nfor j in range(limit + 1):\n on_idx = set()\n for ki, k in enumerate(list(('{:0' + str(N) + 'b}').format(j)... | ['Wrong Answer', 'Accepted'] | ['s116592494', 's937527248'] | [3064.0, 3188.0] | [30.0, 32.0] | [504, 600] |
p03031 | u490045217 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['N, M = map(int,input().split())\neach_s = []\nfor _ in range(M):\n each_s.append(list(map(int,input().split()))[1:])\np = list(map(int,input().split()))\nprint(each_s)\nprint(p)\n\nswitch = 2**N\nanswer = 0\n\nfor i in range(switch):\n lamp = []\n for j in range(len(each_s)):\n count = 0\n for k in each_s[j]... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s811790228', 's927668681', 's981947514', 's081986209'] | [3064.0, 3188.0, 3064.0, 3064.0] | [53.0, 39.0, 55.0, 37.0] | [428, 445, 405, 432] |
p03031 | u490489966 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['#C\nn, m = map(int, input().split())\nk = [] * m\ns = [] * m\np = [] * m\nfor i in range(m):\n ks = list(map(int, input().split()))\n k.append(ks[0])\n s.append(ks[1:])\np = list(map(int, input().split()))\n\n# print(k, s, p)\nfor i in range(2 ** n):\n on = True\n for j in range(m):\n light = 0\... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s294341401', 's340701008', 's646908330', 's316274142'] | [3064.0, 3064.0, 3064.0, 3064.0] | [18.0, 33.0, 17.0, 34.0] | [489, 494, 487, 498] |
p03031 | u492447501 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['N, M = map(int, input().split())\n\nl = []\n\nfor _ in range(M):\n k, *s = map(int, input().split())\n l.append(s)\n\n*P, = map(int, input().split())\ncount = 0\nfor i in range(2**N):\n switch = ["on"] * N\n m = [False]*M\n for j in range(N):\n if (i>>j) & 1:\n switch[j] = "off"\n\n ... | ['Wrong Answer', 'Accepted'] | ['s623819772', 's171334627'] | [3824.0, 3064.0] | [256.0, 57.0] | [1018, 664] |
p03031 | u494058663 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['S = []\nN,M = map(int,input().split())\nfor i in range(M):\n tmp = [int(i) for i in input().split()]\n K.append(tmp[0])\n tmp.pop(0)\n S.append(tmp)\nP = [int(i) for i in input().split()]\nList = []\nfor i in range(2**N):\n tmp = []\n for j in range(N):\n if ((i>>j) & 1):\n tmp.app... | ['Runtime Error', 'Accepted'] | ['s971499255', 's870294526'] | [3064.0, 9196.0] | [17.0, 48.0] | [903, 711] |
p03031 | u495903598 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\nimport sys\nimport numpy as np\nimport itertools\ninput = sys.stdin.readline\nN, M = map(int, input().split())\nl = [list(map(int, input().split())) for i in range(M+1)]\n\n\n# In[ ]:\n\n\n"""\n5 2\n3 1 2 5\n2 2 3\n1 0\n"""\n\n\n# In[4]:\n\n\n#print(l)\nimport n... | ['Runtime Error', 'Accepted'] | ['s832505214', 's580861867'] | [12504.0, 3064.0] | [260.0, 33.0] | [1086, 1444] |
p03031 | u498136917 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['n, m = map(int, input().split())\nq = list()\nfor i in range(m):\n q.append(list(map(int, input().split())))\np = list(map(int, input().split()))\n\nans = 0\n\nfor s in range(2**n):\n judge = True\n for i in range(m):\n cnt = 0\n for j in range(1, len(q[i]):\n w = q[i][j]\n ... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s179487392', 's684862477', 's764681155', 's738968591'] | [9024.0, 9036.0, 9052.0, 9156.0] | [26.0, 41.0, 51.0, 52.0] | [449, 448, 448, 450] |
p03031 | u501952592 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['N, M = map(int, input().split())\nS_lists = [list(map(int, input().split()))[1:] for _ in range(M)]\nP = map(int, input().split())\ncount = 0\nfor n in range(2**N):\n l = 1\n for p, S in zip(P, S_lists):\n l *= (sum([int(bin(n)[2:].zfill(N)[s-1]) for s in S]) % 2 == p)\n count += l\nprint(count)', 'import num... | ['Wrong Answer', 'Accepted'] | ['s657447127', 's613726535'] | [3064.0, 27316.0] | [18.0, 167.0] | [295, 301] |
p03031 | u503228842 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['N, M = map(int,input().split())\nconnections=[]\nfor _ in range(M):\n connections.append(list(map(int,input().split())))\nconditions = list(map(int,input.split()))\n\nans_cnt = 0\nfor i in range(2**N):\n condition_cnt = 0\n for j in range(M):\n\n cnt=0\n for k in connections[j][1:]:\n ... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s096358155', 's501762895', 's630637554', 's860408789', 's551263190'] | [3064.0, 2940.0, 3064.0, 3064.0, 3064.0] | [17.0, 17.0, 38.0, 41.0, 57.0] | [484, 485, 481, 486, 561] |
p03031 | u508164527 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['N,M = (int(x) for x in input().split())\na = [0]*N \nk = []\nans = 0\nfor i in range(M):\n k = [int(x) for x in input().split()]\n for j in range(k[0]): \n s = k[j+1]-1\n# print(i,j,s,a[s],a)\n a[s] = a[s] | (1<<i) \n\n \np = [int(x) for x in input().split()]\nP = 0\nfor i in range(M):\n P |= p[i] << ... | ['Runtime Error', 'Accepted'] | ['s268849806', 's380778293'] | [3064.0, 3064.0] | [17.0, 20.0] | [1242, 1226] |
p03031 | u514118270 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['from collections import deque\nN,K = list(map(int,input().split()))\nK = deque()\nfor i in range(M):\n A = deque(map(int,input().split()))\n K.append(A[0])\n A.popleft()\np = list(map(int,input().split()))\nans = 0\nfor i in range(1 << N):\n f = True\n for j in range(M):\n s = 0\n for k i... | ['Runtime Error', 'Accepted'] | ['s206080134', 's333439038'] | [3316.0, 3316.0] | [21.0, 47.0] | [439, 413] |
p03031 | u515172797 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['n,m = map(int,input().split())\ns = []\nk = []\np = []\nfor i in range(m):\n q = input().split()\n k.append(int(q[0]))\n q.remove(q[0])\n s.append(q)\n #print(q)\n for j in range(k[i]):\n s[i][j] = int(q[j])\n #print(s)\n \nq = input().split()\nfor j in range(m):\n p.append(i... | ['Wrong Answer', 'Accepted'] | ['s205012803', 's246018000'] | [3064.0, 3064.0] | [56.0, 35.0] | [628, 851] |
p03031 | u529012223 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['for x in range(2 ** N + 1):\n# print("===========", x, ans)\n for m in range(M):\n c = 0\n for k in range(1, ks_list[m][0]+1):\n ks_mk = -ks_list[m][k]\n if int(format(x,\'b\').zfill(10)[ks_mk]) == 1:\n c += 1\n# print(ks_list, ks_list[m][k], ks_mk... | ['Runtime Error', 'Accepted'] | ['s248948512', 's770044801'] | [3060.0, 20744.0] | [17.0, 420.0] | [550, 746] |
p03031 | u530786533 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['n, m = map(int, input().split())\nlamps = [list(map(lambda x:int(x)-1, input().split()))[1:] for _ in range(m)]\np = [int(i) for i in range(m)]\nans = 0\n\nfor i in range(1 << n):\n for r in range(m):\n on_sum = 0\n for j in range(n):\n if i >> j & 1 and j in lamps[r]:\n on_sum += 1\n ... | ['Wrong Answer', 'Accepted'] | ['s062753705', 's263247226'] | [3064.0, 12448.0] | [23.0, 342.0] | [395, 321] |
p03031 | u536325690 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['import itertools\n\nN, M = map(int, input().split())\nk = []\nfor i in range(N):\n tmp = map(int, input().split())\n k.append(tmp)\n\np = input().split()\n\nonoff = [0, 1]\nkouho = list(itertools.product(onoff, repeat=N))\n\nans = 0\nfor li in kouho:\n for i in range(N):\n if p[i] == 0:\n l... | ['Runtime Error', 'Accepted'] | ['s672043237', 's406380709'] | [3188.0, 3188.0] | [18.0, 32.0] | [426, 533] |
p03031 | u539517139 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['n,m=map(int,input().split())\nb=[0]*m\nfor i in range(m):\n a=list(map(int,input().split()))\n b[i]=a\np=list(map(int,input().split()))\nz=0\nfor i in range(0,2**n): \n sl=[int(x) for x in list(str(bin(i+2**n)[2:]))]\n flag=0\n for j in range(m):\n s=0\n for l in range(1,b[j][0]):\n s=s+sl[b[j][l]]\n... | ['Wrong Answer', 'Accepted'] | ['s228067575', 's217275646'] | [3064.0, 3064.0] | [45.0, 45.0] | [367, 332] |
p03031 | u544034775 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['n, m = (int(_) for _ in input().split()) \nskp = [[int(i) for i in input().split()] for i in range(m+1)]\nsk, p = skp[:-1], skp[-1]\n\ndef judge(sw_status, sk, p):\n sk = np.array(sk) - 1\n num = sw_status[sk[1:]].sum()%2\n if num == p:\n light = 1\n else:\n light = 0\n return light\n\n\nans = 0\nfor i in... | ['Runtime Error', 'Accepted'] | ['s186093273', 's630268687'] | [3064.0, 14188.0] | [17.0, 284.0] | [519, 582] |
p03031 | u546104065 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['s = []\nfor i in range(m):\n st = list(map(int, input().split()))\n s.append(st[1 :])\n p = list(map(int, input().split()))\n\n ans = 0\n \n for i in range(1 << n):\n al = True\n \n v = [bool(i & (1 << x)) for x in range(n)]\n \n for j in range(m):\n \n num = 0\n \n for t in s... | ['Runtime Error', 'Accepted'] | ['s872516051', 's106608899'] | [3064.0, 3064.0] | [17.0, 39.0] | [543, 567] |
p03031 | u547167033 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['n,m=map(int,input().split())\nk=[0]*m\ns=[set() for i in range(m)]\nfor i in range(m):\n k[i],*t=map(int,input().split())\n for j in range(k[i]):\n s[i].add(t[j])\nans=0\np=list(map(int,input().split()))\nfor i in range(2**n):\n switch=[0]*n\n flag=True\n for j in range(n):\n if i>>j&1:\n switch[j]=1\... | ['Wrong Answer', 'Accepted'] | ['s620702616', 's936593263'] | [3064.0, 3064.0] | [31.0, 32.0] | [500, 502] |
p03031 | u550294762 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['def gen_switch(i, n):\n ret = []\n str_bin = format(i, \'011b\')\n for k in range(n):\n ret.append(int(str_bin[-k-1]))\n ret.reverse()\n return ret\n\n\ninput_line = raw_input()\nsplitted_line = input_line.split(" ")\nn = int(splitted_line[0])\nm = int(splitted_line[1])\n\n\nmy_mtx = []\n\nfor i... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s490752301', 's531967663', 's652459658', 's094040722'] | [3064.0, 3064.0, 3064.0, 3064.0] | [18.0, 18.0, 17.0, 39.0] | [978, 1183, 978, 1172] |
p03031 | u554954744 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ["N,M=map(int,input().split())\nl=[]\nfor i in range(M):\n *a,=map(int,input().split())\n l.append(a[1:])\n*p,=map(int,input().split())\n\nans=0\nfor t in range(2**N):\n tmp=[(t>>s)&1 for s in range(N)]\n light=True\n for i in range(M):\n cnt=0\n for j in range(len(l[i])):\n if t... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s465310293', 's688640467', 's232998118'] | [3064.0, 3744.0, 3064.0] | [42.0, 84.0, 47.0] | [467, 479, 437] |
p03031 | u556070294 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['import itertools\n\nswitch, light = map(int, input().split())\nksm = []\nfor i in range(1, light+1):\n ks = input().split()\n ksm.append(ks)\n\npm = input().split()\n\nans = 0\nfor i in itertools.product([0, 1], repeat=switch):\n isOk = True\n for li in range(light):\n p = pm[li]\n ks = ksm[... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s568842525', 's804803294', 's764481286'] | [3064.0, 3188.0, 3064.0] | [63.0, 53.0, 44.0] | [513, 613, 557] |
p03031 | u556225812 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ["N, M = map(int, input().split())\ns = []\nfor i in range(M):\n s.append(list(map(int, input().split())))\np = list(map(int, input().split()))\n\nswitch = [['0'], ['1']]\n\nfor i in range(n-1):\n tmp = []\n for j in switch:\n tmp.append(j+['0'])\n tmp.append(j+['1'])\n switch = tmp\u3000\n\na... | ['Runtime Error', 'Accepted'] | ['s198217438', 's846146606'] | [3064.0, 3316.0] | [19.0, 46.0] | [748, 730] |
p03031 | u557282438 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['N,M = map(int,input().split())\nks = [list(map(int, input().split()))for i in range(M)]\np = list(map(int, input().split()))\ncnt = 0\nall_on = 1\nans = 0\nfor i in range(2**N):\n all_on = 1\n bits = "0" + str(N) + "b" \n sw_line = str(format(i,bits))\n for j in range(M):\n for k in range(1,ks[j][0... | ['Wrong Answer', 'Accepted'] | ['s273551503', 's878845578'] | [3064.0, 3188.0] | [51.0, 50.0] | [501, 517] |
p03031 | u557494880 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['N,M = map(int,input())\nS = []\nK = []\nfor i in range(M):\n s = list(map(int,input().split()))\n k = s.pop(0)\n S.append(s)\n K.append(k)\nP = list(map(int,input().split()))\nfor i in range(2**N):\n sw = [0]*N\n for j in range(N):\n if (i>>j)&1:\n sw[j] = 1\n flag = 1\n for ... | ['Runtime Error', 'Accepted'] | ['s265429500', 's790851480'] | [3064.0, 3064.0] | [17.0, 41.0] | [539, 555] |
p03031 | u559250296 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['import itertools\ncount =0\nans=0\nn,m = map(int,input().split())\npattern = list(itertools.permutations(range(2), n))\n#pattern.append([0]*m)\n#pattern.append([1]*m)\n\nlists =[]\nswitches = [1]*n\nonoff = [0]*m\nfor i in range(m):\n lists.append(list(map(int,input().split())))\nkey_value = list(map(int,input().s... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s143485210', 's731124671', 's912490957', 's963270542', 's430590640'] | [9236.0, 9204.0, 9184.0, 9212.0, 9208.0] | [30.0, 31.0, 29.0, 32.0, 33.0] | [657, 635, 635, 655, 611] |
p03031 | u573272932 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['N, M = map(int, input().split())\nK, S = [], []\nfor _ in range(M):\n\tk, *s = map(int, input().split())\n\tK.append(k)\n\tS.append(list(map(lambda x: x-1, s)))\np = list(map(int, input().split()))\nres = 0\nfor i in range(1<<N):\n\tflag = True\n\tfor j in range(M):\n\t\tcnt = 0\n\t\tfor k in S[j]:\n\t\t\tif (i >> k)... | ['Wrong Answer', 'Accepted'] | ['s456056392', 's678928855'] | [4036.0, 3064.0] | [114.0, 36.0] | [404, 382] |
p03031 | u583285098 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['n, m = map(int, input().split())\nk = [list(map(int, input().split())) for _ in range(m)]\np = list(map(int, input().split()))\n\nans = 0\nfor i in range(2**n):\n light = 0\n for ki, j in enumerate(k):\n switch = 0\n for s in j[1:]:\n if i & (1 << s):\n switch += 1\n ... | ['Wrong Answer', 'Accepted'] | ['s996825623', 's402553629'] | [9168.0, 9112.0] | [45.0, 46.0] | [403, 405] |
p03031 | u593567568 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['N,M = map(int,input().split())\nKS = [[int(x) for x in input().split()] for _ in range(M)]\nP = list(map(int,input().split()))\n\nbit = (2 << N) - 1\ncnt = 0\n\nfor i in range(bit):\n switch = [0] * N\n for j in range(N):\n isOn = (i >> j) & 1\n switch[j] = isOn\n\n ok = True\n for k in range(M):\n t = K... | ['Wrong Answer', 'Accepted'] | ['s361435480', 's834470053'] | [3064.0, 3064.0] | [31.0, 29.0] | [445, 723] |
p03031 | u595289165 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['n, m = map(int, input().split())\nlight = [\n tuple(map(int, input().split())) for i in range(m)\n]\nlight = sorted(light, key=lambda x: x[0])\np = tuple(map(int, input().split()))\n\nans = 0\nfor i in range(2**n+1):\n x = str(bin(i))[2:]\n if len(x) < n:\n x = "0" * (n - len(x)) + x\n a = 1\n f... | ['Wrong Answer', 'Accepted'] | ['s598625071', 's207588646'] | [3064.0, 3064.0] | [30.0, 27.0] | [564, 489] |
p03031 | u597455618 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['import sys\ndef dfs(A):\n global cnt\n\n if len(A) == n:\n ans = [0 for i in range(m)]\n print(A)\n for i, a in enumerate(A):\n if a:\n for j in range(m):\n if i+1 in s[j]:\n ans[j] += 1\n print(ans)\n for x, ... | ['Runtime Error', 'Accepted'] | ['s388386481', 's049143994'] | [9184.0, 9152.0] | [27.0, 39.0] | [658, 641] |
p03031 | u604839890 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['n,m = map(int,input().split())\n\nklist = []\nslist = [list() for _ in range(m)]\n\nfor i in range(m):\n k,*s = map(int,input().split())\n klist.append(k)\n slist[i] = s\n\np = list(map(int,input().split()))\n\nans = 0\nfor i in range(2**n):\n for j in range(m):\n cnt = 0\n for l in slist[j]... | ['Wrong Answer', 'Accepted'] | ['s065671797', 's932339478'] | [9080.0, 9164.0] | [38.0, 40.0] | [455, 427] |
p03031 | u605402887 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['n,m=map(int,input().split())\ns=[list(map(int,input().split())) for i in range(m)]\np=list(map(int,input().split()))\nans = 0\n\nfor i in range(2**n):\n ans += 1\n for j in range(len(s)):\n on = 0\n for k in range(s[j][0]):\n on += ((i>>s[j][k+1])%2)\n if(on%2 != p[j]):\n ans -= 1\n break\n ... | ['Wrong Answer', 'Accepted'] | ['s885106527', 's535875821'] | [3064.0, 3064.0] | [35.0, 36.0] | [320, 324] |
p03031 | u610956125 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['N, M = map(int, input().split())\nlist_Connect=[]\nfor i in range(M):\n A = list(map(int, input().split()))\n A.pop(0)\n list_Connect.append( A )\n\nlist_p = list(map(int, input().split()))\n\nprint ("list_Connect",list_Connect)\nprint("list_p",list_p)\ni = 0\n\n\n\nstate = []\nsum=0\n\ndef func(i):\n glo... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s406462368', 's694782242', 's759624068'] | [3188.0, 3192.0, 3064.0] | [28.0, 24.0, 23.0] | [872, 720, 754] |
p03031 | u611562941 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ["n,m = map(int,input().split()) \ns = []\nswi = []\n\nfor i in range(m):\n x = list(map(int,input().split()))\n s.append(x)\np = list(map(int,input().split()))\nprint(s,p)\n\nfor i in range(1,2**n):\n x = format(i, 'b')\n x = x.zfill(n)\n swi.append(x)\n#print(swi[-1])\n\nfor j in range(m):\n for i in range(len(... | ['Runtime Error', 'Accepted'] | ['s859680210', 's900524442'] | [3064.0, 3064.0] | [22.0, 35.0] | [468, 608] |
p03031 | u615918811 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['def main():\n N,M = map(int, input().split())\n s = [[int(x) for x in input().split()] for _ in range(M)]\n p = [int(x) for x in input().split()]\n count=0\n for i in range(2**N):\n switch=[0]*N\n sw = bin(i)[2:]\n sw=sw[:-1]\n sw = "0"*(N-len(sw))+sw\n #for j in rang... | ['Wrong Answer', 'Accepted'] | ['s302213548', 's637496854'] | [3064.0, 3064.0] | [45.0, 43.0] | [655, 659] |
p03031 | u620157187 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['import numpy as np\n\nN, M = map(int, input().split())\narray = np.zeros([M, N])\nfor i in range(M):\n l = list(map(int, input().split()))\n for j in l[1:]:\n array[i, j-1] = 1\np = np.array(list(map(int, input().split())))\ncount = 0\nfor i in range(1<<N):\n array_i = array.copy()\n for j in range... | ['Wrong Answer', 'Accepted'] | ['s916613324', 's613874911'] | [27172.0, 26956.0] | [151.0, 148.0] | [454, 433] |
p03031 | u620806894 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['n,m = map(int,input().split())\n\nli=[]\nfor i in (1, m+1):\n s=list(map(int, input().split()))\n s.pop(0)\n li.append(s)\n\np = list(map(int, input().split()))\n#print(li)\n#print(p)\n\ndef check(g,en):\n stack = ["1", "0"]\n candi = []\n while stack:\n cur = stack.pop()\n if len(cur)... | ['Runtime Error', 'Accepted'] | ['s102992479', 's405005991'] | [3064.0, 3064.0] | [24.0, 42.0] | [811, 860] |
p03031 | u623687794 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['n,m=map(int,input().split())\na=[[0 for h in range(n)] for i in range(2**n)]\nb=[[0 for i in range(m)] for h in range(2**n)]\n\nfor i in range(2**n):\n b=i\n for j in range(n):\n c=b//(2**(n-j-1))\n a[i][j]+=c\n b-=c*(2**(n-j-1))\nprint(a)\n\nfor i in range(m):\n for j in range(2**n):\n lights=list(map... | ['Runtime Error', 'Accepted'] | ['s147005796', 's502935201'] | [3444.0, 3444.0] | [31.0, 63.0] | [846, 840] |
p03031 | u626228246 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['n,m = map(int,input().split())\nklist = []\nswlist = []\nans = 0\nfor s in range(m):\n\tk,*sw = list(map(int,input().split()))\n\tklist.append(k) \n\tswlist.append(sw) \npwlist = list(map(int,input().split())) \n\nfor i in range(2**n):\n\tcheck = True\n\tfor lump in range(m):\n\t\tcnt = 0\n\t\tfor j in range(klist[lu... | ['Wrong Answer', 'Accepted'] | ['s353407426', 's071677720'] | [9184.0, 9160.0] | [51.0, 53.0] | [1009, 1011] |
p03031 | u626337957 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['N, M = map(int, input().split())\nks = [list(map(int, input().split())) for i in range(M)]\np = list(map(int, input().split()))\n\ndef check(ar):\n cnt = 0\n for j in range(M):\n count = 0\n for k in ks[1::]:\n if ar[k-1] == 1:\n count += 1\n if count%2 == p[j]:\n ... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s103530881', 's398901023', 's483581911', 's685666458'] | [3064.0, 3064.0, 3064.0, 3188.0] | [18.0, 18.0, 18.0, 29.0] | [569, 573, 393, 561] |
p03031 | u628285938 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['# -*- coding: utf-8 -*-\n"""\nCreated on Fri Apr 3 14:23:44 2020\n\n@author: liang\n"""\n\nN, M = map(int,input().split())\nbulbs = [list(map(int,input().split()))[1:] for _ in range(M)]\np = list(map(int,input().split()))\nans = 0\nfor i in range(2**N):\n lights = [1 if (i>>j)&1 == 1 else 0 for j in range(N)]\n ... | ['Wrong Answer', 'Accepted'] | ['s696354080', 's589885998'] | [3064.0, 3064.0] | [28.0, 28.0] | [445, 444] |
p03031 | u629246993 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['n, m = map(int, input().split())\narr = [list(map(int, input().split())) for i in range(m)]\np = list(map(int,input().split()))\nres = 0\n\nfor i in range(2**n):\n res+=1\n for j in range(len(arr)):\n on = 0\n for k in range(arr[j][0]):\n on += i>>(arr[j][k+1])\n if (on%2 != p[j]... | ['Wrong Answer', 'Accepted'] | ['s051475363', 's945474654'] | [3064.0, 3064.0] | [33.0, 35.0] | [360, 366] |
p03031 | u656845405 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['swithCount, lightCount = map(int, input().split())\nswithList = [0] * lightCount\n\nfor i in range(swithCount):\n connectedLightList = list(map(int, input().split()))\n for lightIndex in range(connectedLightList[1:]):\n lightIndex -= 1\n swithList[i] = swithList[i] | 1 << lightIndex\n\nexpectedLig... | ['Runtime Error', 'Accepted'] | ['s899436709', 's002773133'] | [3064.0, 3064.0] | [17.0, 20.0] | [854, 878] |
p03031 | u662615460 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['N,M = map(int,input().split())\nks = []\nfor i in range(M):\n ks.append(list(map(int,input().split())))\np = list(map(int, input().split()))\nc = 0\n\nfor i in range(2 ** N):\n sw = [0]*N\n for j in range(N):\n if ((i >> j) & 1):\n sw[j] = 1\n frg = True\n for j in range(M):\n a = ks[j][0]\n aa = 0... | ['Runtime Error', 'Accepted'] | ['s779077860', 's647103616'] | [3064.0, 3064.0] | [38.0, 47.0] | [420, 431] |
p03031 | u664373116 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['#from operater import itemgetter\nfrom collections import Counter\nimport numpy as np\nN=int(input())\nc=[]\nv=[]\nans=[]\nc_v={}\nfor i in range(N):\n tmp=input().split()\n ans.append(tmp)\n c.append(tmp[0])\n v.append(int(tmp[1]))\n if tmp[0] in c_v.keys():\n c_v[tmp[0]].append(int(tmp[1]))\n ... | ['Runtime Error', 'Accepted'] | ['s708135175', 's232434726'] | [12908.0, 3436.0] | [149.0, 36.0] | [704, 746] |
p03031 | u665038048 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['n, m = map(int, input().split())\na = [list(map(int, input().split()))[1:] for _ in range(m)]\np = list(map(int, input().split()))\nc = 0\nfor n in range(1 << n):\n for i, s in enumerate(a):\n if p[i] ^ sum(n >> s-1 & 1 for s_ in s) & 1:\n break\n else:\n c += 1\nprint(c)', 'n, ... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s265358149', 's665119752', 's404466372'] | [3060.0, 3060.0, 3064.0] | [17.0, 29.0, 83.0] | [301, 302, 299] |
p03031 | u672316981 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['n,m = map(int,input().split())\ns_lst = [list(map(int,input().split())) for i in range(m)]\nk_lst = []\nfor i in range(m):\n k = s_lst.pop(s_lst[i][0])\n k_lst.append(k)\np_lst = list(map(int,input().split()))\nanswer = 0\n\nfor i in range(2**n): \n on_lst =[0]*n\n flag = True\n for j in range(n):\n ... | ['Runtime Error', 'Accepted'] | ['s703209511', 's546056609'] | [3064.0, 3064.0] | [17.0, 28.0] | [701, 663] |
p03031 | u672475305 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ["n,m = map(int,input().split())\ns = [list(map(int,input().split())) for _ in range(m)]\np = list(map(int,input().split()))\nres = 0\n\nfor i in range(2**n):\n ptn = format(i, 'b').rjust(n, '0')\n light = True\n for j in range(m):\n tmp = 0\n for n in range(1, s[j][0]+1):\n if ptn[s[j... | ['Runtime Error', 'Accepted'] | ['s726256942', 's998305873'] | [3064.0, 3064.0] | [46.0, 46.0] | [443, 443] |
p03031 | u672494157 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['import sys\n\nsys.setrecursionlimit(4100000)\n\n\ndef inputs(num_of_input):\n ins = [input() for i in range(num_of_input)]\n return ins\n\n\ndef create_bin_string(data, num):\n c_bin = "{:b}".format(data)\n switches = c_bin\n for _ in range(0, num-len(c_bin)):\n switches = "0" + switches\n re... | ['Wrong Answer', 'Accepted'] | ['s019457249', 's313694885'] | [3188.0, 3064.0] | [29.0, 28.0] | [1237, 1213] |
p03031 | u674588203 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['def AreAllTheLightsOn(SwitchPattern,M,LineVolume,Destinations,p):\n # print(SwitchPattern)\n Light=0\n for m in range(M):\n OnSwitch=0\n for l in range(LineVolume[m]):\n a=Destinations[m][l]-1\n if SwitchPattern[a]==1:\n OnSwitch += 1\n else:\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s944407480', 's989360864', 's272699331'] | [3188.0, 3064.0, 3064.0] | [40.0, 20.0, 38.0] | [1260, 1263, 1264] |
p03031 | u686230543 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ["n, m = map(int, input().split())\nlight = []\nfor _ in range(m):\n s_map = map(int, input().split())\n next(s_map)\n indices = [s-1 for s in s_map]\n light.append(int('0b' + ''.join(number)))\np = list(map(int, input().split()))\ncount = 0\nfor i in range(1 << n):\n list_i = [int(bit) for bit in format(i, '0{}b'... | ['Runtime Error', 'Accepted'] | ['s340438635', 's490540044'] | [3064.0, 3064.0] | [17.0, 31.0] | [503, 470] |
p03031 | u687044304 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['# -*- coding:utf-8 -*-\nfrom itertools import product\n\ndef solve():\n N, M = list(map(int, input().split()))\n K, S = [], []\n for _ in range(M):\n _in = list(map(int, input().split()))\n K.append(_in[0])\n S.append(_in[1:])\n P = list(map(int, input().split()))\n\n all_stats = p... | ['Wrong Answer', 'Accepted'] | ['s873768638', 's299211341'] | [3064.0, 3064.0] | [22.0, 26.0] | [759, 820] |
p03031 | u687159441 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['\n\n\n\n\n\n\n\n\n\n\n\n\nn, m = map(int, input().split())\n\n\nk = []\ns = []\n\nfor _ in range(m):\n tmp = tuple(map(int, input().split()))\n k.append(tmp[0])\n s.append(set(tmp[1:-1]))\n \np = tuple(map(int, input().split()))\n \n# print(k, s, p, sep="\\n")\n\nans = 0\n\n\nfor i in range(2 ** n):\n \n ... | ['Wrong Answer', 'Accepted'] | ['s238167268', 's394977768'] | [3064.0, 3064.0] | [44.0, 46.0] | [2089, 2097] |
p03031 | u689626103 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['n, m = map(int, input().split())\n\nds = []\nfor _ in range(M):\n ds.append(list(map(int, input().split()))[1:])\n\nP = map(int, input().split())\n\nans = 0\n\nfor i in range(2**N):\n switch_states = [(i >> j) & 1 for j in range(N)]\n \n for di, d in enumerate(ds):\n count = 0\n for s in d:\n count += ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s941174837', 's966768884', 's422077506'] | [3064.0, 3064.0, 3064.0] | [17.0, 18.0, 27.0] | [395, 395, 433] |
p03031 | u690145987 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['import numpy as np\nN,M= list(map(int, input().split()))\nK = []\nS=[]\nstate_S = np.zeros(N)\nfor m in range(M):\n _input = list(map(int, input().split()))\n K.append(_input[0])\n S.append(np.array(_input[1:]))\nP = list(map(int, input().split()))\nans=0\nfor i in range(N ** 2):\n pattern= np.array([i >... | ['Runtime Error', 'Accepted'] | ['s333257857', 's258265135'] | [20748.0, 14452.0] | [312.0, 249.0] | [435, 444] |
p03031 | u700636661 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['import sys\n\ndef all_lighted(input, mod, pattern):\n for i, bulb in enumerate(input):\n if bin(bulb and pattern).count(\'1\') % 2 == pattern[i]:\n next\n else:\n return False\n \n return True\n\n\ndef main():\n num_switch, num_bulb = [int(x) for x in sys.stdin.readline... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s195755795', 's366202728', 's382744398', 's179508387'] | [3064.0, 3064.0, 3064.0, 3064.0] | [18.0, 21.0, 21.0, 20.0] | [672, 668, 678, 689] |
p03031 | u708255304 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['N, M = int(input().split()) \n\n\nSSS = [list(map(int, input().split()))[1:] for i in range(M)]\nP = list(map(int, input().split()))\n\nans = 0\n\nfor i in range(1 << N): \n for mask in range(M):\n ans_2 = 0\n for s in SSS[mask]:\n if (1 << s-1) & i != 0:\n ans_2 += 1\n\n ... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s311644704', 's837412151', 's974576350', 's413699078'] | [3064.0, 3064.0, 3064.0, 3188.0] | [18.0, 18.0, 30.0, 36.0] | [556, 551, 531, 1692] |
p03031 | u714225686 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['# n=int(inputfile.readline())\n# a,b=map(int, inputfile.readline().split())\n# c=list(map(int, inputfile.readline().split()))\n\n\n# a=100\n# b=0.987654321\n\n# 000100-0.987654\n\nimport math\nimport sys\n\ninputfile = open("input.txt")\nN, M=map(int, inputfile.readline().split())\n\n\n\n\nbulb_list = [0 for _ in ran... | ['Runtime Error', 'Accepted'] | ['s504466013', 's521275215'] | [3064.0, 3064.0] | [18.0, 32.0] | [1817, 1162] |
p03031 | u714300041 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['import itertools\n\nN, M = map(int, input().split())\nS = []\nfor i in range(M):\n tmp = list(map(int, input().split()))\n S.append([tmp[1:]])\nP = list(map(int, input().split()))\n\n\norigin_list = [0, 1]\nall_way = []\nfor i in itertools.product(origin_list, repeat=N):\n all_way.append(i)\n\nans = 0\nfor w... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s634940263', 's841448209', 's555856503'] | [3188.0, 3188.0, 3192.0] | [18.0, 19.0, 36.0] | [572, 587, 624] |
p03031 | u726212005 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['n,m=map(int,input().split())\ns=[]\ncount=0\nfor i in range(m):\n tmp=list(map(int,input().split()))\n s.append(tmp[1:])\n\np=list(map(bool,input().split()))\np=list(map(lambda x:not x,p))\n\nfor i in range(2**n):\n tmp_p=p[:]#shallow copy\n for j in range(n):\n if i >> j & 1:\n for k in... | ['Wrong Answer', 'Accepted'] | ['s205340453', 's032671056'] | [3064.0, 3064.0] | [35.0, 34.0] | [461, 458] |
p03031 | u727057618 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ["import numpy as np\nfrom itertools import product\n\ndef main():\n n, m = [int(i) for i in input().split()]\n sw = np.zeros((m, n), int)\n for i in range(m):\n for s in input().split()[1:]:\n sw[i][int(s)-1] = 1\n\n p = np.array([int(i) for i in input().split()])\n print(sw)\n res ... | ['Wrong Answer', 'Accepted'] | ['s989784741', 's589171840'] | [12400.0, 12400.0] | [172.0, 173.0] | [506, 492] |
p03031 | u728095140 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['N,M = map(int,input().split())\nlis = [None]*M\nfor i in range(M):\n lis[i] = list(map(int,input().split()))\np = list(map(int,input().split()))\nanswer = 0\n\nfor bit in range(1<<N):\n count =[]\n for i in range(N): #make bit\n mask = 1<<i\n if mask&bit:\n count.append(1)\n e... | ['Wrong Answer', 'Accepted'] | ['s054027009', 's407964608'] | [3064.0, 3064.0] | [35.0, 38.0] | [577, 556] |
p03031 | u729133443 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ["I=lambda:list(map(int,input().split()))\nn,m=I()\ns=eval('I(),'*m)\np=I()\na=0\nr=range\nfor i in r(1<<n):\n c=[0]*m\n for j in r(n):\n for k in r(m):c[k]+=i>>j&j+1in s[k][1:]\n a+=all(j==i%2for i,j in zip(c,p))\nprint(a)", '(n,m),*s,p=[list(map(int,t.split()))for t in open(0)]\na=0\nfor i in range(1<<n):\n c=[0]*m\... | ['Wrong Answer', 'Accepted'] | ['s079522137', 's085438648'] | [3064.0, 3060.0] | [84.0, 103.0] | [211, 165] |
p03031 | u735008991 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ["N, M = map(int, input().split())\nS = []\nfor _ in range(M):\n S.append(list(map(int, input().split()))[1:])\np = map(int, input().split())\nans = 0\nfor bit in range(1 << N):\n for m in range(M):\n if p[m] != ([str(bit).zfill(N)[s-1] for s in S[m]].count('1') % 2):\n break\n else:\n ... | ['Runtime Error', 'Accepted'] | ['s534851588', 's009386579'] | [3064.0, 3064.0] | [17.0, 32.0] | [328, 326] |
p03031 | u742590876 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['n, m = map(int, input().split())\nks = [[int(i) for i in input().split()][1:] for _ in range(m)]\np = list(map(int, input().split()))\n\nans = 0\nfor i in range(2 ** n):\n for j in range(m):\n cnt = 0\n for k in range(n):\n if i >> j & 1 and k + 1 in ks[j]:\n cnt += 1\n ... | ['Wrong Answer', 'Accepted'] | ['s419143436', 's836007868'] | [9200.0, 9204.0] | [36.0, 42.0] | [385, 385] |
p03031 | u756279759 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['import itertools\n \nN, M = map(int, input().split())\nlights = []\nfor m in range(M):\n \n interpools mpzp(input())\n tmp = list(map(int, input().split()))\n lights.append(tmp[1:])\n \n \nP = list(map(int, input().split()))\n \nans = 0\nfor product in list(itertools.product([0, 1], repeat=N)):\n for light... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s063700443', 's092867274', 's935924147'] | [8996.0, 9024.0, 9288.0] | [24.0, 26.0, 34.0] | [525, 533, 505] |
p03031 | u757117214 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['N,M=map(int,input().split())\nlights=[]\nfor i in range(M):\n k,*s=map(int,input().split())\n lights.append(list(map(lambda x:x-1,s)))\nP=list(map(int,input().split()))\ncnt=0\nfor b in range(1<<N):#bit\n flg=True\n for m in range(M):\n on_cnt=0\n for switch in lights[m]:\n if (b>... | ['Wrong Answer', 'Accepted'] | ['s385693430', 's989381550'] | [3064.0, 9212.0] | [37.0, 37.0] | [525, 990] |
p03031 | u763741681 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['N,M=map(int,input().split())\nA=[]\nfor i in range(M):\n A.append(list(map(int,input().split())))\nP=list(map(int,input().split()))\nans=0\nfor i in range(2**N,2**(N+1)):\n B=bin(i)\n count=0\n for j in range(M):\n tet=0\n for l in range(A[j][0]):\n tet+=in... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s237734208', 's596630775', 's302788483'] | [3064.0, 3064.0, 3188.0] | [72.0, 62.0, 68.0] | [861, 430, 429] |
p03031 | u765865533 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['N, M = map(int, input().split())\nX=[]\nfor i in range(M):\n X.append(list(map(int, input().split())))\nP=list(map(int, input().split()))\nans=0\n\nkey=\'{:0\'+str(N)+"b}"\nfor k in range(2**N):\n \n switch=list(key.format(k))\n for i in range(M):\n \n odd=1\n\t\teven=0\n if P[i]==1:\... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s333117690', 's832994701', 's378283901'] | [3064.0, 3188.0, 3064.0] | [17.0, 44.0, 43.0] | [745, 797, 742] |
p03031 | u767543103 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['import numpy as np\nimport itertools as ittr\n\ndef test_switch(e_balls, sw, p):\n for i, e_ball in enumerate(e_balls):\n eb = np.asarray(e_ball)\n si = sw[eb - 1]\n \n if p[i] != (np.sum(si == 1) % 2):\n return False\n \n return True\n\nN, M = map(int, input().split())... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s281953317', 's605085758', 's218813064'] | [3064.0, 12420.0, 12428.0] | [17.0, 150.0, 247.0] | [581, 560, 552] |
p03031 | u771167374 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['n, m = map(int, input().split())\nswitch = [list(map(lambda x:int(x)-1, input().split()))[1:] for _ in range(m)]\nrest = list(map(int, input().split()))\nans = 0\nfor bit in range(1<<n):\n on_sum = 0\n for j in range(m):\n for i in range(n):\n if bit >> i & 1 and i in switch[j]:\n ... | ['Wrong Answer', 'Accepted'] | ['s992802002', 's449045360'] | [9048.0, 9188.0] | [35.0, 42.0] | [399, 420] |
p03031 | u779455925 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['N, M = map(int, input().split())\nswitch_list=[input().split() for i in range(M)]\nswitch_list=[[int(i[m+1]) for m in range(len(i)-1)] for i in switch_list]\nP_list=input().split()\nP_list=[int(i) for i in P_list]\nfor i in range(1 << z):\n switch=[0 for i in range(N)]\n for j in range(z):\n if ((i >> j)... | ['Runtime Error', 'Accepted'] | ['s194843157', 's598905801'] | [3064.0, 3064.0] | [18.0, 36.0] | [454, 466] |
p03031 | u784612287 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['N, M = list(map(int, input().split()))\nl = []\nfor i in range(M):\n ks = list(map(int, input().split()))\n k, s = ks[0], ks[1:]\n l.append(s)\n \np = list(map(int, input().split()))\n\nans = 0\nfor j in range(2**N):\n n = 0 \n for m in range(M):\n t = 0\n for sw in l[m]:\n ... | ['Wrong Answer', 'Accepted'] | ['s268262216', 's837962264'] | [3824.0, 3064.0] | [51.0, 30.0] | [499, 464] |
p03031 | u785578220 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['import numpy as np\ntl = np.array([0,1,2,1,1,])\ntl = np.array([0,1,2,1,1,])\ndp = np.zeros((10,10))\nans = 0\nn,m = map(int,input().split())\nfor i in range(10):\n tl = list(map(int,input().split()))\n for j in tl[1:]:\n dp[i][j-1]+=1\nl = list(map(int,input().split()))\nimport itertools\nfor i in range... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s104308658', 's546029611', 's483114037'] | [12504.0, 3064.0, 3064.0] | [151.0, 24.0, 58.0] | [612, 379, 475] |
p03031 | u789565565 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['n,m = map(int,input().split())\ncard =[[0]*n for _ in range(m)]\nfor i in range(m):\n switch = list(map(int,input().split()))[1:]\n for k in switch:\n card[i][k-1] = 1\n\n\n#print(card)\n\n\nans =list(map(int,input().split()))\ncnt=0\nfrom itertools import combinations\n\nfor epoch in range(1,n+1):\n ... | ['Runtime Error', 'Accepted'] | ['s823151828', 's165546415'] | [9144.0, 27148.0] | [27.0, 127.0] | [739, 823] |
p03031 | u790710233 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['from itertools import product\nn, m = map(int, input().split())\nswitch = []\nfor _ in range(m):\n k, *s = map(lambda x: int(x)-1, input().split())\n switch.append(s)\np = map(int, input().split())\n\nans = 0\nfor subset in product((0, 1), n):\n for j in range(m):\n on_cnt = sum(subset[s] for s in swi... | ['Runtime Error', 'Accepted'] | ['s312027714', 's427377257'] | [9192.0, 9108.0] | [24.0, 33.0] | [402, 421] |
p03031 | u798818115 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['# coding: utf-8\n# Your code here!\nN,M=map(int,input().split())\nl=[]*M\n\nfor i in range(M):\n l.append(list(map(int,input().split())))\n l[i].pop(0)\n \np=list(map(int,input().split()))\n\ncount=0\ns=[-1]*10\n\nfor i in range(2):\n s[0]=i\n for ii in range(2):\n s[1]=ii\n for iii in ra... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s598120824', 's807788562', 's945118931', 's728334488'] | [3064.0, 3188.0, 3192.0, 3064.0] | [29.0, 20.0, 20.0, 28.0] | [1665, 1651, 1663, 1670] |
p03031 | u809819902 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['n,m=map(int,input().split())\ndenkyu_switch=[]\nres=0\nfor i in range(m):\n denkyu_switch+=[list(map(int, input().split()))[1:]]\np=list(map(int, input().split()))\nfor i in range(2**n):\n denkyu = [0] * m\n for j in range(n):\n if i>>j & 1:\n for k in denkyu_switch:\n if j i... | ['Runtime Error', 'Accepted'] | ['s478465824', 's525164842'] | [9200.0, 9108.0] | [28.0, 43.0] | [389, 436] |
p03031 | u814781830 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['N, M = map(int, input().split())\nKS = [list(map(int, input().split())) for _ in range(M)]\nP = list(map(int, input().split()))\n\nswitch = []\nfor i in range(N**2):\n tmp = []\n for j in range(N):\n if (i >> j) & 1:\n tmp.append(j+1)\n switch.append(tmp)\nswitch.append([i for i in range(1,... | ['Wrong Answer', 'Accepted'] | ['s212451355', 's308880833'] | [3192.0, 3064.0] | [19.0, 33.0] | [593, 552] |
p03031 | u822961851 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ["def resolve():\n N, M = map(int, input().split())\n S = [tuple(map(int, input().split()))[1:] for _ in range(M)]\n P = tuple(map(int, input().split()))\n ans = 0\n\n for c in range(2**N):\n flg_list = [False]*M\n for i, s_l in enumerate(S):\n cnt = 0\n for s in s_l:\... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s115485245', 's320840551', 's685486646'] | [3064.0, 3064.0, 3064.0] | [33.0, 29.0, 34.0] | [545, 540, 527] |
p03031 | u830940424 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['import sys\nimport numpy as np\nimport itertools\n\n[N,M] = input().split()\nN = int(N)\nM = int(M)\na =[]\np = []\nlist_bin = []\n\nfor j in range(M):\n list_temp = [int(s) for s in input().split()]\n list_temp.pop(0)\n for i in range(N):\n if i+1 in list_temp:\n list_bin.append(1)\n ... | ['Wrong Answer', 'Accepted'] | ['s336677006', 's883773045'] | [27584.0, 27456.0] | [984.0, 161.0] | [897, 794] |
p03031 | u849151695 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ["M = map(int,input().split()) \n#print(N)\n\nlight=[]\nfor i in range(M):\n light.append(list(map(int,input().split())))\n#print(light)\n\n\np = list(map(int,input().split()))\n#print(p)\n\nans = 0\nfor i in range(2**N):\n \n sw = [0]*N\n for j in range(N):\n if ((i >>j) & True):\n sw[j]=... | ['Runtime Error', 'Accepted'] | ['s776512366', 's575173923'] | [3064.0, 3064.0] | [17.0, 66.0] | [1076, 758] |
p03031 | u860002137 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['import numpy as np\nfrom itertools import product\n\nN, M = map(int, input().split())\nswitch = []\n\nfor i in range(M):\n switch.append(list(map(int, input().split()))[1:])\n\n\np = list(map(int, input().split()))\n\n\nst = list(product([0,1],repeat=N))\n\nans = 0\n\nfor i, s in enumerate(st):\n tmp = []\n ... | ['Runtime Error', 'Accepted'] | ['s135085757', 's784449424'] | [12504.0, 9448.0] | [158.0, 44.0] | [612, 529] |
p03031 | u861141787 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['n, m = map(int, input().split())\nks = [list(map(int, input().split())) for _ in range(m)]\np = list(map(int, input().split()))\n\nsw = [i + 1 for i in range(n)]\n\nt_on = []\nfor i in range(2 ** n):\n on = []\n for j in range(n):\n if (i>>j) & 1:\n on.append(sw[j])\n\n t_on.append(on)\n\na... | ['Wrong Answer', 'Accepted'] | ['s221267205', 's558771259'] | [3680.0, 3064.0] | [67.0, 29.0] | [538, 541] |
p03031 | u863044225 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['n,m=map(int,input().split())\ns=[[]]*m\nfor i in range(m):\n s[i]=list(map(int,input().split()))\n del s[0]\np=list(map(int,input().split()))\n\nans=0\nfor bit in range(1<<n):\n x=0\n for i in range(m):\n y=0\n for j in s[i]:\n if bit&(1<<(j-1)):\n y+=1\n if y%2==p[i]%2:\n x+=1\n if x==... | ['Runtime Error', 'Accepted'] | ['s770713411', 's401932331'] | [3064.0, 3064.0] | [17.0, 39.0] | [326, 330] |
p03031 | u863442865 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ["def main():\n n, m = map(int, input().split())\n switch_list = [list(map(int, input().split())) for _ in range(m)]\n p = list(map(int, input().split()))\n ret = 0\n for j in range(2**n):\n cnt = 0\n for i in range(m):\n flag = 1\n for k in switch_list[i][1:]:\n ... | ['Runtime Error', 'Accepted'] | ['s041110229', 's826878249'] | [3064.0, 3188.0] | [17.0, 35.0] | [540, 546] |
p03031 | u864069774 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['import itertools\n\nN,M = map(int,input().split())\nKS = [list(map(int,input().split())) for i in range(M)]\nP = list(map(int,input().split()))\nl = []\nnums = [0,1]\ncount = 0\nfor b in itertools.product(nums, repeat=N):\n c_denkyu = 0\n for sw in KS:\n c_sw = 0\n for i in sw[1:]:\n if... | ['Wrong Answer', 'Accepted'] | ['s393880867', 's522509031'] | [3064.0, 12416.0] | [34.0, 176.0] | [462, 414] |
p03031 | u867200256 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ["def main():\n N, M = list(map(int, input().split()))\n ks = [[int(arg) for arg in input().split()] for _ in range(M)]\n p = list(map(int, input().split()))\n comb = 0\n\n for i in range(2**N):\n flag = False\n for j in range(N):\n denki = []\n if ((i >> j) & 1): \n ... | ['Runtime Error', 'Accepted'] | ['s496511213', 's839947628'] | [3192.0, 3064.0] | [72.0, 28.0] | [944, 889] |
p03031 | u868628468 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['n,m=map(int,input().split())\ns=[list(map(int,input().split())) for _ in range(m)]\np=list(map(int,input().split()))\n\nsum = 0\nisAffectedSwitch=[[False for _ in range(n)] for _ in range(m)]\nfor i in range(m):\n for j in range(1,s[i][0]+1):\n isAffectedSwitch[i][s[i][j]-1]=True\n\nC = []\nfor i in range(N... | ['Runtime Error', 'Accepted'] | ['s841771693', 's712006246'] | [3064.0, 3188.0] | [17.0, 20.0] | [580, 671] |
p03031 | u886747123 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['N,M = map(int,input().split())\nks = [list(map(int,input().split())) for _ in range(M)]\np = list(map(int,input().split()))\n\nans = 0\n\nfor i in range(2**N):\n switch = [0]*N\n \n for j in range(N):\n if (i>>j & 1):\n switch[j] = 1\n \n n_on_light = 0\n \n for x in range(M):\n... | ['Wrong Answer', 'Accepted'] | ['s175869306', 's393358531'] | [3064.0, 3064.0] | [49.0, 49.0] | [595, 573] |
p03031 | u887207211 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['N, M = map(int,input().split())\nKS = [list(map(int,input().split())) for _ in range(M)]\nP = list(map(int,input().split()))\n\nans = 0\nfor i in range(1 << N):\n tmp = 1\n cnt = 0\n for j, b in enumerate(KS):\n for bb in b:\n if (i >> bb) & 1:\n cnt += 1\n if cnt%2 != P[j]:\n tmp = 0\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s036459968', 's234621571', 's482892451'] | [3064.0, 3064.0, 3064.0] | [22.0, 46.0, 30.0] | [344, 358, 325] |
p03031 | u889919275 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['n, m = map(int, input().split())\nk_list = [list(map(int, input().split()))[1:] for _ in range(m)]\np_list = list(map(int, input().split()))\n\nans = 0\nfor bit in range(2**n):\n check = True\n for k, p in zip(k_list, p_list):\n if check:\n count = 0\n for i in range(n):\n ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s007372763', 's303630346', 's318214017', 's644939042'] | [9220.0, 9232.0, 9212.0, 9200.0] | [41.0, 52.0, 40.0, 38.0] | [509, 462, 481, 500] |
p03031 | u891518152 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['L = []\nS = []\nN, M = map(int, input().split())\ncnt = 0\nans = 0\nfor i in range(M):\n l = list(map(int, input().split()))\n L.append(l)\np = list(map(int, input().split()))\n\nfor j in range(2**N):\n switch = [0]*N\n for k in range(N):\n if (j >> k) & 1:\n switch[k-1]=1\n S.append(... | ['Wrong Answer', 'Accepted'] | ['s682525165', 's519166277'] | [3188.0, 3188.0] | [53.0, 52.0] | [695, 686] |
p03031 | u896741788 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['def ma():\n n,m=map(int,input().split())\n ans=0\n e=[set(list(map(int,input().split()))[1:]) for i in range(m)]\n f=list(map(int,input().split()))\n for i in range(2**n):\n l={a for a,b in zip(range(1,n+1),bin(i)[2:].zfill(n)) if b=="1"}\n if sum(int(len(e[j-1]&l)%2!=f[j-1])for j in range(1,m+1)):break\n ... | ['Wrong Answer', 'Accepted'] | ['s707267616', 's830386719'] | [3064.0, 3064.0] | [17.0, 26.0] | [370, 362] |
p03031 | u902468164 | 2,000 | 1,048,576 | We have N switches with "on" and "off" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M. Bulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are "on" among these switches is congruent to p_i modulo 2. How ... | ['n, m = map(int, input().split())\n\nss = []\nfor i in range(m):\n s = list(map(int, input().split()))[1:]\n te = 0\n for sm in s:\n te += 2**(sm-1)\n ss.append(te)\n\npp = list(map(int, input().split()))\nres = 0\nfor i in range(2**(n-1)):\n tm = True\n for j in range(len(ss)):\n if (i... | ['Wrong Answer', 'Accepted'] | ['s954303786', 's220651168'] | [3064.0, 3188.0] | [19.0, 30.0] | [406, 491] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.