Submission #1071509

# Submission time Handle Problem Language Result Execution time Memory
1071509 2024-08-23T07:57:11 Z vjudge1 Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#define int long long
#define boost ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define file(s) freopen(s".in", "r", stdin); freopen(s".out", "w", stdout)
const int N=1e6+1;
const int inf=1e18;
const int mod=1e9+7;
using namespace std;
vector<int>v;
signed main(){
	boost;
	int n,m;
	cin>>n>>m;
	v.push_back(0);
	for(int i=1;i<=n;i++){
		int x;
		cin>>x;
		v.push_back(x);
	}
	while(m--){
		int l,r,k;
		cin>>l>>r>>k;
		if(l==r){
			cout<<1<<"\n";
			continue;
		}
		int ok=0;
		int mx=0;
		for(int i=l;i<=r;i++){
			if(i!=l){
				if(mx>v[i]&&mx+v[i]>k){
					ok=1;
				}
			}
			mx=max(mx,v[i]);
		}
		if(ok==0){
			cout<<1<<"\n";
		}else{
			cout<<0<<"\n";
		}
		v1.clear();
	}
}

Compilation message

sortbooks.cpp: In function 'int main()':
sortbooks.cpp:42:3: error: 'v1' was not declared in this scope; did you mean '__pstl::execution::v1'?
   42 |   v1.clear();
      |   ^~
      |   __pstl::execution::v1
In file included from /usr/include/c++/10/pstl/glue_algorithm_defs.h:15,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from sortbooks.cpp:1:
/usr/include/c++/10/pstl/execution_defs.h:19:18: note: '__pstl::execution::v1' declared here
   19 | inline namespace v1
      |                  ^~