Advertisement
DobriyKrot

Монетки

Aug 27th, 2022
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. #define int long long
  7.  
  8. int cash = -1e18;
  9.  
  10. void rec(int num, int sum, int cnt) {
  11.     if (sum < cash) {
  12.         return;
  13.     }
  14.     if (num == m) {
  15.        
  16.         return;
  17.     }
  18.    
  19.     rec(num + 1, sum - 2 * a[num], cnt + 2);
  20.     rec(num + 1, sum - a[num], cnt + 1);
  21.     rec(num + 1, sum, cnt);
  22. }
  23.  
  24. signed main() {
  25.     int n, m;
  26.     cin >> n >> m;
  27.  
  28. }
  29.  
  30. /*
  31. 1 1 1 1 1 1
  32. 2 1 1 1 1
  33. 2 2 1 1
  34. 3 2 1
  35.  
  36. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement