結果
| 問題 | No.50 おもちゃ箱 |
| コンテスト | |
| ユーザー |
ytft
|
| 提出日時 | 2022-11-06 01:20:21 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 396 bytes |
| 記録 | |
| コンパイル時間 | 250 ms |
| コンパイル使用メモリ | 85,308 KB |
| 実行使用メモリ | 166,108 KB |
| 最終ジャッジ日時 | 2026-04-02 17:44:03 |
| 合計ジャッジ時間 | 16,772 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 24 WA * 14 |
ソースコード
import sys,itertools input=lambda:sys.stdin.readline().rstrip() N=int(input()) A=list(map(int,input().split())) M=int(input()) B=sorted(list(map(int,input().split())))[::-1] A=itertools.permutations(A) ans=-1 for i in A: temp=[0 for i in range(M)] for j in i: for k in range(M): if temp[k]+j<=B[k]: temp[k]+=j break else: break else: ans=max(ans,M-temp.count(0)) print(ans)
ytft