fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int pot4(int x) {
  5. return x * x * x * x;
  6. }
  7.  
  8. int main() {
  9. string s;
  10. cin >> s;
  11. int a = 0, b = 0;
  12. for (auto c : s) {
  13. a += c == '?';
  14. b += c == 'o';
  15. }
  16. int ans = 0;
  17. if (b == 0) ans = pot4(a);
  18. if (b == 1) ans = pot4(a+1) - pot4(a);
  19. if (b == 2) ans = pot4(a+2) - 2 * pot4(a+1) + pot4(a);
  20. if (b == 3) ans = pot4(a+3) - 3 * pot4(a+2) + 3 * pot4(a+1) - pot4(a);
  21. if (b == 4) ans = 24;
  22. cout << ans << endl;
  23. return 0;
  24. }
Success #stdin #stdout 0s 5528KB
stdin
Standard input is empty
stdout
0