Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int min_cost[3] = {}, cnt_cost[3] = {};
- int n, mark, cost;
- string name, street;
- cin >> n;
- for(int i=0; i<n; ++i)
- {
- cin >> name >> street >> mark >> cost;
- int x = (mark - 92) / 3;
- if ( cost < min_cost[x] || min_cost[x] == 0 )
- {
- min_cost[x] = cost;
- cnt_cost[x] = 1;
- }
- else if ( cost == min_cost[x] )
- cnt_cost[x]++;
- }
- for(int i: cnt_cost) cout << i << " ";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement