QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#715444 | #9578. 爱上字典 | NULL_SF | WA | 0ms | 3604kb | C++23 | 945b | 2024-11-06 12:09:03 | 2024-11-06 12:09:03 |
Judging History
answer
#include <iostream>
#include <sstream>
#include <set>
#include <string>
#include <vector>
int main() {
std::string line;
std::getline(std::cin, line); // 读取整行输入作为小说文本
std::istringstream iss(line);
std::set<std::string> s;
std::string word;
while (iss >> word) {
if (!word.empty() && (word.back() == '.' || word.back() == '?' || word.back() == '!' || word.back() == ',')) {
word.pop_back(); // 移除最后一个字符
}
s.insert(word);
}
int n;
std::cin >> n; // 读取小杏已经会的单词数量
std::cin.ignore(); // 忽略换行符
std::string dict_word;
for (int i = 0; i < n; ++i) {
std::getline(std::cin, dict_word); // 读取每个单词
s.erase(dict_word); // 从集合中移除单词
}
std::cout << s.size() << std::endl; // 输出集合的大小
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3604kb
input:
I love Liaoning. Love Dalian! 1 love
output:
4
result:
wrong answer 1st lines differ - expected: '3', found: '4'