Skip to main content
  1. Posts/

BZOJ 1660: [Usaco2006 Nov]Bad Hair Day 乱发节 (单调栈)

Note: This article is available in Chinese only. 本文暂无英文版本。 View original

Related

codeforces 442C. Artem and Array

·1 min
C. Artem and Array time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Artem has an array of n positive integers. Artem decided to play with it. The game consists of n moves. Each move goes like this. Artem chooses some element of the array and removes it. For that, he gets min(a, b) points, where a and b are numbers that were adjacent with the removed number. If the number doesn’t have an adjacent number to the left or right, Artem doesn’t get any points.