Algorithms for Online Matching, Assortment, and Pricing with Tight Weight-Dependent Competitive Ratios