Task: | Prase |
Sender: | untokarila |
Submission time: | 2019-07-25 16:22:55 +0300 |
Language: | C++ (C++11) |
Status: | READY |
Result: | 100 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 100 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.01 s | details |
#2 | ACCEPTED | 0.01 s | details |
#3 | ACCEPTED | 0.01 s | details |
#4 | ACCEPTED | 0.01 s | details |
#5 | ACCEPTED | 0.01 s | details |
Code
#include <bits/stdc++.h> using namespace std; map<string, int> k; int main(){ int n, sum = 0, a = 0; cin >> n; for(int i=0; i<n; i++){ string s; cin >> s; if(k[s]>sum-k[s]) a++; k[s]++; sum++; } cout << a; return 0; }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
15
lamjb lamjb fwwox lamjb ... |
correct output |
---|
7 |
user output |
---|
7 |
Test 2
Verdict: ACCEPTED
input |
---|
33
cjukktvop kiqkjeyi cjukktvop cjukktvop ... |
correct output |
---|
9 |
user output |
---|
9 |
Test 3
Verdict: ACCEPTED
input |
---|
77
viqafjnw qsuxzkm tuhrdtuy tuhrdtuy ... |
correct output |
---|
15 |
user output |
---|
15 |
Test 4
Verdict: ACCEPTED
input |
---|
85
aakpckeajzxecvwwrfrf mrfplkgoeqbvfxawbbbp houyionbiqxcetvzodfo mrfplkgoeqbvfxawbbbp ... |
correct output |
---|
22 |
user output |
---|
22 |
Test 5
Verdict: ACCEPTED
input |
---|
100
lovro lovro luka luka ... |
correct output |
---|
25 |
user output |
---|
25 |