NC26003. Take Apples
描述
输入描述
The input contains multiple sets of data
For each test case, each line contains three integersS,M,N, separated by spaces.
输出描述
For each test case, outputs a single line with the answer.
If Alice wins, output "Alice"; If Bob wins, output "Bob" (without quotes).
示例1
输入:
1 5 3 4 4 3
输出:
Alice Alice
C++14(g++5.4) 解法, 执行用时: 4ms, 内存消耗: 340K, 提交时间: 2019-05-29 14:55:15
#include<bits/stdc++.h> using namespace std; int main(){ int s,m,n; while(~scanf("%d%d%d",&m,&n,&s)){ if(m%(s+1)==0&&n<(s+1)) puts("Bob"); else puts("Alice"); } return 0; }
C++(clang++ 11.0.1) 解法, 执行用时: 2ms, 内存消耗: 284K, 提交时间: 2022-10-18 22:11:34
#include<bits/stdc++.h> int s,n,m; int main(){ while (~scanf("%d%d%d",&m,&n,&s)) puts(m%(s+1)==0 && n<=s?"Bob":"Alice"); }