the idea is when i find 4 I increase the number of taxis by one, and then i combine every 1's and 3's in one taxi, and i combine 2's with each other , and the remaining 2's and 1's i combine them and divide them by 4 and adds the result to number of taxis , if there is any remaining groups i increase the number of taxis by one . I get wrong answer at test case 64 and i don't know why so please any help . here is my submission code.............< 21109241 thanks in advance :D
Check this modified code:
thank you very much , i understand now what i did wrong . thank you a lot :D
can u plz write it in c?
Although, you can see the tutorial/solution for almost all questions.
Dear abirwaliullah98,
The following is a GNU C++17 solution for the problem using C++11 lambda expressions.
35443826
Best wishes,
thanks a lot
With pleasure.
The following solution declares another lambda expression
read_int
in themain()
function to read integers fromcin
. The return value of the lambda expression is used conveniently in the declaration statement ofn
, and as an index for the count arrayf
.35519772