CSES - COCI 2006/2007 #6 - Results
Submission details
Task:Prase
Sender:henrikaalto
Submission time:2019-07-25 16:16:59 +0300
Language:C++ (C++17)
Status:READY
Result:100
Feedback
groupverdictscore
#1ACCEPTED100
Test results
testverdicttime
#1ACCEPTED0.01 sdetails
#2ACCEPTED0.01 sdetails
#3ACCEPTED0.01 sdetails
#4ACCEPTED0.01 sdetails
#5ACCEPTED0.01 sdetails

Code

#include <bits/stdc++.h>
using namespace std;
#define all(x) x.begin(), x.end()
#define F first
#define S second
using pi=pair<int,int>;
using ii=long long;
int main()
{
    map<string, int> m;
    int n;
    cin >> n;
    int r = 0;
    for (int i = 0; i < n; ++i) {
        string s;
        cin >> s;
        if (m[s] > i- m[s]) {
            r++;
        }
        m[s]++;
    }
    cout << r << "\n";
}

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