Submission #427797

#TimeUsernameProblemLanguageResultExecution timeMemory
427797Dan4LifeHorses (IOI15_horses)C++17
Compilation error
0 ms0 KiB
#include "horses.h" #include <bits/stdc++.h> using namespace std; vector<pair< pair<int,int>, int> > segtree[200000]; void build(int p, int l, int r) { if(l==r) segtree[p] = make_pair() else{ } } int init(int N, int X[], int Y[]) { return 0; } int updateX(int pos, int val) { return 0; } int updateY(int pos, int val) { return 0; } given an array, update x, it affects all future x, (multiply by x) update y, it affects only that position, create a max segment tree, that stores all {x*y, pos} get the max position with x*y in log N

Compilation message (stderr)

horses.cpp: In function 'void build(int, int, int)':
horses.cpp:9:34: error: no matching function for call to 'make_pair()'
    9 |  if(l==r) segtree[p] = make_pair()
      |                                  ^
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 horses.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:
horses.cpp:9:34: note:   candidate expects 2 arguments, 0 provided
    9 |  if(l==r) segtree[p] = make_pair()
      |                                  ^
horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:14:14: warning: unused parameter 'N' [-Wunused-parameter]
   14 | int init(int N, int X[], int Y[]) {
      |          ~~~~^
horses.cpp:14:21: warning: unused parameter 'X' [-Wunused-parameter]
   14 | int init(int N, int X[], int Y[]) {
      |                 ~~~~^~~
horses.cpp:14:30: warning: unused parameter 'Y' [-Wunused-parameter]
   14 | int init(int N, int X[], int Y[]) {
      |                          ~~~~^~~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:18:17: warning: unused parameter 'pos' [-Wunused-parameter]
   18 | int updateX(int pos, int val) {
      |             ~~~~^~~
horses.cpp:18:26: warning: unused parameter 'val' [-Wunused-parameter]
   18 | int updateX(int pos, int val) {
      |                      ~~~~^~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:22:17: warning: unused parameter 'pos' [-Wunused-parameter]
   22 | int updateY(int pos, int val) {
      |             ~~~~^~~
horses.cpp:22:26: warning: unused parameter 'val' [-Wunused-parameter]
   22 | int updateY(int pos, int val) {
      |                      ~~~~^~~
horses.cpp: At global scope:
horses.cpp:25:1: error: 'given' does not name a type
   25 | given an array,
      | ^~~~~
horses.cpp:30:1: error: 'get' does not name a type; did you mean 'getw'?
   30 | get the max position with x*y in log N
      | ^~~
      | getw