Блог пользователя Temotoloraia

Автор Temotoloraia, история, 2 года назад, По-английски

Does anyone know the live standings of IZhO 2022?

Полный текст и комментарии »

  • Проголосовать: нравится
  • +82
  • Проголосовать: не нравится

Автор Temotoloraia, история, 2 года назад, По-английски
  • Проголосовать: нравится
  • +16
  • Проголосовать: не нравится

Автор Temotoloraia, история, 3 года назад, По-английски

Can anyone solve this?

You are given array a1...n. We want to make a zero-array(array consisting only of zeroes) from it. You have 3 buttons:

1-button) Take an element ai, replace it with integer x such that |x−ai|≤1. The cost of using this button is 1 gold. 2-button) Take a range [l…r], increase all elements in this range by 1. The cost of using this button is X gold. 3-button) Take a range [l…r], decrease all elements in this range by 1. The cost of using this button is X gold. Find the minimum total gold to achieve zero-array. Input The first line contains two numbers n and X (1≤X≤n≤1000000).

The second line contains n numbers a1,a2,…,an(1≤ai≤1000000000) — array a.

Output Print a single integer — the minimum amount of gold to reach the zero-array.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +23
  • Проголосовать: не нравится

Автор Temotoloraia, история, 3 года назад, По-английски

Hi guys. Let's discuss this problem:

An array is good if the maximum element is no longer than the length.

The cost of the array is the length squared.

Divide the given array into several disjoint continuous parts so that each part is good and the total cost of all parts is the lowest possible.

Input In the first line, the positive integer n (1≤n≤100000) — the size of the array.

The next line contains n integers a1,a2,…,an(1≤ai≤n) Output Print the minimum possible total cost of all parts.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +25
  • Проголосовать: не нравится

Автор Temotoloraia, история, 5 лет назад, По-английски

Hi guys. Let's discuss IOI 2019 practice problems. How to solve second problem "Job Scheduling" ?

Полный текст и комментарии »

  • Проголосовать: нравится
  • +17
  • Проголосовать: не нравится