# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
682666 | Alcabel | Nice sequence (IZhO18_sequence) | C++17 | 2 ms | 724 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 maxn = 1e6;
char vis[maxn + 1];
int n, m;
long long pref[maxn + 1];
bool dfsCycle(int v, int maxv) {
// cerr << "v: " << v << '\n';
vis[v] = 1;
bool hasCycle = false;
if (v >= n) {
if (vis[v - n] == 1) {
hasCycle = true;
} else if (vis[v - n] == 0) {
hasCycle = hasCycle || dfsCycle(v - n, maxv);
}
}
if (v + m <= maxv) {
if (vis[v + m] == 1) {
hasCycle = true;
} else if (vis[v + m] == 0) {
hasCycle = hasCycle || dfsCycle(v + m, maxv);
}
}
vis[v] = 2;
return hasCycle;
}
vector<int> top;
# | 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... |