fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int q;
  6. cin>>q;
  7. while(q--)
  8. {
  9. string s,t,p;
  10. cin>>s>>t>>p;
  11. int n=s.length();
  12. int m=t.length();
  13. int z=p.length();
  14. string h;
  15. while(n!=m)
  16. {
  17. for(int i=0;i<m;i++)
  18. {
  19. for(int j=0;j<z;j++)
  20. {
  21. if(t[i]==p[j])
  22. h[i]=p[j];
  23. }
  24. }
  25. }
  26. s.append(h);
  27. }
  28. return 0;
  29. }
Time limit exceeded #stdin #stdout 5s 4360KB
stdin
1
a
aaaa
aaabbcc
stdout
Standard output is empty