nicegift.cpp: In function 'int main()':
nicegift.cpp:41:41: error: conversion from 'std::set<std::pair<long long int, int> >::iterator {aka std::_Rb_tree_const_iterator<std::pair<long long int, int> >}' to non-scalar type 'std::set<std::pair<int, int> >::iterator {aka std::_Rb_tree_const_iterator<std::pair<int, int> >}' requested
set<pair<int,int> >::iterator it=s.end();
~~~~~^~
nicegift.cpp:44:13: error: no matching function for call to 'std::set<std::pair<long long int, int> >::erase(std::set<std::pair<int, int> >::iterator&)'
s.erase(it);
^
In file included from /usr/include/c++/7/set:61:0,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:87,
from nicegift.cpp:1:
/usr/include/c++/7/bits/stl_set.h:644:7: note: candidate: std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::erase(std::set<_Key, _Compare, _Alloc>::const_iterator) [with _Key = std::pair<long long int, int>; _Compare = std::less<std::pair<long long int, int> >; _Alloc = std::allocator<std::pair<long long int, int> >; std::set<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree_const_iterator<std::pair<long long int, int> >; std::set<_Key, _Compare, _Alloc>::const_iterator = std::_Rb_tree_const_iterator<std::pair<long long int, int> >]
erase(const_iterator __position)
^~~~~
/usr/include/c++/7/bits/stl_set.h:644:7: note: no known conversion for argument 1 from 'std::set<std::pair<int, int> >::iterator {aka std::_Rb_tree_const_iterator<std::pair<int, int> >}' to 'std::set<std::pair<long long int, int> >::const_iterator {aka std::_Rb_tree_const_iterator<std::pair<long long int, int> >}'
/usr/include/c++/7/bits/stl_set.h:674:7: note: candidate: std::set<_Key, _Compare, _Alloc>::size_type std::set<_Key, _Compare, _Alloc>::erase(const key_type&) [with _Key = std::pair<long long int, int>; _Compare = std::less<std::pair<long long int, int> >; _Alloc = std::allocator<std::pair<long long int, int> >; std::set<_Key, _Compare, _Alloc>::size_type = long unsigned int; std::set<_Key, _Compare, _Alloc>::key_type = std::pair<long long int, int>]
erase(const key_type& __x)
^~~~~
/usr/include/c++/7/bits/stl_set.h:674:7: note: no known conversion for argument 1 from 'std::set<std::pair<int, int> >::iterator {aka std::_Rb_tree_const_iterator<std::pair<int, int> >}' to 'const key_type& {aka const std::pair<long long int, int>&}'
/usr/include/c++/7/bits/stl_set.h:696:7: note: candidate: std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::erase(std::set<_Key, _Compare, _Alloc>::const_iterator, std::set<_Key, _Compare, _Alloc>::const_iterator) [with _Key = std::pair<long long int, int>; _Compare = std::less<std::pair<long long int, int> >; _Alloc = std::allocator<std::pair<long long int, int> >; std::set<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree_const_iterator<std::pair<long long int, int> >; std::set<_Key, _Compare, _Alloc>::const_iterator = std::_Rb_tree_const_iterator<std::pair<long long int, int> >]
erase(const_iterator __first, const_iterator __last)
^~~~~
/usr/include/c++/7/bits/stl_set.h:696:7: note: candidate expects 2 arguments, 1 provided
nicegift.cpp:51:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0;i<v.size();i++)
~^~~~~~~~~
nicegift.cpp:61:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0;i<ans.size();i++)
~^~~~~~~~~~~
nicegift.cpp:64:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int j=0;j<ans[i].size();j++)
~^~~~~~~~~~~~~~