← CSES Better

Smart Phone

ZCO · 2014 · Zonal Computing Olympiad · ZCO14003

Open official problem ↗
Ask AI

Open a hint-first prompt in a new AI chat. Grok may ask you to confirm before sending.

Open Claude Desktop

sorting · greedy · optimization

The organizer’s problem statement is available at the official source link.

price sweep

Revenue changes only at customer budgets

At price p, customers with budget at least p buy the app. Revenue is p times that eligible-customer count.

State table
Candidate price pEligible customersRevenue
pcount(budget >= p)p * count(budget >= p)
all candidate pcustomers who can afford pmaximum revenue
  1. 1

    Sort budgets

    Sort the budgets from low to high.
  2. 2

    Try candidate prices

    For each distinct candidate price, count customers whose budgets still cover it.
  3. 3

    Maximize revenue

    Keep the largest price-times-count revenue.
Tools
1
2
3
4
5
6
7
8
9
10
11
12
Draft saved locally
|12 lines, 156 chars

Run output

Run your code to see output.