Submission #498799

# Submission time Handle Problem Language Result Execution time Memory
498799 2021-12-26T11:24:43 Z Abdurahmon Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) C++14
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#pragma GCC target ("avx2");
#pragma GCC optimization ("O3");
#pragma GCC optimization ("unroll-loops");
ll t[1000000];
void solve()
{
	int l,r,k;ll m=0;
	cin>>l>>r>>k;
	l--;r--;
	for(int c=l;c<=r;c++)
	{
		if(t[c]<m)
		{
		if(t[c]+m>k&&c>0)
		{
			cout<<"0\n";return;
		}
		}
		else
		{
			m=t[c];
		}
	}
	cout<<"1\n";
}
int main()
{
ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
int n,m;
cin>>n>>m;
for(int c=0;c<n;c++)
{
	cin>>t[c];
}
while(m--)
{
	solve();
}
}

Compilation message

sortbooks.cpp:5: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    5 | #pragma GCC optimization ("O3");
      | 
sortbooks.cpp:6: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    6 | #pragma GCC optimization ("unroll-loops");
      | 
sortbooks.cpp:4:28: error: '#pragma GCC target' string is badly formed
    4 | #pragma GCC target ("avx2");
      |                            ^