1> Fast Read
100->75
Perhaps not long number, 1000, or such number, with fast read but slow?
Otherwise this is called slow reading?
inline int read() { int x=0;char c=getchar(); while(c<'0' || c>'9') c=getchar(); while(c>='0'&&c<='9') x=(x<<1)+(x<<3)+c-'0',c=getchar(); return x; }
2>
100->90
for(int i=1;i<=n;i++) { int cnt=mp[s[i]]; if(cnt==p && mp[fz(s[i])]==q) s[sum++]=s[i]; else if(cnt==q && mp[fz(s[i])]==p) s[sum++]=fz(s[i]); }
for(int i=1;i<=n;i++) { string t=fz(s[i]); int cnt=mp[s[i]],cnt2=mp[t]; if(cnt==p && cnt2==q) s[sum++]=s[i]; else if(cnt==q && cnt2==p) s[sum++]=t; }
Continually updated
inline int read() { int x=0;char c=getchar(); while(c<'0' || c>'9') c=getchar(); while(c>='0'&&c<='9') x=(x<<1)+(x<<3)+c-'0',c=getchar(); return x; }