QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#724829#9578. 爱上字典snow_mikumiku#WA 1ms3752kbC++14928b2024-11-08 15:14:502024-11-08 15:14:51

Judging History

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

  • [2024-11-08 15:14:51]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3752kb
  • [2024-11-08 15:14:50]
  • 提交

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 = "";
        }
    }
    if(tmp.size()) st.insert(tmp);
    auto cnt = st.size();
    int m;
    cin >> m;
    for(int i = 1; i <= m; i++) {
        cin >> tmp;
        cnt -= st.count(tmp);
    }
    cout << cnt;
}

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


詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3752kb

input:

I love Liaoning. Love Dalian!
1
love

output:

3

result:

ok single line: '3'

Test #2:

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

input:

Sulfox Loves Furry! Fur fur Furred.
2
anthropomorphic furry

output:

5

result:

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