結果

問題 No.1701 half price
ユーザー MasKoaTSMasKoaTS
提出日時 2021-10-31 17:34:45
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 968 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 82,144 KB
実行使用メモリ 89,760 KB
最終ジャッジ日時 2024-04-17 11:06:09
合計ジャッジ時間 5,777 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
86,912 KB
testcase_01 AC 131 ms
87,584 KB
testcase_02 AC 179 ms
89,728 KB
testcase_03 AC 129 ms
87,832 KB
testcase_04 AC 175 ms
89,728 KB
testcase_05 AC 141 ms
89,472 KB
testcase_06 AC 635 ms
89,472 KB
testcase_07 AC 634 ms
89,600 KB
testcase_08 WA -
testcase_09 AC 129 ms
87,680 KB
testcase_10 AC 126 ms
87,040 KB
testcase_11 AC 129 ms
87,936 KB
testcase_12 AC 138 ms
89,600 KB
testcase_13 AC 130 ms
87,808 KB
testcase_14 AC 129 ms
87,624 KB
testcase_15 AC 134 ms
87,552 KB
testcase_16 AC 126 ms
86,912 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 127 ms
87,040 KB
testcase_21 AC 626 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] != 0):
			bit |= 1 << i
		if(choice[i] == 1):
			price += a[i] // 2
		elif(choice[i] == 2):
			price += a[i]
	if(price == w):
		st.add(bit)
print(len(st))
0