Submission #685737

#TimeUsernameProblemLanguageResultExecution timeMemory
685737grossly_overconfidentFish (IOI08_fish)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define endl "\n" int main() { int f, k, m; vector<pair<int, int>> fish; cin >> f >> k >> m; for (int i = 0; i < f; ++i) { int a, b; cin >> a >> b; fish.push_back(make_pair(a, b)); } sort(fish.begin(), fish.end()); set<multiset<int>> s; set<pair<int, multiset<int>>> take; s.insert({}); take.insert(make_pair(0, {})); long long count = 0; for (auto i : fish) { for (auto k = take.begin(); k != take.end(); ++k) { auto j = *k; if (i.first >= 2 * j.first) { j.second.insert(i.second); if (s.count(j.second) == 0) { s.insert(j.second); take.insert(make_pair(i.first, j.second)); ++count; count %= m; } } } } cout << (count % m); return 0; }

Compilation message (stderr)

fish.cpp: In function 'int main()':
fish.cpp:19:29: error: no matching function for call to 'make_pair(int, <brace-enclosed initializer list>)'
   19 |  take.insert(make_pair(0, {}));
      |                             ^
In file included from /usr/include/c++/10/bits/stl_algobase.h:64,
                 from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from fish.cpp:2:
/usr/include/c++/10/bits/stl_pair.h:567:5: note: candidate: 'template<class _T1, class _T2> constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&)'
  567 |     make_pair(_T1&& __x, _T2&& __y)
      |     ^~~~~~~~~
/usr/include/c++/10/bits/stl_pair.h:567:5: note:   template argument deduction/substitution failed:
fish.cpp:19:29: note:   couldn't deduce template parameter '_T2'
   19 |  take.insert(make_pair(0, {}));
      |                             ^