diff --git a/Codechef/MCUBES.cpp b/Codechef/MCUBES.cpp new file mode 100644 index 0000000..29b6b78 --- /dev/null +++ b/Codechef/MCUBES.cpp @@ -0,0 +1,32 @@ +// https://www.codechef.com/problems/MCUBES + +#include +using namespace std; +int main() +{ + long long n,temp,res=0; + cin>>n; + vector a; + + for(int i=0 ; i>temp; + a.push_back(temp); + } + bool flag=true; + for(int i=n-1 ; i>0 ; i--) + { + if(a[i]!=a[i-1]) + { + res = i+1; + flag=false; + break; + } + } + if(flag) + cout<<"1\n"; + else + cout<