Submission #79983

# Submission time Handle Problem Language Result Execution time Memory
79983 2018-10-17T20:21:04 Z giorgikob Cave (IOI13_cave) C++14
Compilation error
0 ms 0 KB
#include "cave.h"
#include<bits/stdc++.h>
int ans[50005],ans1[50005],S[50005],fix[50005];
void exploreCave(int N) {
    for(int i=0;i<N;i++)
    {
    	for(int j=0;j<N;j++)
    	if(fix[j]==1)
    	S[j]=ans[j];
    	else
    	S[j]=0;
    	
		int x=tryCombination(S);
		bool k=false;//daxuruli
		if(x==-1 || x>i)k=true;//ghia 
		int L=i,R=N-1,ind=0;
		while(L<=R)
		{
			int mid=(L+R)/2;
			for(int j=L;j<=mid;j++)
			if(fix[j]==0)
			S[j]=1-S[j];
			
			x=tryCombination(S);
			bool w=false;//daxuruli
			if(x==-1 || x>i)
			w=true;//ghia
			
			if(k!=w)
			R=mid-1,ind=mid;
			else
			L=mid+1;
			k=w;
		}
		ans1[ind]=i;fix[ind]=1;
		(k==true)?ans[ind]=S[i]:ans[ind]=1-S[i];
		if(ans[i]!=0)cout<<"blablabla"<<endl;
	}
	
	answer(ans,ans1);
}

Compilation message

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:37:16: error: 'cout' was not declared in this scope
   if(ans[i]!=0)cout<<"blablabla"<<endl;
                ^~~~
cave.cpp:37:16: note: suggested alternative:
In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:75:0,
                 from cave.cpp:2:
/usr/include/c++/7/iostream:61:18: note:   'std::cout'
   extern ostream cout;  /// Linked to standard output
                  ^~~~
cave.cpp:37:35: error: 'endl' was not declared in this scope
   if(ans[i]!=0)cout<<"blablabla"<<endl;
                                   ^~~~
cave.cpp:37:35: note: suggested alternative:
In file included from /usr/include/c++/7/istream:39:0,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from cave.cpp:2:
/usr/include/c++/7/ostream:590:5: note:   'std::endl'
     endl(basic_ostream<_CharT, _Traits>& __os)
     ^~~~