QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#711953#9578. 爱上字典xydCatGirl#RE 0ms3540kbC++20759b2024-11-05 14:07:082024-11-05 14:07:08

Judging History

你现在查看的是最新测评结果

  • [2024-11-05 14:07:08]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:3540kb
  • [2024-11-05 14:07:08]
  • 提交

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

output:


result: