結果
| 問題 | 
                            No.1747 Many Formulae 2
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2022-02-24 22:52:32 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 523 bytes | 
| コンパイル時間 | 165 ms | 
| コンパイル使用メモリ | 82,176 KB | 
| 実行使用メモリ | 69,760 KB | 
| 最終ジャッジ日時 | 2024-07-02 14:07:42 | 
| 合計ジャッジ時間 | 4,621 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 18 WA * 1 | 
ソースコード
import itertools
s = list(input())
s_space = list(" ".join(s))
result = []
lis=list(range(0,len(s)-1))
def judge(n):
    for i in range(2,n):
        if n%i==0:
            return 0
    return 1
        
for n in range(0,len(lis)+1):
    for conb in itertools.combinations(lis, n):
        result.append(list(conb))
count = 0        
for i in result:
    s_v = s_space.copy()
    for j in i:
        s_v[j*2+1]="+"
    v = eval("".join(list(filter(lambda x:x!=" ",s_v))))
    count += judge(v)
print(count)