MaxCounters
-
์ํ๋ฅผ ์ต์ํํ ์๊ณ ๋ฆฌ์ฆAlgorithm 2021. 7. 24. 11:29
์๋ ๋ฌธ์ ๋ ์ฝ๋๋ฆฌํฐ์์ ์ ๊ณตํ๋ MaxCounters์ ๋ฌธ์ ์ ๋๋ค๐ง๐ป๐ป ๋ฌธ์ ์ ์ You are given N counters, initially set to 0, and you have two possible operations on them: increase(X) − counter X is increased by 1, max counter − all counters are set to the maximum value of any counter. A non-empty array A of M integers is given. This array represents consecutive operations: if A[K] = X, such that 1 ≤ X ≤ N, then operation K is..