RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
COCI00332

Pšenica

Unrated 레이팅 미적용
난이도
1s
시간 제한
32MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

\(4^{th}\) round, December \(20^{th}\), 2014
Our heroes, Mirko and Slavko, plant Christmas wheat every year on Saint Lucy’s Day. It is well known
that stalks of wheat grow at different speeds so, after a certain time, the wheat becomes quite messy.
The guys are determined to solve this problem by playing the following game:
• When it’s Mirko’s turn, he chooses a stalk of wheat with the minimal height and prolongs its
height so it’s of the same height as the first stalk longer than \(it\).
• When it’s Slavko’s turn, he chooses a stalk of wheat with the maximal height and cuts it to be
of the same height as the first stalk shorter than \(it\).
• The game lasts while there are \(at\) least three stalks of different heights and the loser is the player
who can’t make his move.
For given heights of all stalks of wheat and the assumption that Mirko is the one starting the game,
determine the winner of the game and the height of the shortest and longest stalk when the game is
finished.

제약

In test cases worth 50% of total points, it will hold \(N\) ⩽500.
In test cases worth 80% of total points, it will hold \(N\) ⩽3000.
SAMPLE TEST DATA
input
input
input
3
3 3 3
4
3 1 2 1
7
2 1 3 3 5 4 1
output
output
output
Slavko
3 3
Slavko
1 2
Slavko
2 3
Clarification of the first example: Mirko can’t make his move because there are no three stalks of different
heights. Therefore, Slavko is the winner.

입력 형식

The first line of input contains the integer \(N\) (1 ⩽\(N\)\(10^{5}\)), the number of wheat stalks.
The second line of input contains \(N\) space separated integers that denote the heights of individual
wheat stalks. The height of each stalk will be less than or equal to \(10^{5}\).

출력 형식

The first line of output must contain the word “Mirko” if Mirko is the winner of the game, or “Slavko”
if Slavko is the winner of the game.
The second line of output must contain the height of the shortest and longest stalk when the game is
finished.

예제 1
입력
3
3 3 3
출력
Slavko
3 3
예제 2
입력
4
3 1 2 1
출력
Slavko
1 2
예제 3
입력
7
2 1 3 3 5 4 1
출력
Slavko
2 3
문제 정보

생성자가 기록되지 않았습니다.

출처 COCI 2014/2015 Contest 4

평가 및 의견

Pšenica

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Pšenica

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8