+// Naively implemented by kim\r
+\r
+unsigned int countResult(results R) {\r
+ unsigned int result = -1;\r
+ int i = 0;\r
+ while ( i != -1 && i < R.n) {\r
+ result ++; \r
+ i = unconv(nextLarger(R.tree,R.n,conv(i+1,R.n,R.lgn),0,R.lgn),R.n,R.lgn);\r
+ };\r
+ return result;\r
+ \r
+}\r
+\r
+\r