//2013 lie absolutely
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector<int>pp;
bool cmp(int a,int b)
{
return a > b;
}
int main()
{
int n;
cin >> n;
getchar();
for (int i = 0; i < n - 1; i++)
{
int x;
cin >> x;
pp.push_back(x);
}
sort(pp.begin(), pp.end(), cmp);
int t = 1;
for (int i = 0; i < n - 1; i++)
{
if (pp[i] <= 0)
{
cout << "Lie absolutely" << endl;
t = 0;
break;
}
int m = pp[i];
for (int j = i + 1; j < m+i&&j<pp.size(); j++) //j的条件不要忘了小于vector的size,不然内存溢出,vector subscript out of range
{
pp[j]--;
}
}
if (t)
cout << "maybe truth" << endl;
return 0;
}
hdu 笔试2013主持人
最新推荐文章于 2024-09-01 16:42:17 发布