QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#734424#9578. 爱上字典Zhou_JK#WA 0ms3568kbC++23644b2024-11-11 10:22:412024-11-11 10:22:41

Judging History

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

  • [2024-11-11 10:22:41]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3568kb
  • [2024-11-11 10:22:41]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
string s;
int n;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr),cout.tie(nullptr);
    getline(cin,s);
    cin>>n;
    map<string,bool>vis; 
    for(int i=1;i<=n;i++)
    {
        string str;
        cin>>str;
        vis[str]=true;
    }
    string cur;
    int ans=0;
    for(int i=0;i<(int)s.size();i++)
        if(s[i]=='.'||s[i]==' ')
        {
            if(cur!=""&&!vis.count(cur)) ans++;
            cur="";
        }
        else if(isalpha(s[i])) cur+=tolower(s[i]);
    if(cur!=""&&!vis.count(cur)) ans++;
    cout<<ans;
    return 0;
}

詳細信息

Test #1:

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

input:

I love Liaoning. Love Dalian!
1
love

output:

3

result:

ok single line: '3'

Test #2:

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

input:

Sulfox Loves Furry! Fur fur Furred.
2
anthropomorphic furry

output:

5

result:

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