Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
33888 qwertyuiop 股票买卖问题 C++ 编译错误 0 MS 0 KB 271 2023-12-31 14:36:43

Tests(0/0):


#include<bits/stdc++.h> using namespace std; int n,a[99999999],m,ans,s[99999999]; int main(){ cin>>n; for(int i=1;i<=n;i++)cin>>s[i]; for(int i=1;i<=n;i++){ for(int j=i+1;j<=n;j++){ a[i]=max(a,s[j]-s[i]); } ans+=a[i]; } cout<<ans; return 0; }


测评信息: