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>
#define sz(x) ((int) (x).size())
#define all(x) (x).begin(), (x).end()
#define pb push_back
using namespace std;
#include "doll.h"
int n;
vector<int> adj[1000000];
vector<int> C, X, Y;
void generate(int x){
if(sz(adj[x]) == 0) C[x] = 0;
else if(sz(adj[x]) == 1) C[x] = adj[x][0];
else if(sz(adj[x]) == 2){
X.pb(adj[x][0]);
Y.pb(adj[x][1]);
C[x] = -sz(X);
}
}
void create_circuit(int M, std::vector<int> A) {
n = A.size();
C = vector<int>(M + 1, 0);
for(int i = 0; i < n - 1; i++){
adj[A[i]].pb(A[i + 1]);
}
adj[0].pb(A[0]);
adj[A[n - 1]].pb(0);
for(int i = 0; i <= M; i++) generate(i);
answer(C, X, Y);
}
# | 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... |