# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
342223 | border | Bitaro’s Party (JOI18_bitaro) | C++17 | 1829 ms | 120172 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;
const int N = 100010;
const int B = 115;
int n, m, q, d[N], b[N];
bool vis[N], busy[N];
vector<int> adj[N], rev[N];
vector<pair<int, int>> f[N];
void precompute() {
vector<pair<int, int>> tmp;
for (int i = 1; i <= n; ++i) {
tmp.clear();
for (auto v: rev[i]) {
for (auto x: f[v]) {
tmp.push_back({x.first+1, x.second});
}
}
tmp.push_back({0, i});
sort(tmp.begin(), tmp.end(), greater<pair<int, int>>());
int sz = f[i].size();
for (auto x: tmp) {
if (!vis[x.second]) {
vis[x.second] = true;
f[i].push_back(x);
sz++;
if (sz == B) break;
}
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... |