Advertisement
umnov

Untitled

Feb 20th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5.  
  6.  
  7. signed main() {
  8. ios_base::sync_with_stdio(false);
  9. cin.tie(0);
  10.  
  11. #ifdef LOCAL
  12. freopen("input.txt", "r", stdin);
  13. freopen("output.txt", "w", stdout);
  14. #endif
  15.  
  16. //dp[i] - в момент i(i не приняли)
  17. //dp[i], приняли j
  18. //dp[i] = dp[j] + a[j] - b[j] * (i - j)
  19. //dp[i] = dp[j] + a[j] - b[j] * i - b[j] * j
  20. //dp[i] = i * (b[j]) + (dp[j] + a[j] - b[j] * j)
  21. //k = b[j], b = dp[j] + a[j] - b[j] * j
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement