abc185_a - Abc Preparation
13 Dec 2020 — Tags: easy — URLThe answer is the minimum of $a_1$, $a_2$, $a_3$ and $a_4$.
Time complexity: $O(1)$
Memory complexity: $O(1)$
Click to show code.
using namespace std;
template <typename InputIterator,
typename T = typename iterator_traits<InputIterator>::value_type>
void read_n(InputIterator it, int n)
{
copy_n(istream_iterator<T>(cin), n, it);
}
int main(void)
{
ios::sync_with_stdio(false), cin.tie(NULL);
array<int, 4> a;
read_n(begin(a), 4);
cout << *min_element(begin(a), end(a)) << endl;
return 0;
}