ამოხსნების სტატუსი

ამ გვერდზე თქვენ იხილავთ გაგზავნილი ამოხსნების სტატუსს.


გაგზავნის თარიღი: 07.06.2021 01:34:20

ამოცანა: ტესტირების სისტემა

მომხმარებელი: bachana

ვერდიქტი: ამოუხსნელი

შეფასება: 0 ქულა







#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>

using namespace std;

int n;
int k, t, m[100005];

vector < pair <int, pair <int, int> > > vt;
vector < pair <int, pair <int, int> > > :: iterator it;

int main()
{
	cin >> n;
	
	for (int i = 0; i <= n; ++i)
	{
		cin >> k >> t;
		
		vt.push_back({k, {m - t, m - i}});
	}
	
	sort (vt.begin(), vt.end());
	reverse (vt.begin(), vt.end());
	
	for (it = vt.begin(), it != vt.end(), ++it)
	
		cout << m - (*it).second.second << " ";
	
	
	
}
PROB_cpp_UID1693PID360_d70903/main.cpp: In function 'int main()':
PROB_cpp_UID1693PID360_d70903/main.cpp:22:35: error: no matching function for call to 'std::vector<std::pair<int, std::pair<int, int> > >::push_back(<brace-enclosed initializer list>)'
   vt.push_back({k, {m - t, m - i}});
                                   ^
In file included from /usr/include/c++/6/vector:64:0,
                 from PROB_cpp_UID1693PID360_d70903/main.cpp:4:
/usr/include/c++/6/bits/stl_vector.h:914:7: note: candidate: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<int, std::pair<int, int> >; _Alloc = std::allocator<std::pair<int, std::pair<int, int> > >; std::vector<_Tp, _Alloc>::value_type = std::pair<int, std::pair<int, int> >]
       push_back(const value_type& __x)
       ^~~~~~~~~
/usr/include/c++/6/bits/stl_vector.h:914:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type& {aka const std::pair<int, std::pair<int, int> >&}'
/usr/include/c++/6/bits/stl_vector.h:932:7: note: candidate: void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = std::pair<int, std::pair<int, int> >; _Alloc = std::allocator<std::pair<int, std::pair<int, int> > >; std::vector<_Tp, _Alloc>::value_type = std::pair<int, std::pair<int, int> >]
       push_back(value_type&& __x)
       ^~~~~~~~~
/usr/include/c++/6/bits/stl_vector.h:932:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<std::pair<int, std::pair<int, int> > >::value_type&& {aka std::pair<int, std::pair<int, int> >&&}'
PROB_cpp_UID1693PID360_d70903/main.cpp:28:44: error: expected ';' before ')' token
  for (it = vt.begin(), it != vt.end(), ++it)
                                            ^
PROB_cpp_UID1693PID360_d70903/main.cpp:34:1: error: expected primary-expression before '}' token
 }
 ^
PROB_cpp_UID1693PID360_d70903/main.cpp:34:1: error: expected ';' before '}' token
PROB_cpp_UID1693PID360_d70903/main.cpp:34:1: error: expected primary-expression before '}' token
PROB_cpp_UID1693PID360_d70903/main.cpp:34:1: error: expected ')' before '}' token
PROB_cpp_UID1693PID360_d70903/main.cpp:34:1: error: expected primary-expression before '}' token