Sum lvl k - Generic Tree

Code: https://ide.codingblocks.com/s/234177

Getting WA for all tc and sample cases.
though the sample case does run on my local but shows no output when using custom input in coding blocks ide.

hi @Avi-Kasliwal-315786729062203 it is mentioned that max number of children will be 2 only so you can work with a binary tree :slight_smile:

I made a BT only now

@Avi-Kasliwal-315786729062203 what is the input that you used on your system?

1 2
2 1
3 2
4 0
5 0
6 2
7 0
8 1
9 0
2 [0 to 3]

and also the sample case given in the question.

@Avi-Kasliwal-315786729062203 the program is giving output upon removing these lines from the code #ifndef ONLINE_JUDGE
freopen(“input.txt”, “r”, stdin);
freopen(“output.txt”, “w”, stdout);
#endif

1 Like

@Ishitagambhir thanks, got AC :slight_smile:
I never used to remove those lines earlier and they always worked. donno what happen today

1 Like

@Avi-Kasliwal-315786729062203 there is some issue with the online judge, our team is working on it.

@Avi-Kasliwal-315786729062203 please mark your doubt as resolved

1 Like