QOJ.ac

QOJ

Límite de tiempo: 1.0 s Límite de memoria: 32 MB Puntuación total: 80

#16375. 小麦

Estadísticas

我们的主角 Mirko 和 Slavko 每年都会在圣露西节(Saint Lucy's Day)种植圣诞小麦。众所周知,麦秆的生长速度各不相同,因此一段时间后,小麦会变得参差不齐。 他们决定通过玩以下游戏来解决这个问题:

  • 轮到 Mirko 时,他选择一根高度最小的麦秆,并将其拉长,使其高度与比它高的麦秆中高度最小的(即第一根比它高的麦秆)相同。
  • 轮到 Slavko 时,他选择一根高度最大的麦秆,并将其剪短,使其高度与比它矮的麦秆中高度最大的(即第一根比它矮的麦秆)相同。
  • 只要麦秆中存在至少三种不同高度,游戏就会继续进行。无法进行操作的玩家输掉游戏。

给定所有麦秆的初始高度,并假设 Mirko 先手,请确定游戏的获胜者,以及游戏结束时最短和最长麦秆的高度。

输入格式

第一行包含一个整数 $N$($1 \le N \le 10^5$),表示麦秆的数量。

第二行包含 $N$ 个空格分隔的整数,表示每根麦秆的初始高度。每根麦秆的高度均不超过 $10^5$。

输出格式

第一行输出一个字符串。如果 Mirko 获胜,输出 Mirko;如果 Slavko 获胜,输出 Slavko

第二行输出两个整数,表示游戏结束时最短和最长麦秆的高度。

数据范围

  • 对于 $50\%$ 的测试数据,满足 $N \le 500$。
  • 对于 $80\%$ 的测试数据,满足 $N \le 3000$。

样例

样例输入 1

3
3 3 3

样例输出 1

Slavko
3 3

样例输入 2

4
3 1 2 1

样例输出 2

Slavko
1 2

样例输入 3

7
2 1 3 3 5 4 1

样例输出 3

Slavko
2 3

说明

样例 1 说明:Mirko 无法进行操作,因为麦秆中没有三种不同的高度。因此,Slavko 获胜。

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.