QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#734424 | #9578. 爱上字典 | Zhou_JK# | WA | 0ms | 3568kb | C++23 | 644b | 2024-11-11 10:22:41 | 2024-11-11 10:22:41 |
Judging History
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;
}
Details
Tip: Click on the bar to expand more detailed information
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'