Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <string>
- using namespace std;
- int main()
- {
- int n;
- cin >> n;
- vector <pair <char, pair <int, int>>> s(n);
- for(int i = 0; i < n; i++)
- {
- char a; int o, l;
- cin >> a >> o >> l;
- cout << a << " " << o << " " << l << endl;
- s[i] = make_pair(a, make_pair(o, l));
- cout << s[i].first << " " << s[i].second.first << " " << s[i].second.second << endl;
- }
- int sf = 0, sm = 0, x = 0;
- for(int i = 1; i <= 366; i++)
- {
- for(int j = 0; j < n; j++)
- {
- int p, q;
- s[j].second.first = p; s[j].second.second = q;
- cout << j << " " << p << " " << q << endl;
- if((p <= i) and (i <= q))
- {
- if(s[j].first == 'F') sf++;
- else sm++;
- }
- }
- if((sf == sm) and (sf > x)) x = sf;
- sf = 0; sm = 0;
- }
- cout << x;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement