# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
105718 | Pro_ktmr | Telegraph (JOI16_telegraph) | C++14 | 201 ms | 15712 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 LL long long
int N;
int A[100000];
LL C[100000];
vector<int> saki[100000];
bool already[100000] = {};
int sizeOfCycle = 0;
int belongCycle[100000];
vector<int> cycle[100000];
vector<int> st;
void dfs(int now){
if(already[A[now]]){
bool flg = false;
for(int i=0; i<st.size(); i++){
if(st[i] == A[now]) flg = true;
if(flg){
belongCycle[st[i]] = sizeOfCycle;
cycle[sizeOfCycle].push_back(st[i]);
}
}
if(flg) sizeOfCycle++;
}
else{
already[A[now]] = true;
st.push_back(A[now]);
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |