# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
526938 | oneloveforever | Autobus (COCI22_autobus) | C++14 | 1090 ms | 17520 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;
#define ll long long
#define x first
#define y second
#define ii pair<ll,ll>
const ll inf=1e16+7;
const ll M=100;
ll dp[M][M][M];
vector<vector<ii> >a;
ll n,m;
struct node
{
ll x,used,value;
node(ll _value=0,ll _x=0,ll _used=0)
{
x=_x,used=_used,value=_value;
}
};
ll calc(ll path,ll x,ll y)
{
if(x==y)return 0;
if(!path)return inf;
if(dp[path][x][y]!=-1)return dp[path][x][y];
ll ans=inf;
for(ii u:a[x])
{
ll node=u.x;
ll cost=u.y;
ans=min(ans,calc(path-1,node,y)+cost);
# | 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... |