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>
using namespace std;
#define endl "\n"
// #define int long long
typedef long long ll ;
const ll ooo = 1e14 ;
const ll oo = 2e9 ;
const double PI = acos(-1) ;
const ll M = 1e9 + 7 ;
const int N = 10000010 ;
int use[100010];
vector<int> v[100010];
void create_circuit(int M, vector<int> A) {
int N = A.size();
vector<int> c(M + 1 , 0);
for(int i = 0 ; i < N ; ++i){
if(!i)v[0].push_back(A[i]);
else v[A[i - 1]].push_back(A[i]);
}
v[A[N - 1]].push_back(0);
vector<int> x , y;
int co = -1;
for(int i = 0 ; i < M ; ++i){
if(v[i].size() == 1){
c[i] = v[i][0];
}else if(v[i].size() == 2){
c[i] = co--;
x.push_back(v[i][0]);
y.push_back(v[i][1]);
}
// cout << c[i] << endl;
}
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... |