結果

問題 No.3711 Udon, Tempura
コンテスト
ユーザー Tuchmos
提出日時 2026-09-16 12:43:33
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 296 ms / 2,000 ms
+ 156µs
コード長 418 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 73 ms
コンパイル使用メモリ 81,060 KB
実行使用メモリ 174,624 KB
最終ジャッジ日時 2026-09-16 12:43:40
合計ジャッジ時間 5,847 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N,M=map(int,input().split())
U=list(map(int,input().split()))
T=list(map(int,input().split()))

S=[[False]*(100000+1) for i in range(M+1)]
S[0][0]=True
for i in range(M):
    for j in range(100001):
        if not S[i][j]:
            continue
        S[i+1][j]=True
        S[i+1][j+T[i]]=True

can=set()
for i in range(N):
    for j in range(100001):
        if S[-1][j]:
            can.add(j+U[i])

print(len(can))
0