8 条题解

  • 2
    @ 2023-6-4 22:05:11
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
        long long a,b;
        cin >> a;
        b = a + a * a * 2 + a * a * a * 3;
        cout << b;
    }
    
    • 2
      @ 2023-5-7 19:46:00
      • [ ] #include<bits/stdc++.h> long long a,b; int main() { std::cin>>a; b=a+2pow(a,2)+3pow(a,3); std::cout<<b; return 0; }
      • 2
        @ 2023-4-24 12:12:12
        #include<bits/stdc++.h>
        long long a,b;
        int main()
        {
        	std::cin>>a;
        	b=a+2*pow(a,2)+3*pow(a,3);
        	std::cout<<b;
        	return 0;
        }
        
        • 1
          @ 2023-7-31 10:38:03
          /************************
          备注:
          ************************/
          #include <iostream>
          #include <iomanip>
          #include <cmath>
          #include <cstring>
          #include <algorithm>
          #include <cstdio>
          #include <set>
          #include <stack>
          #include <ctime>
          #include <queue>
          using namespace std;
          #define LL long long
          const int N=1e5+10;
          const int INF=0x3f3f3f3f;
          int main()
          {
          	LL a;
          	cin>>a;
          	LL ans=a+2*a*a+3*a*a*a;
          	cout<<ans;
          	return 0;
          }
          
          • 0
            @ 2023-12-24 20:02:26

            不是吧,难度七(幻听) 👀️ 就是加法乘法...

            using namespace std;
            int main() {
            	long long a;
            	cin>>a;
            	cout<<a+2*(a*a)+3*(a*a*a);
                return 0;
            }
            
            • 0
              @ 2023-12-5 20:22:51
              #include<bits/stdc++.h>
              using namespace std;
              const int INF = 0x3f3f3f3f;
              const int N = 1e5 + 10;
              long long a , h;
              int main(){
              cin >> a;
              h = a + 2 * a * a + 3 * a * a * a;
              cout << h;
              

              }

              别忘了return 0;记得要开long long!!
              
              • 0
                @ 2023-4-23 9:57:24
                #include <iostream>
                
                using namespace std;
                
                int main() {
                    long a;
                    cin >> a;
                    long ans = a + 2 * a * a + 3 * a * a * a;
                    cout << ans << endl;
                    return 0;
                }
                

                这里最容易错的地方就是用了int 定义了a,实际上根据题意要用long

                • -1
                  @ 2023-4-24 12:10:45
                  #include<bits/stdc++.h>
                  using namespace std;
                  long long a=0,k;
                  long long f(long long a,int b){
                  	if(b==3) return a;
                  	return a+f((b+1)*pow(k,(b+1)),b+1);
                  }
                  int main(){
                  	cin>>a;
                  	k=a;
                  	cout<<f(a,1);
                  }
                  
                  • 1

                  信息

                  ID
                  2951
                  时间
                  1000ms
                  内存
                  256MiB
                  难度
                  7
                  标签
                  (无)
                  递交数
                  677
                  已通过
                  149
                  上传者