# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
888047 | PM1 | Bitaro’s Party (JOI18_bitaro) | C++17 | 3 ms | 5468 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 fr first
#define sc second
const int mxn=1e5+5,sq=130;
int n,m,q,mark[mxn];
vector<int>v[mxn];
vector<pair<int,int> >pre[mxn];
bool cmp(pair<int,int>x,pair<int,int>y){
return x.sc>y.sc;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin>>n>>m>>q;
for(int i=1;i<=m;i++){
int x,y;
cin>>x>>y;
v[y].push_back(x);
}
for(int i=1;i<=n;i++){
for(auto j:v[i]){
for(auto w:pre[j]){
if(mark[w.fr]){
pre[i][mark[w.fr]-1].sc=min(w.sc,pre[i][mark[w.fr]-1].sc+1);
}
else{
pre[i].push_back({w.fr,w.sc+1});
mark[w.fr]=pre[i].size();
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |