Submission #24128

#TimeUsernameProblemLanguageResultExecution timeMemory
24128ms990606cmp (balkan11_cmp)C11
19 / 100
2057 ms82592 KiB
#include "cmp.h" void remember(int n) { int a[13],ans=0; for(int i=100;i<112;i++) { a[i]=( (n&(1<<(111-i))) > 0 ? 1 : 0); ans+=a[i]; } if(ans>6) { bit_set(1); for(int i=100;i<112;i++) { if(a[i]==0) bit_set(i); } } else { for(int i=100;i<112;i++) { if(a[i]==1) bit_set(i); } } } int compare(int b) { int a=bit_get(1); int c,d; for(int i=0;i<12;i++) { c=((b&(1<<(11-i)))?1:0); d=bit_get(i+100); if(a==1) d=1-d; if(c>d) return 1; if(c<d) return -1; } return 0; }

Compilation message (stderr)

cmp.c: In function 'remember':
cmp.c:7:6: warning: array subscript is above array bounds [-Warray-bounds]
     a[i]=( (n&(1<<(111-i))) > 0 ? 1 : 0);
     ~^~~
cmp.c:16:11: warning: array subscript is above array bounds [-Warray-bounds]
       if(a[i]==0) bit_set(i);
          ~^~~
cmp.c:23:11: warning: array subscript is above array bounds [-Warray-bounds]
       if(a[i]==1) bit_set(i);
          ~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...