QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#712187#9578. 爱上字典fsy_juruoWA 0ms3616kbC++17644b2024-11-05 14:51:112024-11-05 14:51:12

Judging History

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

  • [2024-11-05 14:51:12]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3616kb
  • [2024-11-05 14:51:11]
  • 提交

answer

#include <bits/stdc++.h>
using LL = long long;

int n;
std::unordered_map<std::string, int> occ;
std::unordered_set<std::string> dict;
int main() {
	std::ios::sync_with_stdio(false); std::cin.tie(nullptr);
	
	n = 0;
	int ans = 0;
	std::string str;
	while(1) {
		std::cin >> str;

		if(isdigit(str[0])) {
			n = std::stoi(str);
			break;
		}

		str[0] = tolower(str[0]);
		while(!isalpha(str.back())) str.pop_back();

		occ[str]++;
		++ans;
	}

	for(int i = 1; i <= n; i++) {
		std::cin >> str;
		if(dict.count(str)) continue;
		ans -= occ[str];
		dict.insert(str);
	}

	std::cout << ans << "\n";
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

I love Liaoning. Love Dalian!
1
love

output:

3

result:

ok single line: '3'

Test #2:

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

input:

Sulfox Loves Furry! Fur fur Furred.
2
anthropomorphic furry

output:

5

result:

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