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 fi first
#define se second
#define lo long long
#define inf 1000000009
#define md 1000000007
#define li 400005
#define mp make_pair
#define pb push_back
#define mid (start+end)/2
using namespace std;
int tp[li],anahtar,vis[li];
vector<int> v[li],ans,x,y;
void create_circuit(int M,vector<int> A){
A.pb(0);
for(int i=0;i<(int)A.size()-1;i++){
tp[ A[i] ]++;
//v[A[i]].pb(A[i+1]);
}
ans[0]=A[0];
for(int i=0;i<(int)A.size();i++){
if(i==(int)A.size()-1) continue;
if(tp[A[i]]>1 && vis[A[i]]==0){
vis[A[i]]=1;
anahtar++;
ans[A[i]]=-anahtar;
//ans.pb(-anahtar);
x.pb(A[i+1]);
}
else if(tp[A[i]]>1 && vis[A[i]]==1){
y.pb(A[i+1]);
}
else if(tp[A[i]]==1){
ans[A[i]]=A[i+1];
}
else if(tp[A[i]]==0){
ans[A[i]]=1;
}
}
answer(ans,x,y);
}
//~ int main(){
//~ return 0;
//~ }
# | 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... |