# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
313834 | MKopchev | Restore Array (RMI19_restore) | C++14 | 387 ms | 1012 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
const int nmax=5e3+42;
struct edge
{
int u,v,cost;
};
vector<edge> all;
int n,q;
int dist[nmax];
void bellman()
{
for(int i=1;i<=n;i++)dist[i]=1e9;
for(int t=0;t<=n;t++)
{
for(auto w:all)
if(dist[w.u]+w.cost<dist[w.v])
{
dist[w.v]=dist[w.u]+w.cost;
//cout<<"update "<<w.u<<" "<<w.v<<" "<<w.cost<<endl;
//for(int j=0;j<=n;j++)cout<<dist[j]<<" ";cout<<endl;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |