A. Game With Sticks

题目连接:

http://codeforces.com/contest/451/problem/A

Description

After winning gold and silver in IOI 2014, Akshat and Malvika want to have some fun. Now they are playing a game on a grid made of n horizontal and m vertical sticks.

An intersection point is any point on the grid which is formed by the intersection of one horizontal stick and one vertical stick.

In the grid shown below, n = 3 and m = 3. There are n + m = 6 sticks in total (horizontal sticks are shown in red and vertical sticks are shown in green). There are n·m = 9 intersection points, numbered from 1 to 9.

The rules of the game are very simple. The players move in turns. Akshat won gold, so he makes the first move. During his/her move, a player must choose any remaining intersection point and remove from the grid all sticks which pass through this point. A player will lose the game if he/she cannot make a move (i.e. there are no intersection points remaining on the grid at his/her move).

Assume that both players play optimally. Who will win the game?

Input

The first line of input contains two space-separated integers, n and m (1 ≤ n, m ≤ 100).

Output

Print a single line containing "Akshat" or "Malvika" (without the quotes), depending on the winner of the game.

Sample Input

2 2

Sample Output

Malvika1

Hint

题意

有n根横着的筷子,m根竖着的筷子,会相交出nm个交点,然后现在两个人依次玩这个游戏,每次这个人选择一个点,然后就会把穿过这个点的筷子都拿掉。

哪个人不能操作的时候,就判断这个人输掉了。

问最后谁会胜利。

题解:

取min之后,判断奇偶性就好了~

代码

#include<bits/stdc++.h>
using namespace std; int main()
{
int n,m;
scanf("%d%d",&n,&m);
n=min(n,m);
if(n%2)printf("Akshat\n");
else printf("Malvika\n");
}

Codeforces Round #258 (Div. 2) A. Game With Sticks 水题的更多相关文章

  1. Codeforces Round #258 (Div. 2) D. Count Good Substrings 水题

    D. Count Good Substrings 题目连接: http://codeforces.com/contest/451/problem/D Description We call a str ...

  2. Codeforces Round #297 (Div. 2)A. Vitaliy and Pie 水题

    Codeforces Round #297 (Div. 2)A. Vitaliy and Pie Time Limit: 2 Sec  Memory Limit: 256 MBSubmit: xxx  ...

  3. Codeforces Round #290 (Div. 2) A. Fox And Snake 水题

    A. Fox And Snake 题目连接: http://codeforces.com/contest/510/problem/A Description Fox Ciel starts to le ...

  4. Codeforces Round #322 (Div. 2) A. Vasya the Hipster 水题

    A. Vasya the Hipster Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/581/p ...

  5. Codeforces Round #373 (Div. 2) B. Anatoly and Cockroaches 水题

    B. Anatoly and Cockroaches 题目连接: http://codeforces.com/contest/719/problem/B Description Anatoly liv ...

  6. Codeforces Round #368 (Div. 2) A. Brain's Photos 水题

    A. Brain's Photos 题目连接: http://www.codeforces.com/contest/707/problem/A Description Small, but very ...

  7. Codeforces Round #359 (Div. 2) A. Free Ice Cream 水题

    A. Free Ice Cream 题目连接: http://www.codeforces.com/contest/686/problem/A Description After their adve ...

  8. Codeforces Round #355 (Div. 2) A. Vanya and Fence 水题

    A. Vanya and Fence 题目连接: http://www.codeforces.com/contest/677/problem/A Description Vanya and his f ...

  9. Codeforces Round #258 (Div. 2/A)/Codeforces451A_Game With Sticks

    解题报告 http://blog.csdn.net/juncoder/article/details/38102263 n和m跟木棍相交,问一人取一交点(必须是交点.且取完后去掉交点的两根木棍),最后 ...

随机推荐

  1. bzoj千题计划209:bzoj1185: [HNOI2007]最小矩形覆盖

    http://www.lydsy.com/JudgeOnline/problem.php?id=1185 题解去看它 http://www.cnblogs.com/TheRoadToTheGold/p ...

  2. python 的print和特殊方法 __str__和__repr__

    先提出一个疑问,为什么print函数可以直接打印参数呢?即使是数字?例如print 1,就会打印1.我们知道1的类型是整型(题外话,在python中1是常量,也是类int的对象,而java中1只是常量 ...

  3. 乘法逆元(P3811)(四种方法)

    适合单个的,费马小定理,exgcd,都是不错的选择,利用积性函数的方法和欧拉筛的方法适合批量求,但是论时间和空间的话,还是积性函数的方法比较好用,线性的. 题目链接:https://www.luogu ...

  4. MySQL用户密码过期登陆报错ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

    今天接到主从复制失败告警,查看MySQL,发现MySQL能够登陆但是执行命令报错, ERROR 1820 (HY000): You must reset your password using ALT ...

  5. CodeSmith的基础模版类(CodeSmith help中的内容)

    基础模版类类型描述: Batch      OutputFileCodeTemplate  模版通过继承此类能够在生成过程中把他们的输出保存到文件中 ScriptError    在脚本执行中出现一个 ...

  6. mysql 字符编码设置

    安装mysql时如果字符编码为默认值latin1,则需要修改为utf8以便支持中文数据. 命令如下: 1.显示数据库字符集 mysql> show create database test;+- ...

  7. 解决urbuntu桌面本客户端输入ll command not found

    用桌面版的urbuntu系统,打开客户端输入ll,报错如下 于是度娘,解决方案:可以作如下修改:打开 ~/.bashrc 找到 #alias ll=’ls -l’,去掉前面的#就可以了.(关闭原来的终 ...

  8. Java基础85 MVC开发模式

    1.MVC开发模式 本文用 Servlet+JSP+javaBean 的开发模式来讲解 Model:用javabean实现,用于封装业务数据View:用jsp实现,用于显示数据Controller:用 ...

  9. 动态规划(dp)专题

    航线设置   问题描述在美丽的莱茵河畔,每边都分布着N个城市,两边的城市都是唯一对应的友好城市,现需要在友好城市间开通航线以加强往来,但因为莱茵河常年大雾,如果开设的航线发生交叉就有可能出现碰船的现象 ...

  10. C printf按8进制、10进制、16进制输出以及高位补0

    ; /*按整型输出,默认右对齐*/ printf("%d\n",PrintVal); /*按整型输出,补齐4位的宽度,补齐位为空格,默认右对齐*/ printf("%4d ...