fork download
  1. #include <functional>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6.  
  7. extern "C" int max_clique(int num_nodes, int* connects);
  8. // or extern "C" max_clique(int num_nodes, bool (*adj)(int,int));
  9.  
  10. static int connects1[9][9] = {
  11. {0,1,1,1,0,0,1,1,1},
  12. {1,0,1,1,0,0,0,1,1},
  13. {1,1,0,1,1,1,0,0,1},
  14. {1,1,1,0,1,1,1,0,0},
  15. {0,0,1,1,0,1,1,0,0},
  16. {0,0,1,1,1,0,1,1,1},
  17. {1,0,0,1,1,1,0,1,1},
  18. {1,1,0,0,0,1,1,0,1},
  19. {1,1,1,0,0,1,1,1,0}};
  20.  
  21. static int connects2[23][23] = {
  22. {0,0,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0},
  23. {0,0,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1},
  24. {1,1,0,0,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,0,1,0},
  25. {0,1,0,0,1,1,0,1,1,1,0,0,0,1,1,1,1,1,1,1,1,0,1},
  26. {1,1,1,1,0,1,1,0,1,1,1,0,0,0,1,1,1,1,1,1,1,1,0},
  27. {0,1,1,1,1,0,1,1,0,1,1,1,0,1,1,1,0,0,1,1,1,1,1},
  28. {1,0,1,0,1,1,0,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1},
  29. {1,0,0,1,0,1,1,0,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1},
  30. {1,0,0,1,1,0,1,1,0,1,1,0,1,1,1,0,1,1,1,1,1,1,1},
  31. {1,1,0,1,1,1,0,1,1,0,1,1,0,1,1,1,0,1,0,1,1,1,1},
  32. {1,1,1,0,1,1,1,0,1,1,0,1,1,0,1,1,1,0,0,0,1,1,1},
  33. {1,1,1,0,0,1,1,1,0,1,1,0,1,1,0,1,1,1,0,0,1,1,1},
  34. {1,1,1,0,0,0,1,1,1,0,1,1,0,1,1,0,1,1,1,0,1,1,1},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1,1,1,1,0,1},
  195. {1,1,1,1,0,0,1,1,0,1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,0,1,1,0,1,0,0,1,1,1,0,1,1,1,1,1,1,1,1,0,1,1,0,0,1,1,1,1,0}};
  196.  
  197.  
  198.  
  199. /**
  200.  * Whether two nodes are adjacent.
  201.  */
  202. bool adj1(int n1, int n2) {
  203. return connects1[n1][n2];
  204. }
  205.  
  206. /**
  207.  * Whether two nodes are adjacent.
  208.  */
  209. bool adj2(int n1, int n2) {
  210. return connects2[n1][n2];
  211. }
  212.  
  213. /**
  214.  * Whether two nodes are adjacent.
  215.  */
  216. bool adj3(int n1, int n2) {
  217. return connects3[n1][n2];
  218. }
  219.  
  220. /**
  221.  * Whether two nodes are adjacent.
  222.  */
  223. bool adj4(int n1, int n2) {
  224. return connects4[n1][n2];
  225. }
  226.  
  227. /**
  228.  * Whether two nodes are adjacent.
  229.  */
  230. bool adj5(int n1, int n2) {
  231. return connects5[n1][n2];
  232. }
  233.  
  234. int main() {
  235. cout << max_clique(9, &connects1[0][0]) << endl;
  236. cout << max_clique(23, &connects2[0][0]) << endl;
  237. cout << max_clique(41, &connects3[0][0]) << endl;
  238. cout << max_clique(51, &connects4[0][0]) << endl;
  239. cout << max_clique(53, &connects5[0][0]) << endl;
  240. return 0;
  241. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/home/Qv4QLk/ccx5HwJd.o: In function `main':
prog.cpp:(.text.startup+0x19): undefined reference to `max_clique'
prog.cpp:(.text.startup+0x3c): undefined reference to `max_clique'
prog.cpp:(.text.startup+0x5f): undefined reference to `max_clique'
prog.cpp:(.text.startup+0x82): undefined reference to `max_clique'
prog.cpp:(.text.startup+0xa5): undefined reference to `max_clique'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty