# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
746479 | sword060 | Cijanobakterije (COCI21_cijanobakterije) | C++17 | 70 ms | 10428 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;
const int N = 2e5+5;
int x,k;
vector<int>v[N];
int dist[N][2];
bool vis[N][2];
pair<int,int>dfs(int i,bool f){
queue<int>q;
q.push(i);
vis[i][f]=1;
dist[i][f]=1;
int mx=0,pos=i;
while(q.size()){
int j=q.front();q.pop();
if(mx<dist[j][f]){
mx=dist[j][f];
pos=j;
}
for(auto c:v[j]){
if(vis[c][f])continue;
vis[c][f]=1;
dist[c][f]=dist[j][f]+1;
q.push(c);
}
}
return {pos,mx};
}
int main(){
ios::sync_with_stdio(0);cin.tie(0);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |