fork download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. using namespace std;
  5.  
  6. int nums[11];
  7. int list[10];
  8. int cnt[4] {0};
  9. vector<char> operators {'+','-','*','/'};
  10.  
  11. void go(int index, int end) {
  12. if(index==end) {
  13. for(int i=0; i<end; i++) {
  14.  
  15. }
  16.  
  17. return;
  18. }
  19.  
  20. for(int i=0; i<4; i++) {
  21. if(cnt[i]>0) {
  22. cnt[i]--;
  23. list[index]=i;
  24. go(index+1, end);
  25. cnt[i]++;
  26. }
  27. }
  28. }
  29.  
  30. int main() {
  31. int n,a;
  32. cin>>n;
  33.  
  34. for(int i=0; i<n; i++) cin>>nums[i];
  35. for(int i=0; i<4; i++) {
  36. cin>>a;
  37. while(a--) cnt[i]++;
  38. }
  39.  
  40. go(0,n-1);
  41.  
  42. return 0;
  43. }
Success #stdin #stdout 0s 4244KB
stdin
5
1
5
3
1
2
stdout
Standard output is empty