# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
59447 | tmwilliamlin168 | Bitaro’s Party (JOI18_bitaro) | C++14 | 1657 ms | 35692 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;
#define pii pair<int, int>
#define fi first
#define se second
const int mxN=1e5, bs=20;
int n, m, q, dp2[mxN], c[mxN];
vector<int> adj[mxN];
vector<pii> dp1[mxN];
priority_queue<pii, vector<pii>, greater<pii>> pq;
bool a[mxN];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> n >> m >> q;
while(m--) {
int u, v;
cin >> u >> v, --u, --v;
adj[v].push_back(u);
}
for(int i=0; i<n; ++i) {
pq.push({0, i});
for(int v : adj[i]) {
for(pii p : dp1[v]) {
pq.push({p.fi+1, p.se});
if(pq.size()>bs)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |