fork(8) download
  1. const int maxn = 1e5, sigma = 26;
  2.  
  3. int s[maxn], len[maxn], link[maxn], to[maxn][sigma];
  4.  
  5. int n, last, sz;
  6.  
  7. void init()
  8. {
  9. s[n++] = -1;
  10. link[0] = 1;
  11. len[1] = -1;
  12. sz = 2;
  13. }
  14.  
  15. int get_link(int v)
  16. {
  17. while(s[n - len[v] - 2] != s[n - 1]) v = link[v];
  18. return v;
  19. }
  20.  
  21. void add_letter(int c)
  22. {
  23. s[n++] = c;
  24. last = get_link(last);
  25. if(!to[last][c])
  26. {
  27. len [sz] = len[last] + 2;
  28. link[sz] = to[get_link(link[last])][c];
  29. to[last][c] = sz++;
  30. }
  31. last = to[last][c];
  32. }
Compilation error #stdin compilation error #stdout 0s 100928KB
stdin
Standard input is empty
compilation info
/usr/lib/gcc/i586-linux-gnu/4.9/../../../i386-linux-gnu/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty