一个简单的打表问题
#include <bits/stdc++.h> using namespace std; int dp[100005]; int main() { int t,a,b; cin>>t>>a>>b; if(t==0){ cout<<"Bob"<<endl; return 0; } for(int i = 1;i<=a;i=i+2) dp[i] = 1; for(int i = a+1;i<=t;i++) { if(dp[i-1]==0)dp[i] = 1; else{ for(int j = a+1;(j<=b+1)&&(i-j>=0);j++) if(dp[i-j]==0){ dp[i]=1; break; } } } if(dp[t])cout<<"Alice"<<endl; else cout<<"Bob"<<endl; return 0; }