Please read the new rule regarding the restriction on the use of AI tools. ×

kotwalnikhil's blog

By kotwalnikhil, history, 4 years ago, In English

Please can anyone tell me why my this submission for problem A of Educational Codeforces Round 95 was giving differnet o/p for the same testcase in different language. My Submission

In this I'm using pointer to copy first array's base address to other pointer i.e int *arr; int a[n];

arr=a; Is this causing different o/p ??

When i replaced this with for each i arr[i]=a[i] this caused runtime error on testcase 2 and passes testcase 1 My submission 2

I know i've initialized a pointer but not assigned any memory in heap but why it is passing test case 1 then ? Please help me to understand this situation. Thank you

Full text and comments »

  • Vote: I like it
  • -4
  • Vote: I do not like it