結果
| 問題 | No.3711 Udon, Tempura |
| コンテスト | |
| ユーザー |
kidodesu
|
| 提出日時 | 2026-09-11 21:49:58 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 147 ms / 2,000 ms |
| + 764µs | |
| コード長 | 311 bytes |
| 記録 | |
| コンパイル時間 | 73 ms |
| コンパイル使用メモリ | 80,640 KB |
| 実行使用メモリ | 96,512 KB |
| 最終ジャッジ日時 | 2026-09-11 21:50:03 |
| 合計ジャッジ時間 | 4,157 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 |
ソースコード
n, m = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
N = 10**5
dp = [0] * (N+1)
dp[0] = 1
for b in B:
for t in range(N, b-1, -1):
if dp[t-b]: dp[t] = 1
C = set()
for a in A:
for b in range(N+1):
if dp[b]: C.add(a+b)
print(len(C))
kidodesu