Sushi

AtCoder
IDs8pc_3_f
Time3000ms
Memory256MB
Difficulty
There are $N$ customers in a restaurant. Each customer is numbered $1$ through $N$. A sushi chef carried out $Q$ operations for customers. The $i$-th operation is follows: 1. The sushi chef chooses a customer whose number of dishes of sushi eaten is minimum, in customer $1, 2, 3, \\dots, a_i$. If there are multiple customers who are minimum numbers of dishes, he selects the minimum-numbered customers. 2. He puts a dish of sushi on the selected seats. 3. A customer who have selected for professional eats this sushi. 4. Repeat 1-3, $b_i$ times. Please calculate the number of dishes of sushi that have been eaten by each customer. [samples]
API Response (JSON)
{
  "problem": {
    "name": "Sushi",
    "description": {
      "content": "There are $N$ customers in a restaurant. Each customer is numbered $1$ through $N$.   A sushi chef carried out $Q$ operations for customers.      The $i$-th operation is follows:   1.  The sushi chef",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 3000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "s8pc_3_f"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "There are $N$ customers in a restaurant. Each customer is numbered $1$ through $N$.  \nA sushi chef carried out $Q$ operations for customers.  \n  \nThe $i$-th operation is follows:  \n\n1.  The sushi chef...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments