#include<iostream> #include<cstdio> #include<cstring> using namespace std; int s[100005]; int vis[100005]; int re,l; int main() { int n; scanf( for(int i=1;i<=n;i++) { scanf( } 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= if(tmp==0) vis[i]=vis[re]; else vis[i]=vis[tmp]; continue; } int tmp= 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