QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#711953 | #9578. 爱上字典 | xydCatGirl# | RE | 0ms | 3540kb | C++20 | 759b | 2024-11-05 14:07:08 | 2024-11-05 14:07:08 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
map< string, bool > a, b;
string s, t;
char f(char x) {
if (x >= 'A' && x <= 'Z') return (char)('a' + (x - 'A'));
return x;
}
int main() {
getline(cin, s);
for (int l = 0, r = 0; l < s.size(); l = r + 1) {
r = l;
if (s[l] == ' ') continue;
while (s[r] != ' ') r ++;
r --;
t = "";
for (int i = l; i <= r; i ++)
if ((s[i] >= 'A' && s[i] <= 'Z') || (s[i] >= 'a' && s[i] <= 'z'))
t += f(s[i]);
a[t] = 1;
}
int n; cin >> n;
while (n --) {
cin >> s; b[s] = 1;
}
int ans = 0;
for (auto [x, y] : a)
if (!b[x]) ans ++;
cout << ans;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3540kb
input:
I love Liaoning. Love Dalian! 1 love
output:
3
result:
ok single line: '3'
Test #2:
score: -100
Runtime Error
input:
Sulfox Loves Furry! Fur fur Furred. 2 anthropomorphic furry