結果
| 問題 | No.3409 How Many Gift Boxes? |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2025-12-18 09:02:44 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 400 ms / 2,000 ms |
| コード長 | 274 bytes |
| 記録 | |
| コンパイル時間 | 299 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 25,684 KB |
| 最終ジャッジ日時 | 2025-12-18 09:02:57 |
| 合計ジャッジ時間 | 11,979 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 38 |
コンパイルメッセージ
Main.py:11: SyntaxWarning: invalid decimal literal while i>0and b<A[i]:i-=1 Main.py:12: SyntaxWarning: invalid decimal literal if i>-1and A[i]==b:i-=1
ソースコード
R=range J=lambda:map(int,input().split()) O=print H,W=J() A=sorted(J()) B=sorted(J()) P=10**9+7 i=H-1 a=sum(A) for b in B[::-1]: while i>0and b<A[i]:i-=1 if i>-1and A[i]==b:i-=1 else:a+=b O(a%P) i=a=s=0 for b in B: while i<H and A[i]<=b:s+=A[i];i+=1 a+=b*(H-i)+s O(a%P)