Cod sursa(job #2500630)
| Utilizator | Data | 28 noiembrie 2019 13:33:29 | |
|---|---|---|---|
| Problema | Parantezare optima de matrici | Scor | 0 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.54 kb |
#include <iostream>
#include <fstream>
#include <bits/stdc++.h>
#include <map>
#define pb push_back
#define ll long long
using namespace std;
const int siz = 510;
int n;
ll d[siz],m[siz][siz];
int main()
{
ifstream fin("z.in");
ofstream fout("z.out");
fin>>n;
for(int i = 0 ; i <= n ;i++){
fin>>d[i];
}
for(int i=1;i<=n;i++)
{
m[i][i]=0;
}
for(int i=1;i<=n-1;i++)
{
m[i][i+1]=d[i-1]*d[i]*d[i+1];
}
fin.close();
fout.close();
return 0;
}
