G - Game of Nuts URAL - 2068 (博弈)

G - Game of Nuts

 URAL - 2068 

The war for Westeros is still in process, manpower and supplies are coming to an end and the winter is as near as never before. The game of thrones is unpredictable so Daenerys and Stannis decided to determine the true ruler of Seven Kingdoms playing more predictable and shorter game. For example, the game of nuts is the ideal candidate.

Rules of this game are quite simple. Players are given n heaps of nuts. There is an odd number of nuts in each heap. Players alternate turns. In each turn player chooses an arbitrary heap and divides it into three non-empty heaps so as there is again an odd number of nuts in each heap. The player who cannot make a move loses.

Daenerys has dragons so she moves first. Your task is to determine the winner assuming both Daenerys and Stannis play optimally. Please, do it and stop the war for Westeros!

Input

In the first line there is an odd integer n (1 ≤ n ≤ 777).

In the second line there are n integers separated by spaces. These are the amounts of nuts in each heap at the beginning of the game. It is guaranteed that each heap contains not less than one and not more than 54321 nuts and this amount is an odd number.

Output

Output "Daenerys" (without quotes) in case of Daenerys’ win. Otherwise output "Stannis".

Example

inputoutput
1
3
Daenerys
3
1 1 1
Stannis
5
777 313 465 99 1
Daenerys

 

 

 

#include <algorithm>
#include <iostream>
#include <cstring>
#include <vector>
#include <string>
#include <functional>
#include <cstdio>
#include <cmath>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
using namespace std;
#define ll long long
#define F first
#define S second
#define p_b push_back
#define m_p make_pair
const ll LINF = 0x3f3f3f3f3f3f3f3f;
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const int M = 1e7 + 7;
const int N = 1e6 + 7;
int main() {
	
	int n;
	scanf ("%d", &n);
	int x, ans = 0;
	for (int i = 1; i <= n; ++i) {
		scanf ("%d", &x);
		ans ^= ((x / 2) & 1);
	}
	if (ans) puts("Daenerys");
	else puts("Stannis");
	return 0;
} 

 

root过程: 关机 将手机连接电脑(连接方法:先将edl线一头连接到手机,然后用手捏住绿色和黑色线露出的铜线,不要害怕短路,没事的,然后另一头连接电脑,几秒后松开捏住的绿线和黑线,就成功进入9008线刷模式了,可以在电脑上右键此电脑-管理-设备管理器,如果看到9008的端口就代表成功了) 进入9008模式后 安装高通驱动 解压并安装QPST工具 运行Qfil 选择“Flat Build” 选择程序"Browse" 选择"prog_emmc_ufs_firehose_Sdm660_ddr.elf" 点击“Load XML”并选择“rawprogram_unsparse.xml”,然后选择“patch0.xml” 点击"Download" 等待(QFIL会通知一个错误,这是正常的) 重启手机 手机安装magisk manager 打开MagiskManager 点“安装” 注意!!!如果你的系统版本是内测版4.5版本,那就点击直接安装 如果你的系统不是4.5内测版,那就要patch对应的boot.img,否则安装后系统无法打开WiFi patch方法: 我这儿用4.2版本举例,先下载4.2版本的全量卡刷包。下载后解压出boot文件,只需解压出boot文件就行了,将boot文件复制到手机里,方法跟刚才一样,打开magisk manager,点击第二个修复镜像,选择刚才解压出的boot文件,会提示正在下载magisk v16,下载好了会自动刷入,刷入成功后手机根目录/magisk manager文件夹下会出现新的patch好的boot文件,然后我们去网上下载一个叫flashify的app,安装,打开,点刷boot,然后刷入我们刚才patch好的boot文件, 重启,OK,大功告成 注意:暂时没找到方法使用xp模块,所以不要安装刷入XP框架,否则会无限重启,无限重启,无限重启
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值