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 "doll.h"
#include <vector>
#define sz(A) int(size(A))
using namespace std;
vector<int> adj[200005];
void create_circuit(int M, vector<int> A) {
for(int i = 0; i < sz(A)-1; i++){
adj[A[i]].push_back(A[i+1]);
}
vector<int> C(M+1);
C[0] = A[0];
vector<int> X,Y;
for(int i = 1; i <= M; i++){
if(sz(adj[i]) == 0) continue;
if(sz(adj[i]) == 1){
C[i] = adj[i][0];
continue;
}
if(sz(adj[i]) == 2){
C[i] = -(sz(X)+1);
X.push_back(adj[i][0]);
Y.push_back(adj[i][1]);
continue;
}
}
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... |