题目:
Adrien and Austin are playing a game with rocks.
Initially, there are N rocks, indexed from 1 to N. In one move, the player chooses at least 1 and at most
K consecutively indexed rocks (all of them should not have been removed) and removes them from the
game.
Adrien always starts the game, and then Adrien and Austin take turns making moves. The player who is
unable to make a move (because all rocks are removed) loses.
Given N, K, find who is going to win the game (assuming they are smart and are playing optimally).
Input
The first line contains two integers N, K (0 ≤ N ≤ 106
, 1 ≤ K ≤ 106).
Output
Print a name (“Adrien” or “Austin”, without the quotes) — the person who is going to win the game.
Examples
1 1 Adrien
9 3 Adrien

题意:有n个石子,标号为1到n,在每一次的移动中,移动【1,k】连续的石子,当石子不能移动时为输
思路:当n==0时,Ad必输;
当n!=0时, 当k>=n时,Ad可以直接拿走所有的石子
当n为奇数时,Ad可以拿走中间的石子,然后Au拿多少,Ad拿多少,Ad赢;
当n为偶数时,Ad可以拿走中间的两个,然后Au拿多少,Ad拿多少,Ad赢(当k为1时,Ad必输)

#include<bits/stdc++.h>
using namespace std;
int main(){int n,k;cin>>n>>k;int flag;if(k>=n&&n!=0) flag=1;else{if(n==0) flag=2;if(n%2==1){flag=1;}if(n%2==0&&n!=0){if(k==1){flag=2;}elseflag=1; } }if(flag==1)printf("Adrien\n");else {printf("Austin\n");}
}

Adrien and Austin相关推荐

  1. 2018-2019 ACM-ICPC, Asia Nanjing Regional Contest

    https://codeforces.com/gym/101981 Problem A. Adrien and Austin 贪心,注意细节 f[x]=1:先手必赢. f[x]: 分成两部分(或一部分 ...

  2. 2018-2019 ACM-ICPC, Asia Nanjing Regional Contest题解

    以下所有AC题解程序来自"仙客传奇"团队. AC题数:6/13 ADGIJK A. Adrien and Austin AC的C++语言程序: #include <iostr ...

  3. OpenStack Austin 峰会观察:OpenStack as IaaS 已是过去,Solutions on OpenStack 才是未来

    虽然搞 OpenStack 前后也有几年,但是今年在美国 Austin 举办的 OpenStack Summit 我还是第一次参加.回来之后,一直还在回味,觉得要写点东西,将我在这次峰会上的观察和思考 ...

  4. 拜读近五年UT Austin Villa发表的RoboCup仿真3D论文

    前言: UT Austin Villa是近几年Robocup仿真3D项目中稳稳当当的世界冠军,他们每年拿了冠军之后都会发1到2篇论文来阐述他们的进步,其论文内容已经形成了固定模板.首先是Introdu ...

  5. 编译Austin AGL部分代码

    编译Austin AGL部分代码[根据自己的需求编写的] 安装步骤: 如果在编译过程中出现了任何问题,建议直接清除以前所做的一切,包括生成的目录和文件,从头开始重新配置编译. 参考链接: 安装步骤: ...

  6. OpenStack Cinder发展动态系列--Austin峰会

    在Mitaka版本,Cinder团队在多个特性和领域取得了重大进展. 本文将做一个简要的介绍:关于在Mitaka版本已经完成的功能和特性,以及讨论在Newton版本将会开发的功能和特性. 1 Cind ...

  7. 图像处理与计算机视觉资源汇总——论文+代码+教材+视频等等

    历时一个多月,终于用业余时间把这些资料整理出来了,总算了却了一块心病,也不至于再看着一堆资料发愁了.以后可能会有些小修小补,但不会有太大的变化了.万里长征走完了第一步,剩下的就是理解和消化了.借新浪i ...

  8. 计算机视觉与模式识别方面的代码code

    UIUC的Jia-Bin Huang同学收集了很多计算机视觉方面的代码,链接如下: https://netfiles.uiuc.edu/jbhuang1/www/resources/vision/in ...

  9. CVPR 2015 papers

    CVPR 2015  CVPR 2015的文章可以下载了,如果链接无法下载,可以在Google上通过搜索paper名字下载(友情提示:可以使用filetype:pdf命令). Going Deeper ...

最新文章

  1. DARPA发布战略框架文件旨在 为美国国家安全创建突破性新技术能力
  2. web前端学习day_03:JavaScript:如何使用/ 语法/ 方法/ NaN/ js对象分类/ BOM浏览器相关/ 事件/ DOM文档对象模型
  3. log4jdbc oracle,通过weblogic配置log4jdbc数据源,在项目中使用该数据源,输出sql
  4. 原理图框图_GW1N9芯片测评之GW1N Zero原理图、3D模型及PCB设计(二)
  5. H3C PBR实验(策略路由)
  6. java项目 分模块管理_java 工程项目模块划分及各模块功能梳理
  7. U-boot移植方法
  8. Whois接口查询文档
  9. MOS管(场效应管)工作原理,及反向导通应用
  10. 什么因素影响无刷马达绕线机的精度
  11. 【CodeWars】Path Finder #2: shortest path
  12. python搭建qt开发环境_QT开发环境搭建(Windows)
  13. PYNQ官方镜像配置
  14. 国家信息系统安全等级保护基本要求——等保一级、二级、三级、四级内容
  15. 【Dubbo】dubbo 2.6.x 的dubbo-admin管理平台的搭建
  16. HashKey2019数字资产全球峰会将于3月21日在香港召开
  17. 期末小结(一). 专业技术
  18. ettercap dns欺骗
  19. Google Drive文件下载
  20. 深圳聚惠企业 2017年春节假期通告!!!

热门文章

  1. php strtotime 3天后,php strtotime 问题
  2. java中的CountDownLatch(共享锁)与ReentrantLock(排他锁)
  3. 如何去掉超链接的下划线
  4. ArcGIS网络分析之常见问题分析、诊断篇
  5. 做聊天机器人平台就是赌博
  6. 平面方程的几种形式及推导过程(总结)
  7. opencv null pointer (null name string) in cvNamedWindow
  8. TCP/IP学习(四)TCP缓冲区大小及限制
  9. 小满Vue3第四十五章(Vue3 Web Components)
  10. 0924-安徽省选 2002-哈利●波特与魔法石