# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
975585 | edogawa_something | Travelling Merchant (APIO17_merchant) | C++17 | 343 ms | 8872 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;
typedef long long ll;
typedef vector<ll> vii;
#define pb push_back
#define S second
#define F first
const ll M=101;
const ll inf=2e18;
ll n,m,k,buy[M][M],sell[M][M],dp[M][M][M],dis[M],c[M][M];
vector<pair<ll,ll>>adj[M];
vii v[M];
bool vis[M];
void bfs(ll x){
queue<ll>q;
q.push(x);
for(int i=0;i<n;i++)
vis[i]=0,dis[i]=inf;
dis[x]=0;
vis[x]=1;
while(!q.empty()){
ll node=q.front();
q.pop();
for(auto it:v[node]){
if(!vis[it]){
vis[it]=1;
dis[it]=dis[node]+1;
q.push(it);
}
}
# | 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... |