Submission #82580

#TimeUsernameProblemLanguageResultExecution timeMemory
82580farukkastamonudaMechanical Doll (IOI18_doll)C++14
0 / 100
9 ms9676 KiB
#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]; ans.pb(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]; ans.pb(A[i+1]); } else if(tp[A[i]]==0){ //ans[A[i]]=1; ans.pb(1); } } answer(ans,x,y); } //~ int main(){ //~ return 0; //~ }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...