洛谷P13800

用期望大小代替比较概率大小
对于一个从1到n的骰子,他的期望是1/n*(1+2+3+...+n)=(n+1)/2,

include <bits/stdc++.h>

using namespace std;

define int long long

int a[200010];
const int mod=998244353;
void solve()
{
int n,m,i,j,x;
cin >> n >> m;
int ans=0,res=0;
for(i=0;i<n;i++)
{
cin >> x;
ans+=x+1;
}
for(i=0;i<m;i++)
{
cin >> x;
res+=x+1;
}
if(ans>res)
cout << "ALICE\n";
else if(ans==res)
cout << "TIED\n";
else cout << "BOB\n";
return ;
}
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
//int t;
//cin >> t;
//while (t--)
solve();
return 0;
}

posted @ 2026-06-02 17:21  thy825  阅读(9)  评论(0)    收藏  举报