QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#724838#9578. 爱上字典snow_mikumiku#WA 0ms3616kbC++141007b2024-11-08 15:16:052024-11-08 15:16:06

Judging History

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

  • [2024-11-08 15:16:06]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3616kb
  • [2024-11-08 15:16:05]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
using LL = long long;
const int N = 5e6 + 10;

char v[N];
void solve()
{
    cin.getline(v, N - 5);
    multiset <string> st;
    string V = string(v);
    int n = V.size();
    string tmp;
    for(int i = 0; i < n; i++) {
        if(V[i] <= 'Z' && V[i] >= 'A') {
            V[i] += 32;
            tmp += V[i];
        }
        else if(V[i] <= 'z' && V[i] >= 'a') {
            tmp += V[i];
        }
        else {
            if(tmp.size()) st.insert(tmp);
            tmp = "";
        }
    }

    map <string, int> mp;
    if(tmp.size()) st.insert(tmp);
    auto cnt = st.size();
    int m;
    cin >> m;
    for(int i = 1; i <= m; i++) {
        cin >> tmp;
        if(!mp.count(tmp))
        cnt -= st.count(tmp);
        mp[tmp] = 1;
    }
    cout << cnt;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int t;
    t = 1;
    // cin >> t;
    while(t--) solve();
    return 0;
}


Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3616kb

input:

I love Liaoning. Love Dalian!
1
love

output:

3

result:

ok single line: '3'

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3552kb

input:

Sulfox Loves Furry! Fur fur Furred.
2
anthropomorphic furry

output:

5

result:

wrong answer 1st lines differ - expected: '4', found: '5'