結果

問題 No.1701 half price
ユーザー MasKoaTSMasKoaTS
提出日時 2021-10-31 17:33:25
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 954 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 82,596 KB
実行使用メモリ 89,900 KB
最終ジャッジ日時 2024-04-17 11:05:12
合計ジャッジ時間 6,754 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 145 ms
86,636 KB
testcase_01 AC 145 ms
87,040 KB
testcase_02 AC 194 ms
89,344 KB
testcase_03 AC 151 ms
87,296 KB
testcase_04 AC 194 ms
89,216 KB
testcase_05 AC 155 ms
89,216 KB
testcase_06 AC 560 ms
89,344 KB
testcase_07 AC 578 ms
89,216 KB
testcase_08 WA -
testcase_09 AC 145 ms
87,424 KB
testcase_10 AC 153 ms
86,528 KB
testcase_11 AC 146 ms
87,424 KB
testcase_12 AC 148 ms
87,424 KB
testcase_13 AC 144 ms
87,296 KB
testcase_14 AC 142 ms
87,168 KB
testcase_15 AC 142 ms
87,424 KB
testcase_16 AC 141 ms
86,528 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 145 ms
86,656 KB
testcase_21 AC 567 ms
89,472 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools as iter
import collections as coll
import heapq as hq
import bisect as bis
from decimal import Decimal as dec
from copy import deepcopy as dcopy
import math
import sys
sys.setrecursionlimit(10**6)
def input():
    return sys.stdin.readline().rstrip()
def getN():
	return int(sys.stdin.readline().rstrip())
def getNs():
	return map(int,sys.stdin.readline().rstrip().split())
def getList():
	return list(map(int,sys.stdin.readline().rstrip().split()))
def strinps(n):
	return [sys.stdin.readline().rstrip() for _ in range(n)]
pi = 3.141592653589793
mod = 10**9+7
MOD = 998244353
INF = math.inf
dx = [1,0,-1,0];	dy = [0,1,0,-1]


"""
Main Code
"""

n,w = getNs()
a = getList()

l = [0,1,2]
st = set([])
for choice in iter.product(l,repeat = n):
	price = 0
	bit = 0
	for i in range(n):
		if(choice[i] == 1):
			price += a[i] // 2
		elif(choice[i] == 2):
			price += a[i]
		else:
			bit |= 1 << i
	if(price == w):
		st.add(bit)
print(len(st))
0