sir my code is working even when i have written the same code explained by sir in the video. i am also having doubts in the code and i have marked my doubt in the code .
my code–> https://ide.codingblocks.com/s/480828
Allocation doubt
hello @tejuschaturvedi0
#define IOS ios::sync_with_stdio(0); ci //something written but not clearly visible
this is related to fast io . if u are beginner then u can ignore this. even if u dont include it ur program will run fine.
#define endl "\n" // why endl is defined like this as never defined earlier
endl clear out the flush which takes time to avoid it we have changed it to \n.
again u can ignore this ,ur code will work fine without this line.
const int n=1e5+5; //what is this line (const ? and value of n ?)
using namespace std;
int n,b; //why sir has declared these variables out of main
int a[n];
if we declare any variable as global than we need to give a constant size to that array.
hence we are using const with value n.
most cp people prefer to declare all their variables and array out of the main .no other reason.
again u can follow ur conventional method that will work fine too