Temotoloraia's blog

By Temotoloraia, history, 2 years ago, In English

Does anyone know the live standings of IZhO 2022?

Full text and comments »

  • Vote: I like it
  • +82
  • Vote: I do not like it

By Temotoloraia, history, 2 years ago, In English

Can anyone solve this? Problem G

Full text and comments »

  • Vote: I like it
  • +16
  • Vote: I do not like it

By Temotoloraia, history, 3 years ago, In English

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.

Full text and comments »

  • Vote: I like it
  • +23
  • Vote: I do not like it

By Temotoloraia, history, 3 years ago, In English

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.

Full text and comments »

  • Vote: I like it
  • +25
  • Vote: I do not like it

By Temotoloraia, history, 5 years ago, In English

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

Full text and comments »

  • Vote: I like it
  • +17
  • Vote: I do not like it