-
Notifications
You must be signed in to change notification settings - Fork 0
/
everywhere.cpp
46 lines (38 loc) · 944 Bytes
/
everywhere.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
* @file everywhere.cpp
* @author William Weston
* @brief EveryWhere Problem from Kattis
* @version 0.1
* @date 2023-06-16
*
* @copyright Copyright (c) 2023
*
* Source: https://open.kattis.com/problems/everywhere
*/
#include <cstdlib>
#include <iostream>
#include <string>
#include <unordered_set>
#include <utility>
auto
main() -> int
{
int test_cases;
while ( std::cin >> test_cases )
{
for ( auto test_case = 0; test_case < test_cases; ++test_case )
{
int number_of_trips;
std::cin >> number_of_trips;
auto cities_visited = std::unordered_set<std::string>();
for ( auto trip = 0; trip < number_of_trips; ++trip )
{
auto city = std::string();
std::cin >> city;
cities_visited.insert( std::move( city ) );
}
std::cout << cities_visited.size() << '\n';
}
}
return EXIT_SUCCESS;
}