fork(3) download
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include <stdio.h>
  3. #include <vector>
  4. #include <algorithm>
  5. #include <queue>
  6. #include <map>
  7.  
  8. using namespace std;
  9.  
  10. int solveAC(int n, int k, vector<int> & v);
  11. int solveWA(int n, int k, vector<int> & v);
  12.  
  13. int main() {
  14. for (int n = 2; n <= 8; n++) {
  15. for (int k = 2; k <= 8; k++) {
  16. vector<int> a(n);
  17. for (int i = 0; i < n; i++) {
  18. a[i] = 1 + i;
  19. }
  20. do {
  21. if (solveAC(n, k, a) != solveWA(n, k, a)) {
  22. printf("n=%d k=%d\n", n, k);
  23. for (int i = 0; i < n; i++) {
  24. printf("%d%c", a[i], " \n"[i == n - 1]);
  25. }
  26. printf("acceptedSolution=%d wrongSolution=%d\n\n", solveAC(n, k, a), solveWA(n, k, a));
  27. }
  28. } while (next_permutation(a.begin(), a.end()));
  29. }
  30. }
  31. return 0;
  32. }
  33.  
  34. int solveAC(int n, int k, vector<int> & v) {
  35. int temp, temp2;
  36. string s = "";
  37. int lol;
  38. for (temp = 0;temp<n;temp++)
  39. {
  40. lol = v[temp];
  41. s += char(lol + 48);
  42. }
  43. string target = s;
  44. sort(target.begin(), target.end());
  45. //cout<<target<<"\n";
  46. queue<pair<string, int>> q;
  47. q.push(make_pair(s, 0));
  48. map<string, bool> visited;
  49. while (!q.empty())
  50. {
  51. string st = q.front().first;
  52. int cnt = q.front().second;
  53. q.pop();
  54. if (visited[st]) continue;
  55. visited[st] = true;
  56. if (st == target)
  57. {
  58. return cnt;
  59. return 0;
  60. }
  61. cnt++;
  62. for (temp = 0;temp <= n - k;temp++)
  63. {
  64. string sst = st;
  65. int troll = 0;
  66. for (temp2 = temp;temp2<temp + k;temp2++)
  67. {
  68. sst[temp2] = st[temp + k - troll - 1];
  69. troll++;
  70. }
  71. //cout<<sst<<" "<<cnt<<"\n";
  72. q.push(make_pair(sst, cnt));
  73. }
  74. }
  75. return -1;
  76. }
  77.  
  78.  
  79. int solveWA(int n, int k, vector<int> & v) {
  80. {
  81. vector<int> a(n);
  82. int temp, temp2, temp3;
  83. for (temp = 0;temp<n;temp++)
  84. {
  85. a[temp] = v[temp];
  86. }
  87. vector<vector<int>> adj(n);
  88. for (temp = 0;temp<n;temp++)
  89. {
  90. int cnt = 1;
  91. for (temp2 = 0;temp2<n;temp2++)
  92. {
  93. if ((temp2 >= temp) && (temp2<temp + k) && (temp + k - cnt<n))
  94. {
  95. adj[temp2].push_back(temp + k - cnt);
  96. cnt++;
  97. }
  98. else
  99. {
  100. adj[temp2].push_back(temp2);
  101. }
  102. }
  103. }
  104. /*for(temp=0;temp<n;temp++)
  105. {
  106. printf("%d contains : ",temp);
  107. for(temp2=0;temp2<adj[temp].size();temp2++)
  108. {
  109. cout<<adj[temp][temp2]<<" ";
  110. }
  111. cout<<"\n";
  112. }*/
  113. int cnt = 0;
  114. for (temp = 0;temp<n;temp++)
  115. {
  116. vector<int> source(n);
  117. vector<bool> visited(n);
  118. for (temp2 = temp;temp2<n;temp2++)
  119. {
  120. if (a[temp2] == temp + 1) break;
  121.  
  122. }
  123. if (temp2 == temp)
  124. {
  125. continue;
  126. }
  127. int start = temp2;
  128. for (temp2 = 0;temp2<n;temp2++)
  129. {
  130. source[temp2] = -1;
  131. visited[temp2] = false;
  132. }
  133. int pos = start;
  134. queue<int> q;
  135. q.push(pos);
  136. while (!q.empty())
  137. {
  138.  
  139. pos = q.front();
  140. q.pop();
  141. visited[pos] = true;
  142. if (pos == temp) break;
  143. for (temp2 = 0;temp2<adj[pos].size();temp2++)
  144. {
  145. int thenode = adj[pos][temp2];
  146. bool cokor = true;
  147. for (int tmp = temp;tmp<n;tmp++)
  148. {
  149. int check = adj[tmp][temp2];
  150. if (check<temp) cokor = false;
  151. }
  152. if ((!visited[thenode]) && (cokor))
  153. {
  154. source[thenode] = pos;
  155. q.push(thenode);
  156. }
  157. }
  158. }
  159. if (source[temp] == -1)
  160. {
  161. return -1;
  162. }
  163. vector<int> ans;
  164. pos = temp;
  165. while (source[pos] != -1)
  166. {
  167. ans.push_back(pos);
  168. pos = source[pos];
  169.  
  170. }
  171. pos = start;
  172. cnt += ans.size();
  173. for (temp2 = ans.size() - 1;temp2 >= 0;temp2--)
  174. {
  175. for (temp3 = 0;temp3<adj[pos].size();temp3++)
  176. {
  177. int thenode = adj[pos][temp3];
  178. if (thenode == ans[temp2])
  179. {
  180. break;
  181. }
  182. }
  183. int kursor = temp3;
  184. vector<int> b(n);
  185. for (temp3 = 0;temp3<n;temp3++) b[temp3] = a[temp3];
  186. for (temp3 = 0;temp3<n;temp3++)
  187. {
  188. a[temp3] = b[adj[temp3][kursor]];
  189. }
  190. pos = ans[temp2];
  191. }
  192. //for(temp3=0;temp3<n;temp3++) cout<<a[temp3]<<" "; cout<<"\n";
  193. }
  194. return cnt;
  195. }
  196. }
  197.  
Time limit exceeded #stdin #stdout 5s 3736KB
stdin
Standard input is empty
stdout
n=6 k=4
1 2 3 5 6 4
acceptedSolution=8 wrongSolution=-1

n=6 k=4
1 2 3 6 4 5
acceptedSolution=8 wrongSolution=-1

n=6 k=4
1 2 4 3 6 5
acceptedSolution=7 wrongSolution=-1

n=6 k=4
1 2 4 5 3 6
acceptedSolution=9 wrongSolution=-1

n=6 k=4
1 2 4 6 5 3
acceptedSolution=8 wrongSolution=-1

n=6 k=4
1 2 5 3 4 6
acceptedSolution=9 wrongSolution=-1

n=6 k=4
1 2 5 4 6 3
acceptedSolution=8 wrongSolution=-1

n=6 k=4
1 2 5 6 3 4
acceptedSolution=8 wrongSolution=-1

n=6 k=4
1 2 6 3 5 4
acceptedSolution=8 wrongSolution=-1

n=6 k=4
1 2 6 4 3 5
acceptedSolution=8 wrongSolution=-1

n=6 k=4
1 3 2 4 6 5
acceptedSolution=10 wrongSolution=-1

n=6 k=4
1 3 2 5 4 6
acceptedSolution=9 wrongSolution=-1

n=6 k=4
1 3 4 2 5 6
acceptedSolution=9 wrongSolution=-1

n=6 k=4
1 3 4 6 2 5
acceptedSolution=7 wrongSolution=-1

n=6 k=4
1 3 5 2 6 4
acceptedSolution=8 wrongSolution=-1

n=6 k=4
1 3 5 4 2 6
acceptedSolution=8 wrongSolution=-1

n=6 k=4
1 3 5 6 4 2
acceptedSolution=9 wrongSolution=-1

n=6 k=4
1 3 6 2 4 5
acceptedSolution=7 wrongSolution=-1

n=6 k=4
1 3 6 4 5 2
acceptedSolution=8 wrongSolution=-1

n=6 k=4
1 3 6 5 2 4
acceptedSolution=9 wrongSolution=-1

n=6 k=4
1 4 2 3 5 6
acceptedSolution=9 wrongSolution=-1

n=6 k=4
1 4 2 5 6 3
acceptedSolution=7 wrongSolution=-1

n=6 k=4
1 4 2 6 3 5
acceptedSolution=8 wrongSolution=-1

n=6 k=4
1 4 3 5 2 6
acceptedSolution=8 wrongSolution=-1

n=6 k=4
1 4 3 6 5 2
acceptedSolution=6 wrongSolution=-1

n=6 k=4
1 4 5 2 3 6
acceptedSolution=8 wrongSolution=-1

n=6 k=4
1 4 5 3 6 2
acceptedSolution=9 wrongSolution=-1

n=6 k=4
1 4 6 2 5 3
acceptedSolution=9 wrongSolution=-1

n=6 k=4
1 4 6 3 2 5
acceptedSolution=7 wrongSolution=-1

n=6 k=4
1 4 6 5 3 2
acceptedSolution=8 wrongSolution=-1

n=6 k=4
1 5 2 3 6 4
acceptedSolution=7 wrongSolution=-1

n=6 k=4
1 5 2 4 3 6
acceptedSolution=8 wrongSolution=-1

n=6 k=4
1 5 2 6 4 3
acceptedSolution=9 wrongSolution=-1

n=6 k=4
1 5 3 2 4 6
acceptedSolution=8 wrongSolution=-1

n=6 k=4
1 5 3 4 6 2
acceptedSolution=8 wrongSolution=-1

n=6 k=4
1 5 3 6 2 4
acceptedSolution=8 wrongSolution=-1

n=6 k=4
1 5 4 2 6 3
acceptedSolution=7 wrongSolution=-1

n=6 k=4
1 5 4 6 3 2
acceptedSolution=8 wrongSolution=-1

n=6 k=4
1 5 6 3 4 2
acceptedSolution=7 wrongSolution=-1

n=6 k=4
1 5 6 4 2 3
acceptedSolution=7 wrongSolution=-1

n=6 k=4
1 6 2 4 5 3
acceptedSolution=8 wrongSolution=-1

n=6 k=4
1 6 2 5 3 4
acceptedSolution=9 wrongSolution=-1

n=6 k=4
1 6 3 2 5 4
acceptedSolution=6 wrongSolution=-1

n=6 k=4
1 6 3 4 2 5
acceptedSolution=8 wrongSolution=-1

n=6 k=4
1 6 3 5 4 2
acceptedSolution=9 wrongSolution=-1

n=6 k=4
1 6 4 2 3 5
acceptedSolution=9 wrongSolution=-1

n=6 k=4
1 6 4 3 5 2
acceptedSolution=9 wrongSolution=-1

n=6 k=4
1 6 4 5 2 3
acceptedSolution=7 wrongSolution=-1

n=6 k=4
1 6 5 2 4 3
acceptedSolution=8 wrongSolution=-1

n=6 k=4
1 6 5 3 2 4
acceptedSolution=8 wrongSolution=-1

n=6 k=4
2 1 3 5 4 6
acceptedSolution=10 wrongSolution=-1

n=6 k=4
2 1 3 6 5 4
acceptedSolution=5 wrongSolution=-1

n=6 k=4
2 1 4 3 5 6
acceptedSolution=7 wrongSolution=-1

n=6 k=4
2 1 4 5 6 3
acceptedSolution=4 wrongSolution=-1

n=6 k=4
2 1 4 6 3 5
acceptedSolution=7 wrongSolution=-1

n=6 k=4
2 1 5 3 6 4
acceptedSolution=7 wrongSolution=-1

n=6 k=4
2 1 5 4 3 6
acceptedSolution=3 wrongSolution=-1

n=6 k=4
2 1 5 6 4 3
acceptedSolution=6 wrongSolution=-1

n=6 k=4
2 1 6 3 4 5
acceptedSolution=4 wrongSolution=-1

n=6 k=4
2 1 6 4 5 3
acceptedSolution=9 wrongSolution=-1

n=6 k=4
2 3 1 4 5 6
acceptedSolution=8 wrongSolution=-1

n=6 k=4
2 3 1 6 4 5
acceptedSolution=8 wrongSolution=-1

n=6 k=4
2 3 4 5 1 6
acceptedSolution=4 wrongSolution=-1

n=6 k=4
2 3 5 1 4 6
acceptedSolution=7 wrongSolution=-1

n=6 k=4
2 3 5 4 6 1
acceptedSolution=7 wrongSolution=-1

n=6 k=4
2 3 6 1 5 4
acceptedSolution=5 wrongSolution=-1

n=6 k=4
2 3 6 4 1 5
acceptedSolution=6 wrongSolution=-1

n=6 k=4
2 3 6 5 4 1
acceptedSolution=8 wrongSolution=-1

n=6 k=4
2 4 1 3 6 5
acceptedSolution=7 wrongSolution=-1

n=6 k=4
2 4 1 5 3 6
acceptedSolution=8 wrongSolution=-1

n=6 k=4
2 4 1 6 5 3
acceptedSolution=8 wrongSolution=-1

n=6 k=4
2 4 3 1 5 6
acceptedSolution=8 wrongSolution=-1

n=6 k=4
2 4 3 5 6 1
acceptedSolution=7 wrongSolution=-1

n=6 k=4
2 4 3 6 1 5
acceptedSolution=5 wrongSolution=-1

n=6 k=4
2 4 5 1 6 3
acceptedSolution=6 wrongSolution=-1

n=6 k=4
2 4 5 3 1 6
acceptedSolution=9 wrongSolution=-1

n=6 k=4
2 4 5 6 3 1
acceptedSolution=7 wrongSolution=-1

n=6 k=4
2 4 6 1 3 5
acceptedSolution=9 wrongSolution=-1

n=6 k=4
2 4 6 3 5 1
acceptedSolution=9 wrongSolution=-1

n=6 k=4
2 4 6 5 1 3
acceptedSolution=7 wrongSolution=-1

n=6 k=4
2 5 1 3 4 6
acceptedSolution=7 wrongSolution=-1

n=6 k=4
2 5 1 4 6 3
acceptedSolution=9 wrongSolution=-1

n=6 k=4
2 5 1 6 3 4
acceptedSolution=6 wrongSolution=-1

n=6 k=4
2 5 3 1 6 4
acceptedSolution=9 wrongSolution=-1

n=6 k=4
2 5 3 4 1 6
acceptedSolution=8 wrongSolution=-1

n=6 k=4
2 5 3 6 4 1
acceptedSolution=10 wrongSolution=-1

n=6 k=4
2 5 4 1 3 6
acceptedSolution=7 wrongSolution=-1

n=6 k=4
2 5 4 3 6 1
acceptedSolution=7 wrongSolution=-1

n=6 k=4
2 5 4 6 1 3
acceptedSolution=8 wrongSolution=-1

n=6 k=4
2 5 6 1 4 3
acceptedSolution=9 wrongSolution=-1

n=6 k=4
2 5 6 3 1 4
acceptedSolution=6 wrongSolution=-1

n=6 k=4
2 5 6 4 3 1
acceptedSolution=6 wrongSolution=-1

n=6 k=4
2 6 1 3 5 4
acceptedSolution=9 wrongSolution=-1

n=6 k=4
2 6 1 5 4 3
acceptedSolution=7 wrongSolution=-1

n=6 k=4
2 6 3 1 4 5
acceptedSolution=6 wrongSolution=-1

n=6 k=4
2 6 3 4 5 1
acceptedSolution=8 wrongSolution=-1

n=6 k=4
2 6 3 5 1 4
acceptedSolution=7 wrongSolution=-1

n=6 k=4
2 6 4 1 5 3
acceptedSolution=8 wrongSolution=-1

n=6 k=4
2 6 4 5 3 1
acceptedSolution=8 wrongSolution=-1

n=6 k=4
2 6 5 4 1 3
acceptedSolution=5 wrongSolution=-1

n=6 k=4
3 1 2 4 5 6
acceptedSolution=8 wrongSolution=-1

n=6 k=4
3 1 2 5 6 4
acceptedSolution=8 wrongSolution=-1

n=6 k=4
3 1 4 2 6 5
acceptedSolution=7 wrongSolution=-1

n=6 k=4
3 1 4 6 5 2
acceptedSolution=9 wrongSolution=-1

n=6 k=4
3 1 5 2 4 6
acceptedSolution=8 wrongSolution=-1

n=6 k=4
3 1 5 4 6 2
acceptedSolution=5 wrongSolution=-1

n=6 k=4
3 1 5 6 2 4
acceptedSolution=6 wrongSolution=-1

n=6 k=4
3 1 6 2 5 4
acceptedSolution=8 wrongSolution=-1

n=6 k=4
3 1 6 4 2 5
acceptedSolution=9 wrongSolution=-1

n=6 k=4
3 1 6 5 4 2
acceptedSolution=7 wrongSolution=-1

n=6 k=4
3 2 1 4 6 5
acceptedSolution=5 wrongSolution=-1

n=6 k=4
3 2 1 6 5 4
acceptedSolution=6 wrongSolution=-1

n=6 k=4
3 2 4 1 5 6
acceptedSolution=8 wrongSolution=-1

n=6 k=4
3 2 4 5 6 1
acceptedSolution=5 wrongSolution=-1

n=6 k=4
3 2 4 6 1 5
acceptedSolution=9 wrongSolution=-1

n=6 k=4
3 2 5 1 6 4
acceptedSolution=8 wrongSolution=-1

n=6 k=4
3 2 5 6 4 1
acceptedSolution=6 wrongSolution=-1

n=6 k=4
3 2 6 5 1 4
acceptedSolution=7 wrongSolution=-1

n=6 k=4
3 4 1 2 5 6
acceptedSolution=8 wrongSolution=-1

n=6 k=4
3 4 1 5 6 2
acceptedSolution=5 wrongSolution=-1

n=6 k=4
3 4 2 1 6 5
acceptedSolution=6 wrongSolution=-1

n=6 k=4
3 4 2 5 1 6
acceptedSolution=9 wrongSolution=-1

n=6 k=4
3 4 2 6 5 1
acceptedSolution=6 wrongSolution=-1

n=6 k=4
3 4 5 6 1 2
acceptedSolution=7 wrongSolution=-1

n=6 k=4
3 4 6 1 5 2
acceptedSolution=10 wrongSolution=-1

n=6 k=4
3 4 6 5 2 1
acceptedSolution=7 wrongSolution=-1

n=6 k=4
3 5 1 2 6 4
acceptedSolution=6 wrongSolution=-1

n=6 k=4
3 5 1 4 2 6
acceptedSolution=8 wrongSolution=-1

n=6 k=4
3 5 1 6 4 2
acceptedSolution=9 wrongSolution=-1

n=6 k=4
3 5 2 1 4 6
acceptedSolution=9 wrongSolution=-1

n=6 k=4
3 5 2 4 6 1
acceptedSolution=10 wrongSolution=-1

n=6 k=4
3 5 2 6 1 4
acceptedSolution=9 wrongSolution=-1

n=6 k=4
3 5 4 1 6 2
acceptedSolution=8 wrongSolution=-1

n=6 k=4
3 5 4 2 1 6
acceptedSolution=8 wrongSolution=-1

n=6 k=4
3 5 4 6 2 1
acceptedSolution=5 wrongSolution=-1

n=6 k=4
3 5 6 1 2 4
acceptedSolution=7 wrongSolution=-1

n=6 k=4
3 5 6 2 4 1
acceptedSolution=7 wrongSolution=-1

n=6 k=4
3 5 6 4 1 2
acceptedSolution=8 wrongSolution=-1

n=6 k=4
3 6 1 2 4 5
acceptedSolution=5 wrongSolution=-1

n=6 k=4
3 6 1 4 5 2
acceptedSolution=7 wrongSolution=-1

n=6 k=4
3 6 1 5 2 4
acceptedSolution=9 wrongSolution=-1

n=6 k=4
3 6 2 1 5 4
acceptedSolution=7 wrongSolution=-1

n=6 k=4
3 6 2 4 1 5
acceptedSolution=7 wrongSolution=-1

n=6 k=4
3 6 2 5 4 1
acceptedSolution=6 wrongSolution=-1

n=6 k=4
3 6 4 1 2 5
acceptedSolution=6 wrongSolution=-1

n=6 k=4
3 6 4 2 5 1
acceptedSolution=10 wrongSolution=-1

n=6 k=4
3 6 4 5 1 2
acceptedSolution=6 wrongSolution=-1

n=6 k=4
3 6 5 1 4 2
acceptedSolution=6 wrongSolution=-1

n=6 k=4
3 6 5 2 1 4
acceptedSolution=7 wrongSolution=-1

n=6 k=4
3 6 5 4 2 1
acceptedSolution=4 wrongSolution=-1

n=6 k=4
4 1 2 3 6 5
acceptedSolution=4 wrongSolution=-1

n=6 k=4
4 1 2 5 3 6
acceptedSolution=7 wrongSolution=-1

n=6 k=4
4 1 2 6 5 3
acceptedSolution=5 wrongSolution=-1

n=6 k=4
4 1 3 5 6 2
acceptedSolution=6 wrongSolution=-1

n=6 k=4
4 1 3 6 2 5
acceptedSolution=9 wrongSolution=-1

n=6 k=4
4 1 5 2 6 3
acceptedSolution=9 wrongSolution=-1

n=6 k=4
4 1 5 3 2 6
acceptedSolution=7 wrongSolution=-1

n=6 k=4
4 1 6 2 3 5
acceptedSolution=6 wrongSolution=-1

n=6 k=4
4 1 6 3 5 2
acceptedSolution=8 wrongSolution=-1

n=6 k=4
4 1 6 5 2 3
acceptedSolution=9 wrongSolution=-1

n=6 k=4
4 2 1 3 5 6
acceptedSolution=8 wrongSolution=-1

n=6 k=4
4 2 1 5 6 3
acceptedSolution=5 wrongSolution=-1

n=6 k=4
4 2 1 6 3 5
acceptedSolution=8 wrongSolution=-1

n=6 k=4
4 2 3 1 6 5
acceptedSolution=9 wrongSolution=-1

n=6 k=4
4 2 3 5 1 6
acceptedSolution=8 wrongSolution=-1

n=6 k=4
4 2 3 6 5 1
acceptedSolution=4 wrongSolution=-1

n=6 k=4
4 2 5 1 3 6
acceptedSolution=9 wrongSolution=-1

n=6 k=4
4 2 5 3 6 1
acceptedSolution=9 wrongSolution=-1

n=6 k=4
4 2 5 6 1 3
acceptedSolution=10 wrongSolution=-1

n=6 k=4
4 2 6 1 5 3
acceptedSolution=8 wrongSolution=-1

n=6 k=4
4 2 6 3 1 5
acceptedSolution=8 wrongSolution=-1

n=6 k=4
4 2 6 5 3 1
acceptedSolution=8 wrongSolution=-1

n=6 k=4
4 3 1 2 6 5
acceptedSolution=6 wrongSolution=-1

n=6 k=4
4 3 1 5 2 6
acceptedSolution=9 wrongSolution=-1

n=6 k=4
4 3 2 6 1 5
acceptedSolution=7 wrongSolution=-1

n=6 k=4
4 3 5 1 6 2
acceptedSolution=7 wrongSolution=-1

n=6 k=4
4 3 5 2 1 6
acceptedSolution=8 wrongSolution=-1

n=6 k=4
4 3 5 6 2 1
acceptedSolution=7 wrongSolution=-1

n=6 k=4
4 3 6 1 2 5
acceptedSolution=9 wrongSolution=-1

n=6 k=4
4 3 6 2 5 1
acceptedSolution=8 wrongSolution=-1

n=6 k=4
4 5 1 3 6 2
acceptedSolution=6 wrongSolution=-1

n=6 k=4
4 5 1 6 2 3
acceptedSolution=7 wrongSolution=-1

n=6 k=4
4 5 2 1 6 3
acceptedSolution=9 wrongSolution=-1

n=6 k=4
4 5 2 6 3 1
acceptedSolution=7 wrongSolution=-1

n=6 k=4
4 5 3 1 2 6
acceptedSolution=7 wrongSolution=-1

n=6 k=4
4 5 3 2 6 1
acceptedSolution=6 wrongSolution=-1

n=6 k=4
4 5 3 6 1 2
acceptedSolution=8 wrongSolution=-1

n=6 k=4
4 5 6 2 1 3
acceptedSolution=6 wrongSolution=-1

n=6 k=4
4 6 1 2 5 3
acceptedSolution=10 wrongSolution=-1

n=6 k=4
4 6 1 3 2 5
acceptedSolution=8 wrongSolution=-1

n=6 k=4
4 6 1 5 3 2
acceptedSolution=6 wrongSolution=-1

n=6 k=4
4 6 2 1 3 5
acceptedSolution=7 wrongSolution=-1

n=6 k=4
4 6 2 3 5 1
acceptedSolution=5 wrongSolution=-1

n=6 k=4
4 6 2 5 1 3
acceptedSolution=8 wrongSolution=-1

n=6 k=4
4 6 3 1 5 2
acceptedSolution=7 wrongSolution=-1

n=6 k=4
4 6 3 2 1 5
acceptedSolution=5 wrongSolution=-1

n=6 k=4
4 6 3 5 2 1
acceptedSolution=10 wrongSolution=-1

n=6 k=4
4 6 5 1 2 3
acceptedSolution=6 wrongSolution=-1

n=6 k=4
4 6 5 2 3 1
acceptedSolution=7 wrongSolution=-1

n=6 k=4
4 6 5 3 1 2
acceptedSolution=7 wrongSolution=-1

n=6 k=4
5 1 2 3 4 6
acceptedSolution=4 wrongSolution=-1

n=6 k=4
5 1 2 4 6 3
acceptedSolution=6 wrongSolution=-1

n=6 k=4
5 1 2 6 3 4
acceptedSolution=5 wrongSolution=-1

n=6 k=4
5 1 3 2 6 4
acceptedSolution=5 wrongSolution=-1

n=6 k=4
5 1 3 4 2 6
acceptedSolution=8 wrongSolution=-1

n=6 k=4
5 1 3 6 4 2
acceptedSolution=7 wrongSolution=-1

n=6 k=4
5 1 4 2 3 6
acceptedSolution=9 wrongSolution=-1

n=6 k=4
5 1 4 6 2 3
acceptedSolution=6 wrongSolution=-1

n=6 k=4
5 1 6 3 2 4
acceptedSolution=8 wrongSolution=-1

n=6 k=4
5 1 6 4 3 2
acceptedSolution=5 wrongSolution=-1

n=6 k=4
5 2 1 3 6 4
acceptedSolution=9 wrongSolution=-1

n=6 k=4
5 2 1 4 3 6
acceptedSolution=6 wrongSolution=-1

n=6 k=4
5 2 1 6 4 3
acceptedSolution=7 wrongSolution=-1

n=6 k=4
5 2 3 1 4 6
acceptedSolution=8 wrongSolution=-1

n=6 k=4
5 2 3 4 6 1
acceptedSolution=8 wrongSolution=-1

n=6 k=4
5 2 3 6 1 4
acceptedSolution=7 wrongSolution=-1

n=6 k=4
5 2 4 1 6 3
acceptedSolution=8 wrongSolution=-1

n=6 k=4
5 2 4 3 1 6
acceptedSolution=9 wrongSolution=-1

n=6 k=4
5 2 4 6 3 1
acceptedSolution=10 wrongSolution=-1

n=6 k=4
5 2 6 1 3 4
acceptedSolution=10 wrongSolution=-1

n=6 k=4
5 2 6 3 4 1
acceptedSolution=5 wrongSolution=-1

n=6 k=4
5 2 6 4 1 3
acceptedSolution=7 wrongSolution=-1

n=6 k=4
5 3 1 2 4 6
acceptedSolution=9 wrongSolution=-1

n=6 k=4
5 3 1 4 6 2
acceptedSolution=7 wrongSolution=-1

n=6 k=4
5 3 1 6 2 4
acceptedSolution=9 wrongSolution=-1

n=6 k=4
5 3 2 1 6 4
acceptedSolution=7 wrongSolution=-1

n=6 k=4
5 3 2 4 1 6
acceptedSolution=9 wrongSolution=-1

n=6 k=4
5 3 2 6 4 1
acceptedSolution=6 wrongSolution=-1

n=6 k=4
5 3 4 1 2 6
acceptedSolution=7 wrongSolution=-1

n=6 k=4
5 3 4 2 6 1
acceptedSolution=8 wrongSolution=-1

n=6 k=4
5 3 4 6 1 2
acceptedSolution=6 wrongSolution=-1

n=6 k=4
5 3 6 1 4 2
acceptedSolution=8 wrongSolution=-1

n=6 k=4
5 3 6 2 1 4
acceptedSolution=6 wrongSolution=-1

n=6 k=4
5 3 6 4 2 1
acceptedSolution=10 wrongSolution=-1

n=6 k=4
5 4 1 3 2 6
acceptedSolution=8 wrongSolution=-1

n=6 k=4
5 4 1 6 3 2
acceptedSolution=7 wrongSolution=-1

n=6 k=4
5 4 2 1 3 6
acceptedSolution=8 wrongSolution=-1

n=6 k=4
5 4 2 3 6 1
acceptedSolution=6 wrongSolution=-1

n=6 k=4
5 4 3 2 1 6
acceptedSolution=5 wrongSolution=-1

n=6 k=4
5 4 6 1 2 3
acceptedSolution=6 wrongSolution=-1

n=6 k=4
5 4 6 2 3 1
acceptedSolution=7 wrongSolution=-1

n=6 k=4
5 4 6 3 1 2
acceptedSolution=7 wrongSolution=-1

n=6 k=4
5 6 1 2 3 4
acceptedSolution=7 wrongSolution=-1

n=6 k=4
5 6 1 4 2 3
acceptedSolution=8 wrongSolution=-1

n=6 k=4
5 6 2 3 1 4
acceptedSolution=6 wrongSolution=-1

n=6 k=4
5 6 3 1 2 4
acceptedSolution=8 wrongSolution=-1

n=6 k=4
5 6 3 2 4 1
acceptedSolution=7 wrongSolution=-1

n=6 k=4
5 6 4 1 3 2
acceptedSolution=7 wrongSolution=-1

n=6 k=4
5 6 4 2 1 3
acceptedSolution=7 wrongSolution=-1

n=6 k=4
5 6 4 3 2 1
acceptedSolution=8 wrongSolution=-1

n=6 k=4
6 1 2 4 3 5
acceptedSolution=7 wrongSolution=-1

n=6 k=4
6 1 2 5 4 3
acceptedSolution=8 wrongSolution=-1

n=6 k=4
6 1 3 2 4 5
acceptedSolution=7 wrongSolution=-1

n=6 k=4
6 1 3 4 5 2
acceptedSolution=8 wrongSolution=-1

n=6 k=4
6 1 3 5 2 4
acceptedSolution=10 wrongSolution=-1

n=6 k=4
6 1 4 2 5 3
acceptedSolution=9 wrongSolution=-1

n=6 k=4
6 1 4 3 2 5
acceptedSolution=7 wrongSolution=-1

n=6 k=4
6 1 4 5 3 2
acceptedSolution=6 wrongSolution=-1

n=6 k=4
6 1 5 2 3 4
acceptedSolution=7 wrongSolution=-1

n=6 k=4
6 1 5 3 4 2
acceptedSolution=8 wrongSolution=-1

n=6 k=4
6 2 1 3 4 5
acceptedSolution=5 wrongSolution=-1

n=6 k=4
6 2 1 5 3 4
acceptedSolution=6 wrongSolution=-1

n=6 k=4
6 2 3 4 1 5
acceptedSolution=8 wrongSolution=-1

n=6 k=4
6 2 4 1 3 5
acceptedSolution=9 wrongSolution=-1

n=6 k=4
6 2 4 3 5 1
acceptedSolution=7 wrongSolution=-1

n=6 k=4
6 2 5 1 4 3
acceptedSolution=8 wrongSolution=-1

n=6 k=4
6 2 5 3 1 4
acceptedSolution=10 wrongSolution=-1

n=6 k=4
6 2 5 4 3 1
acceptedSolution=6 wrongSolution=-1

n=6 k=4
6 3 1 2 5 4
acceptedSolution=6 wrongSolution=-1

n=6 k=4
6 3 1 4 2 5
acceptedSolution=10 wrongSolution=-1

n=6 k=4
6 3 1 5 4 2
acceptedSolution=6 wrongSolution=-1

n=6 k=4
6 3 2 1 4 5
acceptedSolution=8 wrongSolution=-1

n=6 k=4
6 3 2 4 5 1
acceptedSolution=5 wrongSolution=-1

n=6 k=4
6 3 2 5 1 4
acceptedSolution=6 wrongSolution=-1

n=6 k=4
6 3 4 1 5 2
acceptedSolution=5 wrongSolution=-1

n=6 k=4
6 3 4 2 1 5
acceptedSolution=6 wrongSolution=-1

n=6 k=4
6 3 4 5 2 1
acceptedSolution=5 wrongSolution=-1

n=6 k=4
6 3 5 1 2 4
acceptedSolution=7 wrongSolution=-1

n=6 k=4
6 3 5 2 4 1
acceptedSolution=11 wrongSolution=-1

n=6 k=4
6 3 5 4 1 2
acceptedSolution=7 wrongSolution=-1

n=6 k=4
6 4 1 2 3 5
acceptedSolution=7 wrongSolution=-1

n=6 k=4
6 4 1 3 5 2
acceptedSolution=10 wrongSolution=-1

n=6 k=4
6 4 1 5 2 3
acceptedSolution=7 wrongSolution=-1

n=6 k=4
6 4 2 1 5 3
acceptedSolution=8 wrongSolution=-1

n=6 k=4
6 4 2 3 1 5
acceptedSolution=8 wrongSolution=-1

n=6 k=4
6 4 2 5 3 1
acceptedSolution=11 wrongSolution=-1

n=6 k=4
6 4 3 1 2 5
acceptedSolution=6 wrongSolution=-1

n=6 k=4