|
|
back to boardweak tests I got AC. My solution uses simple stack with 15 elements in each node. System memory management functions have some memory overhead, so I take mem from static 512k heap. Memory freeing wasn't realized. When some POPs make node empty memory leaks. And next PUSH will alloc new node. Many POP-PUSH crash my programm. Here is example of such test #include <stdio.h> int main() { printf ("40015\n"); int i; for (i=0;i<15;++i) printf ("PUSH 1 %d\n", i+1); // full 1 node for (i=0;i<10000;++i) printf ("PUSH 1 %d\nPOP 1\nPOP 1\nPUSH 1 %d\n", i+1,i+100000); return 0; } |
|
|