fork(2) download
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int t,n;
  9. char c;
  10. cin>>t;
  11. for (int i=0;i<t;i++)
  12.  
  13. {
  14. int k=1;
  15. cin>>n;
  16. int * tabl = new int [n];
  17. for (int j=0;j<n;j++)
  18. {
  19. cin>>c;
  20. tabl[j]=c;
  21. if (n==1) k=10;
  22. else{
  23. if ((j==0)&& (tabl[j]=='?') ) k=9;
  24. if ((j>0) && (tabl[j]=='?') ) k=k*10;
  25. }}
  26. cout<<k<<endl;
  27. delete [] tabl;
  28. }
  29. return 0;
  30. }
  31.  
Time limit exceeded #stdin #stdout 5s 528896KB
stdin
Standard input is empty
stdout
1