|
|
вернуться в форумAccepted 0.156 2 993 КБ Just used STL contaners such as std::map<std::string,T>, std::vector<T>. :) 33 lines of code. Re: Accepted 0.156 2 993 КБ Послано alp 2 май 2014 11:27 what is "T"? give please full description. AC in 0.093 , 7 748 KB I used a map and a set. My time was a little less than 2 times faster, and used a little more than 2 times more memory. struct dir { std::string name; std::map<std::string, dir*> children_items; std::set<std::string> children_names; }; The set gives you the sorted list. The map gives you instant access to a subdirectory of a given directory by name (taken from the set) Edited by author 29.12.2022 02:15 |
|
|