結果

問題 No.10 +か×か
ユーザー tabataba
提出日時 2016-04-13 02:46:22
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 273 bytes
コンパイル時間 80 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 13,344 KB
最終ジャッジ日時 2024-04-15 00:25:13
合計ジャッジ時間 7,116 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,816 KB
testcase_01 AC 11 ms
6,940 KB
testcase_02 AC 11 ms
6,944 KB
testcase_03 AC 500 ms
6,944 KB
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n=input()
t=input()
a=map(int,raw_input().split())
def solve(c,d,e):
	if d>=n:
		if c==t:
			return e
		return False
	if c>t:
		return False
	r=solve(c+a[d],d+1,e+"+")
	if r==False:
		r=solve(c*a[d],d+1,e+"*")
		if r==False:
			return False
	return r
print solve(a[0],1,"")
0