結果
| 問題 |
No.8024 等式
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-04-22 22:50:04 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 538 bytes |
| コンパイル時間 | 299 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 18,208 KB |
| 最終ジャッジ日時 | 2024-07-21 16:30:22 |
| 合計ジャッジ時間 | 10,329 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 TLE * 1 -- * 10 |
ソースコード
#!/usr/bin/python
from __future__ import print_function,division
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]):
if l==0: print('YES');exit(0)
for r in dfs(a[i+1:]):
if r==0: print('YES');exit(0)
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):
if e==0: print('YES');exit(0)
print('NO')