Submission #286212

#TimeUsernameProblemLanguageResultExecution timeMemory
286212mohammadMechanical Doll (IOI18_doll)C++14
6 / 100
93 ms11056 KiB
#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 + 1 ; ++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 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...