Task: | Prase |
Sender: | henrikaalto |
Submission time: | 2019-07-25 16:16:59 +0300 |
Language: | C++ (C++17) |
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; #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 |