1 solutions
-
0
用了一些奇技淫巧,这题严格看我的做法没考虑完,所以是错的,稍加修改即可,能过应该是数据问题
#include<iostream> #include<algorithm> using namespace std; const int N=1e5+7; int a[N]; bool cmp(int x,int y){ return x>y; } int main(){ int n; cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; } //此处应该添加一步求所有数的最大公约数 sort(a,a+n,cmp);//然后这里的a[0]应该除以最大公约数 if((a[0]-n)%2==1)cout<<"Alice"; else cout<<"Bob"; return 0; }
- 1
Information
- ID
- 304
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 5
- Tags
- # Submissions
- 38
- Accepted
- 16
- Uploaded By