Untitled

 avatar
unknown
plain_text
6 months ago
1.5 kB
4
Indexable
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define EPS 1e-9
#define mod 1000000007
// #define mod 998244353
#define over 10000000000
#define sz(m) (ll)(m.size())
// #define ceil(n, m) (((n) / (m)) + ((n) % (m) ? 1 : 0))
#define fixed(n) fixed << setprecision(n)
const ll inf = 1e18 + 5;
template <typename T = int>
istream &operator>>(istream &in, vector<T> &v)
{
  for (T &i : v)
    in >> i;
  return in;
}
template <typename T = int>
ostream &operator<<(ostream &out, const vector<T> &v)
{
  for (const T &x : v)
    out << x << ' ';
  return out;
}

void lol()
{
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin), freopen("outputt.txt", "w", stdout), freopen("error.txt", "w", stderr);
#endif
}
double log(double base, double x)
{
  return (log(x) / log(base));
}

int dx[4] = {1, 0, 0, -1};
int dy[4] = {0, 1, -1, 0};

/////////////////////////////////////////////////////////

int main()
{
  lol();
  int t = 1;
  cin >> t;

  while (t--)
  {
    int n;
    cin >> n;
    vector<int> a(n), fre(26, 0);
    for (int i = 0; i < n; i++)
      cin >> a[i];

    for (int i = 0; i < n; i++)
    {
      for (int j = 0; j < 26; j++)
      {
        if (fre[j] == a[i])
        {
          cout << char('a' + j);
          fre[j]++;
          break;
        }
      }
    }
    cout << '\n';
  }
}
Editor is loading...
Leave a Comment