Submission #701718

# Submission time Handle Problem Language Result Execution time Memory
701718 2023-02-22T02:32:06 Z chenyan Kocka (COCI18_kocka) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pii pair<int,int>
#define ff first
#define ss second
#define all(x) x.begin(),x.end()
#define pb emplace_back
#define N 200010
vector<pii>v;
int a[4][N];
set<int>s[N];
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n,m,i,j,k;
	cin>>n;
	for(j=0;j<4;j++)for(i=0;i<n;i++)cin>>a[j][i];
	for(i=0;i<n;i++){
		for(j=0;j<3;j+=2){
			if((a[j][i]==-1||a[j+1][i]==-1)&&a[j][i]!=a[j+1][i]){
				cout<<"NE\n";
				return 0;
			}
			if(a[j][i]>n-1-a[j+1][i]){
				cout<<"NE\n";
				return 0;
			}
		}
		if(a[2][i]!=-1)s[a[2][i]].insert(i);
		if(a[3][i]!=-1)s[n-1-a[3][i]].insert(i);
	}
	for(i=0;i<n;i++){
		if(a[0][i]==-1)continue;
		if(s.lower_bound(a[0][i])!=s.begin()||s.upper_bound(a[1][i])!=s.end()){
			cout<<"NE\n";
		}
	}
	cout<<"DA\n";
}

Compilation message

kocka.cpp: In function 'int main()':
kocka.cpp:35:8: error: request for member 'lower_bound' in 's', which is of non-class type 'std::set<long long int> [200010]'
   35 |   if(s.lower_bound(a[0][i])!=s.begin()||s.upper_bound(a[1][i])!=s.end()){
      |        ^~~~~~~~~~~
kocka.cpp:35:32: error: request for member 'begin' in 's', which is of non-class type 'std::set<long long int> [200010]'
   35 |   if(s.lower_bound(a[0][i])!=s.begin()||s.upper_bound(a[1][i])!=s.end()){
      |                                ^~~~~
kocka.cpp:35:43: error: request for member 'upper_bound' in 's', which is of non-class type 'std::set<long long int> [200010]'
   35 |   if(s.lower_bound(a[0][i])!=s.begin()||s.upper_bound(a[1][i])!=s.end()){
      |                                           ^~~~~~~~~~~
kocka.cpp:35:67: error: request for member 'end' in 's', which is of non-class type 'std::set<long long int> [200010]'
   35 |   if(s.lower_bound(a[0][i])!=s.begin()||s.upper_bound(a[1][i])!=s.end()){
      |                                                                   ^~~
kocka.cpp:16:8: warning: unused variable 'm' [-Wunused-variable]
   16 |  int n,m,i,j,k;
      |        ^
kocka.cpp:16:14: warning: unused variable 'k' [-Wunused-variable]
   16 |  int n,m,i,j,k;
      |              ^