Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
75439 sh25_ganzy 数组分割 C++ 解答错误 0 MS 244 KB 400 2025-12-06 20:15:41

Tests(0/1):


#include<bits/stdc++.h> using namespace std; int main(){ long long n,s=0,min=16383,temp=0,abs_temp=0; cin>>n; long long a[n]; for(long long i=0;i<n;i++){ cin>>a[i]; s+=a[i]; } for(int i=0;i<n;i++){ temp+=a[i]; abs_temp=abs(temp); if(abs_temp<min){ min=abs_temp; } } cout<<min; return 0; }


测评信息: