Submission #746479

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7464792023-05-22 13:39:44sword060Cijanobakterije (COCI21_cijanobakterije)C++17
70 / 70
70 ms10428 KiB
#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);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...