来源:点击打开链接
很简单,找规律。
每去掉一个点,点的总数量就减去n+m-1,然后看谁最先减到没有点可减,就可以了。
#include <iostream> #include <cstring> using namespace std; int main() { int n,m; cin>>n>>m; int totalpoint=n*m; int count=0; while(totalpoint>0) { totalpoint-=(n+m-1); n--; m--; count++; } if(count%2==0) cout<<"Malvika"<<endl; else cout<<"Akshat"<<endl; return 0; }
【找规律】CodeForce #258 Problem A——Game With Sticks,布布扣,bubuko.com
【找规律】CodeForce #258 Problem A——Game With Sticks
原文地址:http://blog.csdn.net/mig_davidli/article/details/38124893