QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#712187 | #9578. 爱上字典 | fsy_juruo | WA | 0ms | 3616kb | C++17 | 644b | 2024-11-05 14:51:11 | 2024-11-05 14:51:12 |
Judging History
answer
#include <bits/stdc++.h>
using LL = long long;
int n;
std::unordered_map<std::string, int> occ;
std::unordered_set<std::string> dict;
int main() {
std::ios::sync_with_stdio(false); std::cin.tie(nullptr);
n = 0;
int ans = 0;
std::string str;
while(1) {
std::cin >> str;
if(isdigit(str[0])) {
n = std::stoi(str);
break;
}
str[0] = tolower(str[0]);
while(!isalpha(str.back())) str.pop_back();
occ[str]++;
++ans;
}
for(int i = 1; i <= n; i++) {
std::cin >> str;
if(dict.count(str)) continue;
ans -= occ[str];
dict.insert(str);
}
std::cout << ans << "\n";
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3564kb
input:
I love Liaoning. Love Dalian! 1 love
output:
3
result:
ok single line: '3'
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3616kb
input:
Sulfox Loves Furry! Fur fur Furred. 2 anthropomorphic furry
output:
5
result:
wrong answer 1st lines differ - expected: '4', found: '5'