| # |
Author |
Problem |
Lang |
Verdict |
Time |
Memory |
Sent |
Judged |
|
| 245108143 |
Contestant:
jianhe |
1927B
- 9
|
C++17 (GCC 7-32)
|
Accepted
|
77 ms
|
7220 KB
|
2024-02-06 18:00:08 |
2024-02-07 11:57:07 |
|
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const ll N=2e5+10;
ll T,n,a[N];
char c,tt;
vector<char> p[N];
int main(){
ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
cin>>T;
while(T--){
cin>>n;
for(int i=1;i<=n;i++) cin>>a[i],p[i].clear();
c='a';
for(int i=1;i<=n;i++){
if(!a[i]) cout<<(char)(c++),tt=c-1;
else{
ll t=p[a[i]-1].size();
cout<<p[a[i]-1][t-1];
tt=p[a[i]-1][t-1];
p[a[i]-1].pop_back();
}
p[a[i]].push_back(tt);
}
cout<<"\n";
}
return 0;
}
Click to see test details