結果

問題 No.3024 等式
ユーザー cielciel
提出日時 2017-04-22 23:25:52
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 490 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 87,060 KB
実行使用メモリ 100,464 KB
最終ジャッジ日時 2023-09-28 21:46:20
合計ジャッジ時間 17,825 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 237 ms
90,160 KB
testcase_01 AC 228 ms
89,996 KB
testcase_02 AC 236 ms
90,208 KB
testcase_03 AC 239 ms
90,048 KB
testcase_04 AC 231 ms
89,996 KB
testcase_05 AC 234 ms
89,848 KB
testcase_06 AC 448 ms
94,880 KB
testcase_07 AC 461 ms
96,116 KB
testcase_08 AC 444 ms
94,868 KB
testcase_09 AC 237 ms
89,864 KB
testcase_10 AC 241 ms
89,832 KB
testcase_11 AC 301 ms
92,060 KB
testcase_12 AC 1,291 ms
97,304 KB
testcase_13 AC 1,208 ms
96,600 KB
testcase_14 AC 1,377 ms
100,464 KB
testcase_15 AC 474 ms
95,364 KB
testcase_16 AC 238 ms
89,892 KB
testcase_17 AC 456 ms
95,628 KB
testcase_18 AC 235 ms
90,028 KB
testcase_19 AC 305 ms
92,424 KB
testcase_20 AC 325 ms
92,220 KB
testcase_21 AC 244 ms
91,252 KB
testcase_22 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python
from __future__ import print_function
from fractions import Fraction
import sys,itertools

def dfs(a):
	if len(a)<2: yield a[0]
	for i in range(len(a)-1):
		for l in dfs(a[:i+1]):
			for r in dfs(a[i+1:]):
				if l==r: print('YES');exit(0)
				if l<r: continue
				yield l+r
				yield l-r
				yield l*r
				yield Fraction(l,r)

n=int(sys.stdin.readline())
a=list(map(int,sys.stdin.readline().split()))
for b in itertools.permutations(a):
	for e in dfs(b): pass
print('NO')
0