Submission #585504

#TimeUsernameProblemLanguageResultExecution timeMemory
585504LIFMechanical Doll (IOI18_doll)C++14
0 / 100
1 ms340 KiB
#include "doll.h" #include<bits/stdc++.h> void create_circuit(int M, std::vector<int> A) { int N = A.size(); std::vector<int> x,y; std::vector<int> c; int n = N; c[0] = 1; std::vector<int> node[100005]; for(int i=1; i<=n-1; i++) { int qq = A[i]; node[qq].push_back(A[i+1]); } int xx = A[n]; node[xx].push_back(0); for(int i=1;i<=M;i++) //that means we deal with the sensor. { int sum = node[i].size(); if(sum == 1) { int kx = node[i][0]; c.push_back(kx); } else { sum+=1; int dd=1; for(int j=1;j<=100;j++) { dd*=2; //that means we should create how many hiearachy if(dd >= sum) { break; } } } } 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...