9 条题解

  • 1
    @ 2023-4-18 17:26:07
    #include<bits/stdc++.h>
    
    using namespace std;
    
    long long a[1100];
    
    int main(){
    
        int n;
    
        cin>>n;
    
        while(1){
    
            a[1]=1;
    
            a[2]=2;
    
            a[3]=4;
    
            a[4]=7;
    
            for(int i=4;i<=n;i++){
    
                a[i]=a[i-2]+a[i-1]+a[i-3];
    
            }
    
            break;
    
        }
    
        cout<<a[n]<<endl;
    
        return 0;
    
    }
    
    • 0
      @ 2023-10-5 10:20:00

      #include<bits/stdc++.h> using namespace std; long long a[9999]={0,1,2,4,7}; int main(){ int n; cin>>n; for(int i=4;i<=n;i++){ a[i]=a[i-2]+a[i-1]+a[i-3]; } cout<<a[i]; }

      • 0
        @ 2023-10-5 10:20:00

        #include<bits/stdc++.h> using namespace std; long long a[9999]={0,1,2,4,7}; int main(){ int n; cin>>n; for(int i=4;i<=n;i++){ a[i]=a[i-2]+a[i-1]+a[i-3]; } cout<<a[i]; }

        • 0
          @ 2023-10-5 10:20:00

          #include<bits/stdc++.h> using namespace std; long long a[9999]={0,1,2,4,7}; int main(){ int n; cin>>n; for(int i=4;i<=n;i++){ a[i]=a[i-2]+a[i-1]+a[i-3]; } cout<<a[i]; }

          • 0
            @ 2023-10-5 10:20:00

            #include<bits/stdc++.h> using namespace std; long long a[9999]={0,1,2,4,7}; int main(){ int n; cin>>n; for(int i=4;i<=n;i++){ a[i]=a[i-2]+a[i-1]+a[i-3]; } cout<<a[i]; }

            • 0
              @ 2023-10-5 10:20:00

              #include<bits/stdc++.h> using namespace std; long long a[9999]={0,1,2,4,7}; int main(){ int n; cin>>n; for(int i=4;i<=n;i++){ a[i]=a[i-2]+a[i-1]+a[i-3]; } cout<<a[i]; }

              • 0
                @ 2023-10-5 10:20:00

                #include<bits/stdc++.h> using namespace std; long long a[9999]={0,1,2,4,7}; int main(){ int n; cin>>n; for(int i=4;i<=n;i++){ a[i]=a[i-2]+a[i-1]+a[i-3]; } cout<<a[i]; }

                • 0
                  @ 2023-10-5 10:20:00

                  #include<bits/stdc++.h> using namespace std; long long a[9999]={0,1,2,4,7}; int main(){ int n; cin>>n; for(int i=4;i<=n;i++){ a[i]=a[i-2]+a[i-1]+a[i-3]; } cout<<a[i]; }

                  • 0
                    @ 2023-4-18 17:25:42
                    #include<>
                    using namespace std;
                    
                    long long a[1100];
                    
                    int main(){
                    
                        int n;
                    
                        cin>>n;
                    
                        while(1){
                    
                            a[1]=1;
                    
                            a[2]=2;
                    
                            a[3]=4;
                    
                            a[4]=7;
                    
                            for(int i=4;i<=n;i++){
                    
                                a[i]=a[i-2]+a[i-1]+a[i-3];
                    
                            }
                    
                            break;
                    
                        }
                    
                        cout<****
                    
                    }
                    
                    • 1

                    信息

                    ID
                    364
                    时间
                    1000ms
                    内存
                    16MiB
                    难度
                    9
                    标签
                    递交数
                    278
                    已通过
                    21
                    上传者