5、io> #include #include #include #include using namespace std; typedef long long LL; typedef pair p; list
l; int main() { int n; while (scanf("%d", &n), n) { l.clear();
6、 for (int i = 0; i < n; i++) { LL a, b; int t; scanf("%d %I64d %I64d", &t, &a, &b); if (t == 1) l.push_back(p(a, b)); else if (t == -1) l.erase(find(l.begin(), l.end(), p(a, b)));
7、 else { list
::iterator i = l.begin(); LL ans = i->first * a + i->second * b; for (++i; i != l.end(); i++) ans = max(ans, i->first * a + i->second * b); printf("%I64d", an