QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#797967 | #9578. 爱上字典 | Yui | WA | 0ms | 3792kb | C++17 | 700b | 2024-12-03 22:01:13 | 2024-12-03 22:01:14 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 10;
using ll = long long;
void solve() {
string s;
getline(cin,s);
int n;cin>>n;
map<string,int>mp;
for(int i=0;i<n;i++){
string temp;
cin>>temp;
mp[temp]++;
}
string b;
int ans=0;
for(int i=0;i<s.size();i++){
if(s[i]!=','&&s[i]!='.'&&s[i]!='!'&&s[i]!='?'&&s[i]!=' '){
if(s[i]>='A'&&s[i]<='Z'){
b+=(s[i]+32);
}
else b+=s[i];
}
else{
if(b.size()==0)continue;
//cout<<b<<endl;
if(mp[b]==0)ans++;
b.clear();
}
}
cout<<ans<<endl;
}
int main() {
int _=1;
//cin >> _;
while (_--) {
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3596kb
input:
I love Liaoning. Love Dalian! 1 love
output:
3
result:
ok single line: '3'
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3792kb
input:
Sulfox Loves Furry! Fur fur Furred. 2 anthropomorphic furry
output:
5
result:
wrong answer 1st lines differ - expected: '4', found: '5'