-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path10141.cpp
More file actions
44 lines (35 loc) · 822 Bytes
/
10141.cpp
File metadata and controls
44 lines (35 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <iostream>
#include <string>
#include <vector>
#include <tuple>
using namespace std;
int main() {
int n, p, crep = 1;
string null;
while (true) {
cin >> n >> p;
if (n == 0 and p == 0) return 0;
if (crep != 1) cout << endl;
getline(cin, null);
for (int i = 0; i < n; i++) getline(cin, null);
double mprice;
int comp = -1;
string name;
for (int i = 0; i < p; i++) {
string pname;
double price;
int mr;
getline(cin, pname);
cin >> price >> mr;
if (mr > comp or (mr == comp and mprice > price)) {
comp = mr;
name = pname;
mprice = price;
}
getline(cin, null);
for (int j = 0; j < mr; j++) getline(cin, null);
}
cout << "RFP #" << crep++ << endl << name << endl;
}
return 0;
}