CodeForces 451A

签到题,今天就水了这么一道题,不好意思说了。。。

#include<iostream>
using namespace std;

int main()
{
    int a,b;
    cin >> a>> b;
    int c = a<b?a:b;
    if(c%2 == 0)
    cout<< "Malvika"<< endl;
    else cout<<"Akshat" << endl;

    return 0;
}

CodeForces 451A

时间: 2024-08-09 19:53:50

CodeForces 451A的相关文章

Codeforces 451A Game With Sticks

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 nhorizontal and m vertical sticks. An intersection point is any point on the grid which is formed by the in

CSU-ACM暑假集训基础组训练赛(2) 解题报告

Problem A Codeforces 451A •题意:给你n+m根筷子,将他们分别水平.垂直放置,形成n*m个节点.两个人轮流选择一个点,将穿过这个点的两根筷子拿走,谁可以逼迫对方率先无法继续操作,谁就获胜,问获胜的是先手还是后手. •找规律即可.n,m中较小的那个数是奇数,先手胜,否则后手胜. 1 #include <cstdio> 2 int main(){ 3 int a,b; 4 scanf("%d%d",&a,&b); 5 a = a <

【模拟】【codeforces】451A Game With Sticks

http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=52106 现在有n根横着的木棍,m根竖着的木棍,交叉出n*m个交点 两个玩家轮流从现有交点中选择一个,并去掉和这个交点相连的木棍 当一个玩家没有木棍可以去掉时,另外一位玩家获胜 获胜的关键就是使对方没有木棍,或对方的木棍只有横的或竖的木棍,以致没有交点可以选择. 在最开始,每人选择一个点,都是去掉一横一竖,当去掉一个方向全部的木棍时,就赢了. 1 #include<bits/

【math】【codeforces】451A Predict Outcome of the Game

http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=52099 有三只球队,一共有n场比赛,然后现在进行了k场,不知道输赢,只知道第一和第二的分数差是d1,第二和第三的分数差是d2, 问这样比赛是不是可能出现平局,注意每一场比赛没有平局. 如果n%3 != 0,肯定不会使得三个队伍平手,输出“no”. 设三个队在前K场比赛中分别赢了x1,x2,x3场,有|x1 - x2| = d1, | x2 - x3| = d2. 由于d1,

Codeforces Round #258 (Div. 2) 小结

A. Game With Sticks (451A) 水题一道,事实上无论你选取哪一个交叉点,结果都是行数列数都减一,那如今就是谁先减到行.列有一个为0,那么谁就赢了.因为Akshat先选,因此假设行列中最小的一个为奇数,那么Akshat赢,否则Malvika赢. 代码: #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace

Codeforces Round #258

A.Game With Sticks 就发现选定一个点之后,会删除相应的行列,即n-1,m-1,所以只需要看min(n,m)是基是偶 #include <iostream> #include <cstdio> #include <cstdlib> using namespace std; int n, m; int main() { #ifdef LOCAL freopen("451A.in", "r", stdin); #end

【codeforces 718E】E. Matvey&#39;s Birthday

题目大意&链接: http://codeforces.com/problemset/problem/718/E 给一个长为n(n<=100 000)的只包含‘a’~‘h’8个字符的字符串s.两个位置i,j(i!=j)存在一条边,当且仅当|i-j|==1或s[i]==s[j].求这个无向图的直径,以及直径数量. 题解:  命题1:任意位置之间距离不会大于15. 证明:对于任意两个位置i,j之间,其所经过每种字符不会超过2个(因为相同字符会连边),所以i,j经过节点至多为16,也就意味着边数至多

Codeforces 124A - The number of positions

题目链接:http://codeforces.com/problemset/problem/124/A Petr stands in line of n people, but he doesn't know exactly which position he occupies. He can say that there are no less than a people standing in front of him and no more than b people standing b

Codeforces 841D Leha and another game about graph - 差分

Leha plays a computer game, where is on each level is given a connected graph with n vertices and m edges. Graph can contain multiple edges, but can not contain self loops. Each vertex has an integer di, which can be equal to 0, 1 or  - 1. To pass th