QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#724829 | #9578. 爱上字典 | snow_mikumiku# | WA | 1ms | 3752kb | C++14 | 928b | 2024-11-08 15:14:50 | 2024-11-08 15:14:51 |
Judging History
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'