fork(1) 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)&& (tabl[j]=='?') ) k=10;
  22.  
  23.  
  24. else{
  25. if ((j==0)&& (tabl[j]=='?') ) k=9;
  26. if ((j>0) && (tabl[j]=='?') ) k=k*10;
  27. }}
  28. if (k==1) cout<<"0"<<endl;
  29. else cout<<k<<endl;
  30. delete [] tabl;
  31. }
  32. return 0;
  33. }
  34.  
Time limit exceeded #stdin #stdout 5s 528896KB
stdin
Standard input is empty
stdout
0