Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
タイプのオブジェクトを格納するヒープの独自の実装を C++ で作成する必要があります。
std::pair<City, int>
ここで、City は、都市の座標と文字列 (都市名) を表す 2 つの整数を格納する構造体です。単純な整数でこれを行う方法は知っていますが、値のペアを使用するのは少し問題があります。私はすでにヒープ クラスを書き始めていますが、前述のように、これらのペアでこれを行う方法がわかりません。ペアの int 値でヒープをソートしたい。