# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
655931 | aebov | Bitaro’s Party (JOI18_bitaro) | C++17 | 4 ms | 7252 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<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<set>
#include<queue>
#define pb push_back
using namespace std;
const int N = (int)1e5 + 5;
int n , m, q, u, v, t, y, x, ret = -1, dis[N], mx = 0, dp[N];
bool bad[N];
vector<int> out[N], in[N], flo[N];
queue<int> qu;
void bfs(){
qu.push(t); dis[t] = 0; flo[0].pb(v);
while(!qu.empty()){
int v = qu.front(); qu.pop();
for(auto u : in[v]){
if(dis[v] + 1 < dis[u]){
dis[u] = dis[v] + 1, qu.push(u);
flo[dis[u]].pb(u);
dp[u] = dis[u];
}
}
}
for(int i = n; i >= 0; i --){
for(auto x : flo[i]){
for(auto y : out[x]) dp[x] = max(dp[x], dp[y] + 1);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |