由于当时一心做T4,所以T1写成了这个:::
#include<iostream>
#include<vector>
#include <algorithm>
using namespace std;
const int maxn = 1e5;
int n, m;
string dicts[maxn];
string res;
vector< vector<int> >dicts_all;
int isspecial[maxn];
bool cmp(int x, int y)
{
return x < y;
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
cin >> n >> m;
if (m == 1)
{
for (int i = 1; i <= n; i++)
{
cout << "0";
}
}
for (int i = 1; i <= n; i++)
{
string temp = "0", _;
cin >> _; temp.append(_);
sort(temp.begin() + 1, temp.end(), cmp);
dicts[i] = temp;
}
for (int i = 1; i <= n; i++)
{
string s = dicts[i];
if (s[1] == 'a')
{
res.append("1");
}
else if (s[1] == 'z')
{
res.append("0");
}
else
{
if (((int)s[1]) < ((int)('k')))
{
res.append("1");
}
else
{
res.append("0");
}
}
}
cout << res;
return 0;
}