Binary search- Euron Problem. i am tle for this code.can anyone suggest any optimisation?

using namespace std;

int main() {
int n;
long a[n];
for(int i=0;i<n;i++)
int cnt=0;
for(int i=n-1;i>0;i–)
{ for(int j=i-1;j>=0;j–)

// your code goes here
return 0;


Please Format your code..
To solve it quickly, you can use policy based data structures.

1 Like

Also what everule1 said… Format the code

1 Like

thanks a lot :slight_smile: can you please guide more about formatting?

Use ``` this symbol at start of code and at the end

1 Like

@shreyaa04 You might wanna read/bookmark the following articles, which will help you to format and write better next time on the Code-Chef DIscuss platform.

  1. Good practice for asking help
  2. [Tutorial] CoLoR format the Code!
1 Like