結果
| 問題 | 
                            No.2784 繰り上がりなし十進和
                             | 
                    
| コンテスト | |
| ユーザー | 
                             titia
                         | 
                    
| 提出日時 | 2024-06-20 03:08:47 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 410 bytes | 
| コンパイル時間 | 296 ms | 
| コンパイル使用メモリ | 82,480 KB | 
| 実行使用メモリ | 125,936 KB | 
| 最終ジャッジ日時 | 2024-06-20 03:09:21 | 
| 合計ジャッジ時間 | 30,905 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 31 TLE * 5 | 
ソースコード
import sys
input = sys.stdin.readline
A=[int(input()) for i in range(6)]
U=[10**i for i in range(6)]
def calc(x,y):
    ANS=0
    for i in U:
        c=((x//i + y//i)%10) * i
        #print(i,c)
        ANS+=c
    return ANS
DP=[0]*(10**6)
DP[0]=1
Q=[0]
while Q:
    x=Q.pop()
    for a in A:
        to=calc(a,x)
        if DP[to]==0:
            DP[to]=1
            Q.append(to)
print(sum(DP))
        
            
            
            
        
            
titia