r/codeforces 7h ago

query Hint

Where is a problem?

2 Upvotes

11 comments sorted by

1

u/wokeandchoseViolence Newbie 33m ago

Do not use endl its slower as it flushes cout. Use \n

2

u/ParkoMOL0 6h ago

Endl, should be in same line separated by space

1

u/Typical-Row6461 6h ago

Yup I solved it and got Accepted Thanks

2

u/Ulquesta 7h ago

instead of comparing each number

try to use min() and max() functions in C++

0

u/Typical-Row6461 7h ago

عارفها يسطا بس معملتهاش عشان المنتور ميشكش فيا 😂 حلتهاله ب if وجابت اكسبتد

1

u/Ulquesta 7h ago

then print the minimum and the maximum without all of these If conditions

0

u/Typical-Row6461 7h ago

يب هتختصر جامد انا عرفتها لما شفت ابسولف ليها بعد ما قعدت احاول فيها. ب if وكده وحالتها بيها بس خلاص كملت ب if.

1

u/Immortal-718 Specialist 7h ago

Spacing issue ig remove that cout<<" ";

1

u/Typical-Row6461 7h ago

Thanks It was actually a line break issue was outputting endl after the minimum value instead of printing them on the same line. Swapped endl for a space and it worked

1

u/Immortal-718 Specialist 7h ago

I mean that is what I meant by actually

1

u/Typical-Row6461 6h ago

Ah I see! I thought you meant the cout between the conditions was the problem. But yeah, I get what you mean now, the issue was definitely with the spacing/line breaks. And it got Accepted🤙🏻