# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
535847 | new_acc | Toll (BOI17_toll) | C++14 | 264 ms | 19268 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>
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
const int N=1e5+10;
vi zap[N],war[N];
int z[N];
vector<pair<int,int> >graf[2][N];
int odl[2][N],n,m,ans[N];
void bfs(int p,bool xd,int w,int kon){
vector<int> curr;
curr.push_back(p);
odl[xd][p]=0;
while(curr.size() and w!=kon){
vi nxt;
for(auto v:curr){
for(auto [u,c]:graf[xd][v]){
if(odl[xd][u]==-1) odl[xd][u]=odl[xd][v]+c,nxt.push_back(u);
else odl[xd][u]=min(odl[xd][u],odl[xd][v]+c);
}
}
if(xd) w--;
else w++;
curr=nxt;
}
}
void dc(int p=0,int k=n/m){
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |