online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
/****************************************************************************** Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. *******************************************************************************/ #include<iostream> using namespace std; using ll= long long ; int main() { ll n; cin>>n; ll a[10000000]; for(int i=0;i<n;i++){ cin>>a[i]; } ll s=0;ll e=n-1; ll mid; while(s<=e){ mid=(s+e)/2; if(a[mid]>a[mid+1]&&mid<e){ cout<<mid;break; } if(a[mid]<a[mid-1]&&mid>s){ cout<<mid-1;break; } if(a[s]>=a[mid]){ //left part will be unsorted and pivot will lie in left part e=mid-1; } if(a[e]<=a[mid]){ //right part will be unosorted and pivot will be in right part s=mid+1; } } return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue