boat.cpp: In function 'int main()':
boat.cpp:33:2: warning: 'auto' changes meaning in C++11; please remove it [-Wc++0x-compat]
auto it1 = S.begin(), it2 = it1;
^
boat.cpp:33:7: error: 'it1' does not name a type
auto it1 = S.begin(), it2 = it1;
^
boat.cpp:35:2: error: 'it2' was not declared in this scope
it2++, w[++w_len] = { 0,*it1 - 1 };
^
boat.cpp:35:27: error: 'it1' was not declared in this scope
it2++, w[++w_len] = { 0,*it1 - 1 };
^
boat.cpp:35:35: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
it2++, w[++w_len] = { 0,*it1 - 1 };
^
boat.cpp:35:20: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
it2++, w[++w_len] = { 0,*it1 - 1 };
^
boat.cpp:35:20: error: no match for 'operator=' (operand types are 'std::pair<int, int>' and '<brace-enclosed initializer list>')
In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0,
from /usr/include/c++/5/bits/stl_tree.h:63,
from /usr/include/c++/5/map:60,
from boat.cpp:2:
/usr/include/c++/5/bits/stl_pair.h:96:12: note: candidate: std::pair<int, int>& std::pair<int, int>::operator=(const std::pair<int, int>&)
struct pair
^
/usr/include/c++/5/bits/stl_pair.h:96:12: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::pair<int, int>&'
boat.cpp:37:45: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
M[*it1] = ++w_len, w[w_len] = { *it1,*it1 };
^
boat.cpp:37:31: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
M[*it1] = ++w_len, w[w_len] = { *it1,*it1 };
^
boat.cpp:37:31: error: no match for 'operator=' (operand types are 'std::pair<int, int>' and '<brace-enclosed initializer list>')
In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0,
from /usr/include/c++/5/bits/stl_tree.h:63,
from /usr/include/c++/5/map:60,
from boat.cpp:2:
/usr/include/c++/5/bits/stl_pair.h:96:12: note: candidate: std::pair<int, int>& std::pair<int, int>::operator=(const std::pair<int, int>&)
struct pair
^
/usr/include/c++/5/bits/stl_pair.h:96:12: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::pair<int, int>&'
boat.cpp:38:62: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
if (*it1 + 1 <= *it2 - 1) w[++w_len] = { *it1 + 1,*it2 - 1 };
^
boat.cpp:38:40: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
if (*it1 + 1 <= *it2 - 1) w[++w_len] = { *it1 + 1,*it2 - 1 };
^
boat.cpp:38:40: error: no match for 'operator=' (operand types are 'std::pair<int, int>' and '<brace-enclosed initializer list>')
In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0,
from /usr/include/c++/5/bits/stl_tree.h:63,
from /usr/include/c++/5/map:60,
from boat.cpp:2:
/usr/include/c++/5/bits/stl_pair.h:96:12: note: candidate: std::pair<int, int>& std::pair<int, int>::operator=(const std::pair<int, int>&)
struct pair
^
/usr/include/c++/5/bits/stl_pair.h:96:12: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::pair<int, int>&'
boat.cpp:40:46: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
} M[*it1] = ++w_len, w[w_len] = { *it1,*it1 };
^
boat.cpp:40:32: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
} M[*it1] = ++w_len, w[w_len] = { *it1,*it1 };
^
boat.cpp:40:32: error: no match for 'operator=' (operand types are 'std::pair<int, int>' and '<brace-enclosed initializer list>')
In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0,
from /usr/include/c++/5/bits/stl_tree.h:63,
from /usr/include/c++/5/map:60,
from boat.cpp:2:
/usr/include/c++/5/bits/stl_pair.h:96:12: note: candidate: std::pair<int, int>& std::pair<int, int>::operator=(const std::pair<int, int>&)
struct pair
^
/usr/include/c++/5/bits/stl_pair.h:96:12: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::pair<int, int>&'
boat.cpp:27:17: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &n);
^
boat.cpp:29:44: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d", &r[i].first, &r[i].second);
^