#include #include #include #include using namespace std; struct agent { int poradi; string name; bool sell; float price; }; bool cmp(const agent a, const agent b) { return a.price > b.price; } bool cmp2(const agent a, const agent b) { return a.poradi <= b.poradi; } set i; int main() { string line; while (cin) { string issuer; int bids; cin >> bids >> issuer; pair::iterator,bool> p; p = i.insert(issuer); if (!p.second) { volatile int a=0; a=5/a; }; // beda vam!!!!! if (bids == 0 && issuer == "END") return 0; vector agenti; for (int i=0; i> a.name >> action >> a.price; a.sell = action == "sell"; a.poradi = i; agenti.push_back(a); } // sort(agenti.begin(), agenti.end(), cmp); vector result(agenti.size()); for (int i=0; i vydri; int inc,mez; /* if (ag.sell) { inc = -1; mez = -1; } else { inc = 1; mez = agenti.size(); } */ for (int j=0; j= agenti[j].price)) { vydri.push_back(agenti[j]); } } } // sort(vydri.begin(), vydri.end(), cmp2); result[ag.poradi] = ag.name + ":"; if (vydri.size() > 0) { for (int i=0; i