302832: CF549C. The Game Of Parity
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
The Game Of Parity
题意翻译
### 题目描述 维斯特洛有n个城市。第i个城市住着啊a[i]个人。 丹妮莉丝和史坦尼斯玩了下面的游戏: 在一次移动中,玩家选择一个特定的城镇,并把它摧毁。不幸的是,其中所有的居民都死了(~~残忍~~)。由史坦尼斯开始比赛。当维斯特洛还剩下k个城市时,游戏就结束了。 预言说,如果幸存居民的总数是偶数,那么丹妮莉丝赢了:史坦尼斯被斩首,丹妮莉丝登上了铁王座。如果幸存居民的总数是奇数,史坦尼斯赢了,一切都朝着相反的方向发展。 培提尔·贝里席勋爵想知道他应该支持哪位王位候选人,因此他想知道,哪位候选人有获胜的策略。回答贝里席勋爵的问题,也许你会成为下一个勋爵。 ### 输入输出格式 输入 第一行包含两个空格分隔的整数,n和k(1 < = k < = n < = 2^105)分别表示最初的维斯特洛的城市和游戏结束时的城市数量。 第二行包含n个数a[i] (1 < = ai < = 106),它代表了在维斯特洛每个城市的人口。 ### 说明 在第一个样例中,史坦尼斯将摧毁一个只有两个人的城市,丹妮莉丝将只能摧毁一个只有一个居民的城市。唯一的幸存者城市将只剩下一个居民,也就是说,总数是奇数,因此史坦尼斯赢了。 在第二个样例中,如果史坦尼斯摧毁一个两个人的城市,丹妮莉丝将摧毁一个只有一个居民的城市,反之亦然。无论如何,最后剩下的城市将会有两个人居住,也就是说,总人数是偶数,因此丹妮莉丝赢了。题目描述
There are $ n $ cities in Westeros. The $ i $ -th city is inhabited by $ a_{i} $ people. Daenerys and Stannis play the following game: in one single move, a player chooses a certain town and burns it to the ground. Thus all its residents, sadly, die. Stannis starts the game. The game ends when Westeros has exactly $ k $ cities left. The prophecy says that if the total number of surviving residents is even, then Daenerys wins: Stannis gets beheaded, and Daenerys rises on the Iron Throne. If the total number of surviving residents is odd, Stannis wins and everything goes in the completely opposite way. Lord Petyr Baelish wants to know which candidates to the throne he should support, and therefore he wonders, which one of them has a winning strategy. Answer to this question of Lord Baelish and maybe you will become the next Lord of Harrenholl.输入输出格式
输入格式
The first line contains two positive space-separated integers, $ n $ and $ k $ ( $ 1<=k<=n<=2·10^{5} $ ) — the initial number of cities in Westeros and the number of cities at which the game ends. The second line contains $ n $ space-separated positive integers $ a_{i} $ ( $ 1<=a_{i}<=10^{6} $ ), which represent the population of each city in Westeros.
输出格式
Print string "Daenerys" (without the quotes), if Daenerys wins and "Stannis" (without the quotes), if Stannis wins.
输入输出样例
输入样例 #1
3 1
1 2 1
输出样例 #1
Stannis
输入样例 #2
3 1
2 2 1
输出样例 #2
Daenerys
输入样例 #3
6 3
5 20 12 7 14 101
输出样例 #3
Stannis