#include "books.h"
#include<bits/stdc++.h>
using namespace std;
int n = 0;
vector<int> p;
bool caso(int a, int b, int c, int d){
return p[0] == a && p[1] == b && p[2] == c && p[3] == d;
}
long long minimum_walk(vector<int> _p, int s) {
p = _p;
n = p.size();
if(caso(0, 1, 2, 3)) return 0;
if(caso(0, 1, 3, 2)) return 6;
if(caso(0, 2, 1, 3)) return 4;
if(caso(0, 2, 3, 1)) return 6;
if(caso(0, 3, 1, 2)) return 6;
if(caso(0, 3, 2, 1)) return 6;
if(caso(1, 0, 2, 3)) return 2;
if(caso(1, 0, 3, 2)) return 6;
if(caso(1, 2, 0, 3)) return 4;
if(caso(1, 2, 3, 0)) return 6;
if(caso(1, 3, 0, 2)) return 6;
if(caso(1, 3, 2, 0)) return 6;
if(caso(2, 0, 1, 3)) return 4;
if(caso(2, 0, 3, 1)) return 6;
if(caso(2, 1, 0, 3)) return 4;
if(caso(2, 1, 3, 0)) return 6;
if(caso(2, 3, 0, 1)) return 8;
if(caso(2, 3, 1, 0)) return 8;
if(caso(3, 0, 1, 2)) return 6;
if(caso(3, 0, 2, 1)) return 6;
if(caso(3, 1, 0, 2)) return 6;
if(caso(3, 1, 2, 0)) return 6;
if(caso(3, 2, 0, 1)) return 8;
if(caso(3, 2, 1, 0)) return 8;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Incorrect |
1 ms |
204 KB |
3rd lines differ - on the 1st token, expected: '4', found: '0' |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Incorrect |
1 ms |
204 KB |
3rd lines differ - on the 1st token, expected: '4', found: '0' |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Incorrect |
1 ms |
204 KB |
3rd lines differ - on the 1st token, expected: '4', found: '0' |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
3rd lines differ - on the 1st token, expected: '3304', found: '0' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Incorrect |
1 ms |
204 KB |
3rd lines differ - on the 1st token, expected: '4', found: '0' |
5 |
Halted |
0 ms |
0 KB |
- |