6 条题解

  • 2
    @ 2026-2-7 16:16:44
    #include<bits/stdc++.h>
    using namespace std;
    int a[100001];
    int main()
    {
    	int n,x;
    	cin>>n>>x;
    	
    	long long ans;
    	for(int i=1;i<=n;i++){
    		cin>>a[i];
    	}
    	if(a[1]>x){
    		ans=a[1]-x;
    		a[1]=x;
    	}
    	for(int i=2;i<=n;++i){
    		if((a[i]+a[i-1])>x){
    			ans+=(a[i]+a[i-1]-x);
    			a[i]-=(a[i]+a[i-1]-x);
    		}
    	}
    	cout<<ans;
    	return 0;
    }
    
    • 1
      @ 2025-11-24 21:23:03
      #include<bits/stdc++.h>
      using namespace std;
      double r,d,z,m;
      int main(){
          cin>>r;
          d=r*2.0;
          z=d*3.14159;
          m=3.14159*r*r;
          cout<<fixed<<setprecision(4)<<d<<" "<<z<<" "<<m;
          return 0;
      }
      
      • 0
        @ 2025-12-21 22:06:25
          #include<bits/stdc++.h>
          using namespace std;
          typedef long long ll;
          typedef pair<int, int> pii;
          #define MP(a,b) make_pair(a,b)
          int main() {
          	ios::sync_with_stdio ( false );
          	double r,d,z,m;
          	cin>>r;
          	d=r*2.0;
          	z=d*3.14159;
          	m=3.14159*r*r;
          	cout<<fixed<<setprecision(4)<<d<<" "<<z<<" "<<m;
          	return 0;
          }
        
        • -1
          @ 2026-2-7 16:19:38
          #include<bits/stdc++.h>
          using namespace std;
          int a[100001];
          int main()
          {
          	int n,x;
          	cin>>n>>x;
          	
          	long long ans;
          	for(int i=1;i<=n;i++){
          		cin>>a[i];
          	}
          	if(a[1]>x){
          		ans=a[1]-x;
          		a[1]=x;
          	}
          	for(int i=2;i<=n;++i){
          		if((a[i]+a[i-1])>x){
          			ans+=(a[i]+a[i-1]-x);
          			a[i]-=(a[i]+a[i-1]-x);
          		}
          	}
          	cout<<ans;
          	return 0;
          }
          
          
          
          • -1
            @ 2025-12-5 17:24:37

            #include<bits/stdc++.h> using namespace std; double r,d,z,m; int main(){ cin>>r; d=r2.0; z=d3.14159; m=3.14159rr; cout<<fixed<<setprecision(4)<<d<<" "<<z<<" "<<m; return 0; }

            • -5
              @ 2025-4-18 4:31:43

              青岛空放私借贷款|借钱|青岛无视征信借款【19371050109】【包下、无任何前期】【民间借贷】【私人借钱】【空放私借】【私人短借】【本地人借钱】【公司周转】【个人应急周转】【企业资金急用周转】【短期私借】【个人、公司急用钱贷款】【贷款包批包过、无前期任何费用】【无.视.黑.白.花.户.征.信.不.好.可.贷.款】【全省各市级可贷款】【个人小额贷款】【企业大额贷款】

              • 1

              信息

              ID
              6871
              时间
              1000ms
              内存
              128MiB
              难度
              1
              标签
              递交数
              53
              已通过
              27
              上传者