题解 | 大撒币

大撒币

https://www.nowcoder.com/practice/ff0f60d80ee94d94aba959b2b4c1941a

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int xtot = 0;
    int ytot = 0;
    int cnt = 1;
    int a, b, r;
    cin >> a >> b >> r;
    a /= 2;
    b /= 2;
    if (r > a && r > b)
    {
        cout << "Bob";
        return 0;
    }
    while (1)
    {
        xtot += r;
        ytot += r;
        !cnt;
        if (xtot > a || ytot > b)
            break;
    }
    if (cnt)
        cout << "Alice";
    else
        cout << "Bob";
    return 0;
}

不会博弈论喵,模拟喵

全部评论

相关推荐

评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务