QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#665007 | #5599. Repetitive Song | enze114514 | WA | 0ms | 3708kb | C++20 | 574b | 2024-10-22 00:28:47 | 2024-10-22 00:28:47 |
Judging History
answer
#include <iostream>
#include <unordered_map>
#include <string>
int main() {
int n;
std::cin >> n;
std::unordered_map<std::string, int> word_count;
std::string word;
int unique_once = 0;
for (int i = 0; i < n; ++i) {
std::cin >> word;
word_count[word]++;
}
for (const auto& entry : word_count) {
if (entry.second == 1) {
unique_once++;
}
}
int result = n - unique_once;
if (result >= n) result = n - 1;
std::cout << result << std::endl;
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3580kb
input:
10 bow bow chick chicka chicka bow bow chick chicka chicka
output:
9
result:
ok single line: '9'
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3708kb
input:
31 head shoulders knees and toes knees and toes head shoulders knees and toes knees and toes eyes and ears and mouth and nose head shoulders knees and toes knees and toes
output:
27
result:
wrong answer 1st lines differ - expected: '29', found: '27'