Impact of endl

“\n” is better than endl

1 Like

why are u posting abt problems of ongoing contests and tagging others

who cares abt how u solved a problem???
people will figure out everything on their own

@ashokshaun when constraints fit the time limit in such a way that even [endl Vs “\n”] matters posting such questions and tagging relevant people matters right : ) . So no one is discussing algorithm related to ongoing contest problems here. Happy coding.

2 Likes

@anon8049083
i understand ur concern…but when i commented ,someone discussed their approach in the comments(maybe its deleted now)…so i wrote that comment and not to offend anyone

u can make a post saying how useful is \n but mentioning the particular problem and context is not a very good thing in my opinion…

no… this happens many times …not just here …even in other problems and other contests…so
“\n is not just \n”
its so powerful

2 Likes

I got used to endl so I didn’t know that endl vs “\n” matters. Yeah realized today :blush:

1 Like

:grinning::grinning:
i got tle so many times and sometimes even system tests failed :sweat_smile: just because of endl
so these days whenever i write in c++
i always write
#define endl “\n”

1 Like

yeah it works
#define endl '\n'
I used to think that using keywords as macros flags an error but that’s a wrong perception :slightly_smiling_face:
Now I don’t have to change my habit :upside_down_face:

1 Like

I disagree. Why are you posting this publicly ?
Ask in comments section. If found appropriate then they will change time limits.
endl vs \n is a very common and known optimization. You are expected to know this.
Especially for 6th que of long challenge.

2 Likes

@l_returns Yep, I’ll not repeat this

1 Like

Peace

1 Like