fork download
  1. #include<stdio.h>
  2. #include<string.h>
  3. #include<math.h>
  4.  
  5. #define max(a,b) a>=b?a:b
  6. #define min(a,b) a<=b?a:b
  7. #define LL long long
  8. #define MAX 200
  9. int main()
  10. {
  11. int n,m,i,j;
  12. scanf("%d %d",&n,&m); // names , length of names
  13. char arr[MAX][MAX];
  14. for(i=0;i<n;i++)
  15. {
  16. scanf("%s",arr[i]);
  17. }
  18.  
  19. LL prod=1;
  20. for(j=0;j<m;j++)
  21. {
  22. LL c=0;
  23. int count[MAX]={0};
  24. for(i = 0; i < n; i++)
  25. {
  26. if(count[(int)arr[i][j]] == 1)
  27. {
  28. ;
  29. }
  30. else
  31. {
  32. count[(int)arr[i][j]]++;
  33. c++;
  34. // printf("Hello");
  35. }
  36. }
  37. // printf("Bye");
  38. prod=prod*c;
  39.  
  40. }
  41. prod=prod%1000000007;
  42. printf("%lld",prod);
  43.  
  44.  
  45.  
  46.  
  47. return 0;
  48. }
Success #stdin #stdout 0s 2116KB
stdin
Standard input is empty
stdout
1