fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define ull unsigned long long
  5. #define pb push_back
  6. #define pii pair<int,int>
  7. #define pll pair<ll,ll>
  8. #define uu first
  9. #define vv second
  10. #define MOD 1000000007
  11. #define inf 1000000000
  12. #define limit 10001000
  13.  
  14. set<ll> a;
  15.  
  16. ll ar[]={1, 5, 10, 50};
  17.  
  18. void solve(ll pos, ll sum)
  19. {
  20. if(pos==0)
  21. {
  22. a.insert(sum);
  23. return;
  24. }
  25.  
  26. for(int i=0; i<4; i++)
  27. {
  28. solve(pos-1, sum+ar[i]);
  29. }
  30. }
  31.  
  32. int main()
  33. {
  34. // freopen("input.txt", "r", stdin);
  35. // freopen("output.txt", "w", stdout);
  36. // ios_base::sync_with_stdio(0);
  37.  
  38. ll tc, test, i, n, y;
  39.  
  40. ll x=4;
  41.  
  42.  
  43.  
  44. // while(scanf("%lld", &n)==1)
  45.  
  46. for(i=1, y=0 ; i<=11; i++)
  47. {
  48.  
  49. solve(i, 0);
  50.  
  51.  
  52. // printf("%lld\n", a.size());
  53.  
  54. // cout<<i<<" "<<a.size()<<endl;
  55.  
  56.  
  57. cout<<i<<" "<<a.size()<<" "<<a.size()-y<<" "<<(i+2)*(i+1)/2<<" "<<((i+2)*(i+1)/2)-(a.size()-y)<<endl;
  58.  
  59. y=a.size();
  60.  
  61. a.clear();
  62.  
  63. }
  64.  
  65. return 0;
  66. }
  67.  
  68.  
Success #stdin #stdout 0.17s 4380KB
stdin
Standard input is empty
stdout
1 4 4 3 18446744073709551615
2 10 6 6 0
3 20 10 10 0
4 35 15 15 0
5 56 21 21 0
6 83 27 28 1
7 116 33 36 3
8 155 39 45 6
9 198 43 55 12
10 244 46 66 20
11 292 48 78 30