Why is memset giving error here?

Revision en1, by ComboGirl, 2023-09-19 18:29:23

In the following two submissions 224059045 and 224058953 the only difference is one line where I replaced

memset(dc, n+5, sizeof(dc));

with

for(int i=1;i<=n;i++) dc[i] = n+5;

and it WA on the first but AC with the latter. I'm not sure why this is happening. Any ideas?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English ComboGirl 2023-09-19 18:29:23 479 Initial revision (published)