# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
635005 | drkarlicio2107 | Nice sequence (IZhO18_sequence) | C++14 | 1998 ms | 84636 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;
int vis [400010]; long long int c=0; long long int n, m;
vector < int > g [400010];
vector < long long int > ans;
long long int o [400010];
int vis2 [400010];
int vis3 [400010];
void dfs ( int x, long long int d){
if (vis [x]) return ;
vis [x]=1;
if (x+n<=d){
g [x+n].push_back (x); //dfs (x+n, d);
}
if (x+m<=d){
g [x].push_back (x+m); dfs (x+m, d);
}
return ;
}
void dfs2 ( int v) {
vis2[v]=1;
for ( long long int u : g[v]) {
if (!vis2[u]) dfs2(u);
}
ans.push_back(v);
return ;
}
void is_cycle ( long long int x) {
if (vis3 [x]==1){
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |