ამ გვერდზე თქვენ იხილავთ გაგზავნილი ამოხსნების სტატუსს.
გაგზავნის თარიღი: 08.04.2021 12:58:15
ამოცანა: ფეხბურთის მატჩის ოქმი 2
მომხმარებელი: mirianashvili
ვერდიქტი: სრული ამოხსნა
შეფასება: 100.0 ქულა
#include <iostream> #include <string> #include <map> using namespace std; int main() { int n; map<string, int> m; cin >> n; for (int i = 0; i < n; i++) { string t; cin >> t; m[t] += 1; } string team = m.begin()->first; for (auto it = m.begin(); it != m.end(); it++) { if (it->second > m[team]) { team = it->first; } } cout << team << endl; cout << m[team] << " " << n - m[team] << endl; }
4 barcelona juventus barcelona barcelona
barcelona 3 1
barcelona 3 1
YES
2 dinamo dinamo
dinamo 2 0
dinamo 2 0
YES
7 dortmund dortmund dortmund dortmund paderborn dortmund dortmund
dortmund 6 1
dortmund 6 1
YES
3 bournemouth liverpool liverpool
liverpool 2 1
liverpool 2 1
YES
1 real
real 1 0
real 1 0
YES
5 torino torino torino torino verona
torino 4 1
torino 4 1
YES
7 dinamo torpedo torpedo dinamo dinamo torpedo torpedo
torpedo 4 3
torpedo 4 3
YES
3 gent gent gent
gent 3 0
gent 3 0
YES
3 chelsea chelsea everton
chelsea 2 1
chelsea 2 1
YES
5 boca boca boca boca boca
boca 5 0
boca 5 0
YES