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 <bits/stdc++.h>
#define pb push_back
#define f first
#define sc second
using namespace std;
typedef long long int ll;
typedef string str;
void create_circuit(int m, vector<int> A){
int n = A.size();
A.pb(0);
vector<vector<int>> pos(m);
for(int i = 0; i < n; i++) pos[A[i]-1].pb(i);
vector<int> C(m+1, 0), X, Y;
C[0] = A[0];
for(int i = 0; i < m; i++) if(!pos[i].empty()){
if(pos[i].size() == 1){
C[i+1] = A[pos[i][0]+1];
}
else{
X.pb(A[pos[i][0]+1]), Y.pb(A[pos[i][1]+1]);
C[i+1] = -int(X.size());
}
}
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... |