fork download
  1. #include<bits/stdc++.h>
  2. #define f1(i, n) for(ll i=1;i<=n;++i)
  3. #define f0(i, n) for(ll i=0;i<n;++i)
  4. #define ull unsigned long long
  5. #define ll long long
  6. #define rev(a) reverse(a.begin(),a.end())
  7. #define all(x) x.begin(),x.end()
  8. #define so(A, n) sort(A+1, A+n+1)
  9. using namespace std;
  10. const int maxn = 200010;
  11. const int N = 2e5 + 5;
  12. const ll MOD = 998244353;
  13. ll moded(ll a, ll b, ll mod) {
  14. return ((a % mod) * (b % mod)) % mod;
  15. }
  16. void bai1() {
  17. ll a, b, c, d, e, f;
  18. cin >> a >> b >> c >> d >> e >> f;
  19. ll res = ((moded(moded(a, b, MOD), c, MOD) % MOD) - ((moded(moded(d, e, MOD), f, MOD)) % MOD)) % MOD;
  20. cout << res;
  21. }
  22. void bai2() {
  23. string s;
  24. cin >> s;
  25. int cnt = 0;
  26. for (int i = 0; i < s.size(); ++i) {
  27. if (s[i] == 'o') {
  28. cnt++;
  29. }
  30. }
  31. if (cnt > 4) {cout << 0; return;}
  32. else if (cnt == 4) {cout << 1; return;}
  33.  
  34. int res = 0;
  35. map<int, bool> mp;
  36. int A[5] = {};
  37. for (int i = 0; i <= 9999; ++i) {
  38. int a = i, d = 4;
  39. while (d != 0) {
  40. A[d] = a % 10;
  41. a /= 10;
  42. --d;
  43. }
  44. bool check = true;
  45. for (int j = 1; j <= 4; ++j) {
  46. if (s[A[j]] == 'o') {
  47. mp[A[j]] = true;
  48. }
  49. if (s[A[j]] == 'x') {
  50. check = false;
  51. break;
  52. }
  53. }
  54. if (mp.size() == cnt && check) {
  55. res++;
  56. }
  57. mp.clear();
  58. }
  59. cout << res;
  60. }
  61. int main()
  62. {
  63. ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  64. bai2();
  65.  
  66.  
  67. return 0;
  68. }
  69.  
  70.  
Success #stdin #stdout 0.01s 5316KB
stdin
Standard input is empty
stdout
10000