Gitruan_ZT @ 2023-12-07 19:34:54
RT Code:
#include<bits/stdc++.h>
using namespace std;
int a[110][110];
int main()
{
int n;
cin>>n;
for(int i=1;i<=n;i++)
{
for(int j=1;j<=i;j++)
{
cin>>a[i][j];
}
}
for(int i=n-1;i>=1;i--)
{
for(int j=1;j<=i;j++)
{
if(a[i+1][j]<a[i+1][j+1])
{
a[i][j]+=a[i+1][j+1];
}
else
{
a[i][j]+=a[i+1][j];
}
}
}
cout<<a[1][1]<<endl;
return 0;
}
by maoxiaojiu @ 2023-12-07 19:38:25
听不懂思密达
by Furukawa_Nagisa @ 2023-12-08 21:42:38
最大r=1000 a【110】【110】显然不够QWQ