# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
136683 | 2019-07-26T07:01:46 Z | Boxworld | Ancient Books (IOI17_books) | C++14 | 2 ms | 376 KB |
#include "books.h" #include <bits/stdc++.h> using namespace std; long long minimum_walk(std::vector<int> p, int s) { int n=p.size(); if (s==0){ if (n==1)return 0; if (n==2){ if (p[0]==0)return 0; else return 2; } if (n==3){ if (p[0]==0&&p[1]==1)return 0; if (p[0]==0&&p[1]==2)return 4; if (p[0]==1&&p[1]==0)return 2; if (p[0]==1&&p[1]==2)return 4; if (p[0]==2&&p[1]==0)return 4; if (p[0]==2&&p[1]==1)return 4; }else if (n==4){ if (p[0]==0&&p[1]==1&&p[2]==2)return 0; if (p[0]==0&&p[1]==1&&p[2]==3)return 6; if (p[0]==0&&p[1]==2&&p[2]==1)return 4; if (p[0]==0&&p[1]==2&&p[2]==3)return 6; if (p[0]==0&&p[1]==3&&p[2]==1)return 6; if (p[0]==0&&p[1]==3&&p[2]==2)return 6; if (p[0]==1&&p[1]==0&&p[2]==2)return 2; if (p[0]==1&&p[1]==0&&p[2]==3)return 6; if (p[0]==1&&p[1]==2&&p[2]==0)return 4; if (p[0]==1&&p[1]==2&&p[2]==3)return 6; if (p[0]==1&&p[1]==3&&p[2]==0)return 6; if (p[0]==1&&p[1]==3&&p[2]==2)return 6; if (p[0]==2&&p[1]==0&&p[2]==1)return 4; if (p[0]==2&&p[1]==0&&p[2]==3)return 6; if (p[0]==2&&p[1]==1&&p[2]==0)return 4; if (p[0]==2&&p[1]==1&&p[2]==3)return 6; if (p[0]==2&&p[1]==3&&p[2]==0)return 6; if (p[0]==2&&p[1]==3&&p[2]==1)return 8; if (p[0]==3&&p[1]==0&&p[2]==1)return 6; if (p[0]==3&&p[1]==0&&p[2]==2)return 6; if (p[0]==3&&p[1]==1&&p[2]==0)return 6; if (p[0]==3&&p[1]==1&&p[2]==2)return 6; if (p[0]==3&&p[1]==2&&p[2]==0)return 8; if (p[0]==3&&p[1]==2&&p[2]==1)return 8; } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 2 ms | 256 KB | Output is correct |
4 | Correct | 2 ms | 256 KB | Output is correct |
5 | Correct | 1 ms | 256 KB | Output is correct |
6 | Correct | 2 ms | 256 KB | Output is correct |
7 | Correct | 2 ms | 256 KB | Output is correct |
8 | Correct | 2 ms | 256 KB | Output is correct |
9 | Correct | 2 ms | 256 KB | Output is correct |
10 | Correct | 2 ms | 256 KB | Output is correct |
11 | Correct | 2 ms | 256 KB | Output is correct |
12 | Correct | 2 ms | 256 KB | Output is correct |
13 | Correct | 2 ms | 256 KB | Output is correct |
14 | Correct | 2 ms | 256 KB | Output is correct |
15 | Correct | 2 ms | 256 KB | Output is correct |
16 | Correct | 2 ms | 376 KB | Output is correct |
17 | Correct | 2 ms | 256 KB | Output is correct |
18 | Correct | 2 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 2 ms | 256 KB | Output is correct |
4 | Correct | 2 ms | 256 KB | Output is correct |
5 | Correct | 1 ms | 256 KB | Output is correct |
6 | Correct | 2 ms | 256 KB | Output is correct |
7 | Correct | 2 ms | 256 KB | Output is correct |
8 | Correct | 2 ms | 256 KB | Output is correct |
9 | Correct | 2 ms | 256 KB | Output is correct |
10 | Correct | 2 ms | 256 KB | Output is correct |
11 | Correct | 2 ms | 256 KB | Output is correct |
12 | Correct | 2 ms | 256 KB | Output is correct |
13 | Correct | 2 ms | 256 KB | Output is correct |
14 | Correct | 2 ms | 256 KB | Output is correct |
15 | Correct | 2 ms | 256 KB | Output is correct |
16 | Correct | 2 ms | 376 KB | Output is correct |
17 | Correct | 2 ms | 256 KB | Output is correct |
18 | Correct | 2 ms | 376 KB | Output is correct |
19 | Incorrect | 2 ms | 256 KB | 3rd lines differ - on the 1st token, expected: '338572', found: '0' |
20 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 2 ms | 256 KB | Output is correct |
4 | Correct | 2 ms | 256 KB | Output is correct |
5 | Correct | 1 ms | 256 KB | Output is correct |
6 | Correct | 2 ms | 256 KB | Output is correct |
7 | Correct | 2 ms | 256 KB | Output is correct |
8 | Correct | 2 ms | 256 KB | Output is correct |
9 | Correct | 2 ms | 256 KB | Output is correct |
10 | Correct | 2 ms | 256 KB | Output is correct |
11 | Correct | 2 ms | 256 KB | Output is correct |
12 | Correct | 2 ms | 256 KB | Output is correct |
13 | Correct | 2 ms | 256 KB | Output is correct |
14 | Correct | 2 ms | 256 KB | Output is correct |
15 | Correct | 2 ms | 256 KB | Output is correct |
16 | Correct | 2 ms | 376 KB | Output is correct |
17 | Correct | 2 ms | 256 KB | Output is correct |
18 | Correct | 2 ms | 376 KB | Output is correct |
19 | Incorrect | 2 ms | 256 KB | 3rd lines differ - on the 1st token, expected: '338572', found: '0' |
20 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | 3rd lines differ - on the 1st token, expected: '3304', found: '34687056' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 2 ms | 256 KB | Output is correct |
4 | Correct | 2 ms | 256 KB | Output is correct |
5 | Correct | 1 ms | 256 KB | Output is correct |
6 | Correct | 2 ms | 256 KB | Output is correct |
7 | Correct | 2 ms | 256 KB | Output is correct |
8 | Correct | 2 ms | 256 KB | Output is correct |
9 | Correct | 2 ms | 256 KB | Output is correct |
10 | Correct | 2 ms | 256 KB | Output is correct |
11 | Correct | 2 ms | 256 KB | Output is correct |
12 | Correct | 2 ms | 256 KB | Output is correct |
13 | Correct | 2 ms | 256 KB | Output is correct |
14 | Correct | 2 ms | 256 KB | Output is correct |
15 | Correct | 2 ms | 256 KB | Output is correct |
16 | Correct | 2 ms | 376 KB | Output is correct |
17 | Correct | 2 ms | 256 KB | Output is correct |
18 | Correct | 2 ms | 376 KB | Output is correct |
19 | Incorrect | 2 ms | 256 KB | 3rd lines differ - on the 1st token, expected: '338572', found: '0' |
20 | Halted | 0 ms | 0 KB | - |