# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
881653 | AverageAmogusEnjoyer | Bitaro’s Party (JOI18_bitaro) | C++17 | 2064 ms | 419156 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;
using ll = long long;
template<class T> bool cmin(T &i, T j) { return i > j ? i=j,1:0; }
template<class T> bool cmax(T &i, T j) { return i < j ? i=j,1:0; }
const int B = 320, N = 1e5;
vector<pair<int,int>> longest_dist[N];
vector<int> adj[N],radj[N];
int V[N],indices[N],dist[N];
bool banned[N],taken[N];
void solve() {
int n,m,q;
cin >> n >> m >> q;
for (int u,v;m--;) {
cin >> u >> v;
assert(u < v);
adj[--u].push_back(--v);
radj[v].push_back(u);
}
for (int i=0;i<n;i++) {
pair<int,int> best = {-1,-1};
do {
best = {-1,-1};
for (int &v: radj[i]) {
while(indices[v] < int(longest_dist[v].size())) {
if (!taken[longest_dist[v][indices[v]].second]) {
if (longest_dist[v][indices[v]].first+1 > best.first) {
best = longest_dist[v][indices[v]];
best.first++;
indices[v]++;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |