Submission #635882

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
6358822022-08-27 09:10:28phathnvThrough Another Maze Darkly (CCO21_day1problem3)C++11
25 / 25
1322 ms319336 KiB
#include <bits/stdc++.h>
using namespace std;
const int N = 2e6 + 10;
int n, q, timer;
vector<int> adj[N];
vector<array<int, 2>> phase[N];
void dfs(int u, int p, int t) {
phase[t].push_back({++timer, u});
bool mark = false;
for (int v : adj[u]) {
if (v == p) {
mark = true;
continue;
}
if (mark) {
dfs(v, u, t + 1);
phase[t + 1].push_back({++timer, u});
}
}
for (int v : adj[u]) {
if (v == p) {
break;
}
dfs(v, u, t);
phase[t].push_back({++timer, u});
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:120:15: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
  120 |     for (auto [k, ind] : queries) {
      |               ^
Main.cpp:125:27: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
  125 |                 for (auto [pos, val] : phase[p]) {
      |                           ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...