foo.cc: In function 'int main()':
foo.cc:3:14: error: 'ios' has not been declared
3 | int main() { ios::sync_with_stdio(false); cin.tie(nullptr);
| ^~~
foo.cc:3:43: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
3 | int main() { ios::sync_with_stdio(false); cin.tie(nullptr);
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:146,
from foo.cc:1:
/usr/include/c++/13/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
foo.cc:10:5: error: 'vector' was not declared in this scope
10 | vector<int> A(N);
| ^~~~~~
foo.cc:10:5: note: suggested alternatives:
In file included from /usr/include/c++/13/vector:66,
from /usr/include/c++/13/functional:64,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:53:
/usr/include/c++/13/bits/stl_vector.h:428:11: note: 'std::vector'
428 | class vector : protected _Vector_base<_Tp, _Alloc>
| ^~~~~~
/usr/include/c++/13/vector:86:13: note: 'std::pmr::vector'
86 | using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
| ^~~~~~
foo.cc:10:12: error: expected primary-expression before 'int'
10 | vector<int> A(N);
| ^~~
foo.cc:11:40: error: 'A' was not declared in this scope
11 | for (int i = 0; i < N; i++) cin >> A[i];
| ^
foo.cc:14:5: error: 'map' was not declared in this scope
14 | map<int,int> freq;
| ^~~
foo.cc:14:5: note: suggested alternatives:
In file included from /usr/include/c++/13/map:63,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:152:
/usr/include/c++/13/bits/stl_map.h:102:11: note: 'std::map'
102 | class map
| ^~~
/usr/include/c++/13/map:80:13: note: 'std::pmr::map'
80 | using map
| ^~~
foo.cc:14:9: error: expected primary-expression before 'int'
14 | map<int,int> freq;
| ^~~
foo.cc:15:18: error: 'A' was not declared in this scope
15 | for (int x : A) freq[x]++;
| ^
foo.cc:15:21: error: 'freq' was not declared in this scope; did you mean 'free'?
15 | for (int x : A) freq[x]++;
| ^~~~
| free
foo.cc:16:12: error: expected primary-expression before 'int'
16 | vector<int> vals;
| ^~~
foo.cc:17:5: error: 'vals' was not declared in this scope
17 | vals.reserve(freq.size());
| ^~~~
foo.cc:17:18: error: 'freq' was not declared in this scope; did you mean 'free'?
17 | vals.reserve(freq.size());
| ^~~~
| free
foo.cc:22:12: error: expected primary-expression before 'int'
22 | vector<int> divisors;
| ^~~
foo.cc:25:13: error: 'divisors' was not declared in this scope
25 | divisors.push_back(d);
| ^~~~~~~~
foo.cc:29:10: error: 'divisors' was not declared in this scope
29 | sort(divisors.begin(), divisors.end());
| ^~~~~~~~
foo.cc:29:5: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
29 | sort(divisors.begin(), divisors.end());
| ^~~~
| std::sort
In file included from /usr/include/c++/13/algorithm:73,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51:
/usr/include/c++/13/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
foo.cc:39:9: error: 'unordered_set' was not declared in this scope
39 | unordered_set<int> Dset;
| ^~~~~~~~~~~~~
foo.cc:39:9: note: suggested alternatives:
In file included from /usr/include/c++/13/unordered_set:41,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:189:
/usr/include/c++/13/bits/unordered_set.h:104:11: note: 'std::unordered_set'
104 | class unordered_set
| ^~~~~~~~~~~~~
/usr/include/c++/13/unordered_set:58:13: note: 'std::pmr::unordered_set'
58 | using unordered_set
| ^~~~~~~~~~~~~
foo.cc:39:23: error: expected primary-expression before 'int'
39 | unordered_set<int> Dset;
| ^~~
foo.cc:41:9: error: 'Dset' was not declared in this scope
41 | Dset.insert(0);
| ^~~~
foo.cc:58:34: error: 'min' was not declared in this scope; did you mean 'std::min'?
58 | pairs += min(freq[x], it->second);
| ^~~
| std::min
In file included from /usr/include/c++/13/algorithm:61:
/usr/include/c++/13/bits/stl_algo.h:5785:5: note: 'std::min' declared here
5785 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
foo.cc:73:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
73 | cout << answer;
| ^~~~
| std::cout
/usr/include/c++/13/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~