zoukankan      html  css  js  c++  java
  • P4451 [国家集训队]整数的lqp拆分

    #include <bits/stdc++.h>
    using namespace std;
    typedef long long LL;
    inline LL read () { LL res = 0 ;int f (1) ;char ch = getchar ();
        while (!isdigit(ch)) { if (ch == '-') f = -1 ;ch = getchar();}
        while (isdigit(ch)) res = (res << 1) + (res << 3) + (ch ^ 48) ,ch = getchar(); return res * f ;
    }
    LL n;
    LL a[1<<20];
    signed main () {
        n=read();
        a[1]=1; a[2]=2;
        for(register int i=3;i<=n;i++) a[i]=((a[i - 1] << 1)+(a[i - 2])) %1000000007 ;
        cout << a[n] << endl ;
        return 0;
    }
    不存在十全十美的文章 如同不存在彻头彻尾的绝望
  • 相关阅读:
    js5
    js4
    js(3)
    JS内容(2)
    html复习
    js介绍及内容(1)
    定位2
    position定位
    CSS
    列表及行块转变
  • 原文地址:https://www.cnblogs.com/qf-breeze/p/10460742.html
Copyright © 2011-2022 走看看