Submission #1363364

#TimeUsernameProblemLanguageResultExecution timeMemory
1363364khangai11New Home (APIO18_new_home)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;
#define ll long long
map<int,int> nz;
vector<pair<int,int>> sg,sg1;
vector<int> nz1;
int sz=1;
void solve(){
	int n,k,q;
	cin>>n>>k>>q;
	set<int> za;
	vector<int> x(n),t(n),A(n),B(n);
	vector<pair<pair<int,int>,pair<int,int>>> Q;
	for(int a=0;a<n;a++){
		cin>>x[a]>>t[a]>>A[a]>>B[a];
		za.insert(x[a]);
		Q.push_back({{A[a],1},{x[a],t[a]}});
		Q.push_back({{B[a]+1,2},{x[a],t[a]}});
	}
	vector<int> l(q),y(q);
	for(int a=0;a<q;a++){
		cin>>l[a]>>y[a];
		za.insert(l[a]);
		Q.push_back({{y[a],3},{l[a],0}});
	}
	nz1.resize(za.size());
	ll i=0;
	for(auto z:za){
		nz1[i]=z;
		nz[z]=i++;
	}
	while(sz<za.size()){
		sz*=2;
	}
	sg.resize(sz*2,1e9);
	
}
signed main(){
	ios::sync_with_stdio();
	cin.tie(0);
	cout.tie(0);
	ll t=1;
//	cin>>t;
	for(ll a=0;a<t;a++){
		solve();
	}
}

Compilation message (stderr)

new_home.cpp: In function 'void solve()':
new_home.cpp:35:18: error: no matching function for call to 'std::vector<std::pair<int, int> >::resize(int, double)'
   35 |         sg.resize(sz*2,1e9);
      |         ~~~~~~~~~^~~~~~~~~~
In file included from /usr/include/c++/13/vector:66,
                 from /usr/include/c++/13/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:53,
                 from new_home.cpp:1:
/usr/include/c++/13/bits/stl_vector.h:1013:7: note: candidate: 'constexpr void std::vector<_Tp, _Alloc>::resize(size_type) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; size_type = long unsigned int]'
 1013 |       resize(size_type __new_size)
      |       ^~~~~~
/usr/include/c++/13/bits/stl_vector.h:1013:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/13/bits/stl_vector.h:1034:7: note: candidate: 'constexpr void std::vector<_Tp, _Alloc>::resize(size_type, const value_type&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; size_type = long unsigned int; value_type = std::pair<int, int>]'
 1034 |       resize(size_type __new_size, const value_type& __x)
      |       ^~~~~~
/usr/include/c++/13/bits/stl_vector.h:1034:54: note:   no known conversion for argument 2 from 'double' to 'const std::vector<std::pair<int, int> >::value_type&' {aka 'const std::pair<int, int>&'}
 1034 |       resize(size_type __new_size, const value_type& __x)
      |                                    ~~~~~~~~~~~~~~~~~~^~~