diff --git a/problem/P1097/P1097.cpp b/problem/P1097/P1097.cpp new file mode 100644 index 00000000..aebefaeb --- /dev/null +++ b/problem/P1097/P1097.cpp @@ -0,0 +1,19 @@ +#include + +using namespace std; + +int main() { + set s; + map m; + int n, t; + cin >> n; + while (n--) { + cin >> t; + s.insert(t); + m[t]++; + } + for (set::iterator it = s.begin(); it != s.end(); it++) { + cout << *it << ' ' << m[*it] << endl; + } + return 0; +}