Two similar codes (almost ), one getting RUNTIME error & the other got AC

first i submitted using vector (i have done this earlier in other problems successfully :slight_smile: ) but got runtime error & same code i submitted using structure(everything was same except i stored the value in struct variable instead of vector ) & … got AC . lol !!

[CodeChef: Practical coding for everyone][1] (using vector)

[CodeChef: Practical coding for everyone][2] (using structure)

i’d appreciate if anyone willing to answer … :slight_smile:
[1]: CodeChef: Practical coding for everyone
[2]: CodeChef: Practical coding for everyone

Is that a problem? I do not know…

int s=a[0].p; // AC

and

s=a[0][2]; // RE

try it…

no that’s not…as a[0].p(in AC) represents the same thing as a[0][2] (in RE) …

problem is maybe, that there is int missing in RE, not sure if macro is not applied, try it :wink:

i declared int s already above(in RE ) … see yourself (line 120) :slight_smile:

Hi Sagar, we’d suggest you to post your query on the editorial page of the problem. It will help you get over the query sooner.

1 Like