Date

Words

Pictures

Share

PLASMA MAGAZINE

Published in Issue Nr. 3
Order now!

Mostly Viewed By Cows

»Paintings Roughly Reflecting On Humans And Human Habits, But Mostly Viewed By Cows«

…was an exhibition with figurative paintings by Ulrich Wulff, Tanja Ritterbex, Sasha Ross, Louisa Gagliardi, Hamishi Farah, Charles Irvin, Beni Bischof, Bora Akinciturk, Alex Rathbone, Anne Fellner, Adam Cruces, conceptualized and curated by Paul Barsch that took place in a working cowshed in the remote valley Safiental of the Swiss Alps. The artworks where observed by an animalistic audience from Oktober 16 until December 31 2017.

The exhibition was kindly supported by Art Safiental. www.mostlyviewedbycows.net

문제

Depending on their milk output, each of the N (1 <= N <= 1,000) cows is assigned a ‘privilege number’ of 1, 2, or 3 that dictates whether they get to drink water at the well earlier (privilege number 1) or later. The cows, of course, never remember their privilege numbers until the Farmer admonishes them.

Thus, the cows are lined up in some order and must re-align themselves so that all the privilege number 1’s are together at the front of the line, 2’s follow, and 3’s are together at the end of the line.

Cows, as we are so often reminded, are lazy.  What is the minimum number of exchanges that can take place to sort the cows properly?

입력

Line 1: A single integer: N

Lines 2..N+1: Line i+1 contains a single integer that is the privilege number of the cow at place i in line

출력

Line 1: A single integer that is the minimum number of exchanges required to order the cows properly

예제 입력 복사

9
2
2
1
3
3
3
2
3
1

예제 출력 복사

4

힌트

Here is one way:

2   2   2< 1   1
2< 1   1   1   1
1< 2   2   2   2
3   3< 2   2   2
3   3   3   3< 2
3   3   3   3   3
2   2< 3   3   3
3   3   3   3   3
1   1   1< 2< 3

 

Figures:

2 Tanja Ritterbex, Ulrich Wulff, Sasha Ross

3 Installation view

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close