Advertisement
a53

NumarDeSubmultimi

a53
Nov 12th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. #include <iostream>
  2. #define MOD 777013
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n;
  8. cin>>n;
  9. int dp,dp_1=1,dp_2=2;
  10. for(int i=3;i<=n;++i)
  11. dp=dp_1%MOD+dp_2%MOD+1,dp%=MOD,dp_1=dp_2,dp_2=dp;
  12. cout<<dp;
  13. return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement