Why different output with GNU C++11 and C++14 for my submission ?

Revision en1, by kotwalnikhil, 2020-09-15 12:30:32

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

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English kotwalnikhil 2020-09-15 12:30:32 823 Initial revision (published)