#include<iostream> #include<cstdio> #include<cstring> using namespace std; int s[100005]; int vis[100005]; int re,l; int main() { int n; scanf("%d",&n); for(int i=1;i<=n;i++) { scanf("%d",&s[i]); } s[0]=s[1]; for(int i=1;i<=n;i++) { if(s[i]!=s[i-1]) { re=s[i]; if(i==s[i]) { vis[i]=1; continue; } int tmp=i%re; if(tmp==0) vis[i]=vis[re]; else vis[i]=vis[tmp]; continue; } int tmp=i%s[i]; if(tmp==0) vis[i]=vis[s[i]]; else vis[i]=vis[tmp]; } for(int i=1;i<=n;i++) { if(vis[i]==0) printf("a"); else printf("b"); } return 0; }
Comments NOTHING