結果
| 問題 | 
                            No.1747 Many Formulae 2
                             | 
                    
| コンテスト | |
| ユーザー | 
                             nok0
                         | 
                    
| 提出日時 | 2021-11-11 00:04:56 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 380 bytes | 
| コンパイル時間 | 453 ms | 
| コンパイル使用メモリ | 82,372 KB | 
| 実行使用メモリ | 68,420 KB | 
| 最終ジャッジ日時 | 2024-12-31 18:43:02 | 
| 合計ジャッジ時間 | 2,146 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 17 WA * 2 | 
ソースコード
def is_prime(x):
    if x == 2:
        return 0
    for i in range(2, int(x ** 0.5) + 1):
        if x % i == 0:
            return 0
    return 1
res = 0
s = input()
n = len(s)
for b in range(1 << (n - 1)):
    t = []
    for i in range(n):
        t.append(s[i])
        if i < n - 1 and b >> i & 1:
            t.append('+')
    res += is_prime(eval(''.join(t)))
print(res)
            
            
            
        
            
nok0