Submission #136678

#TimeUsernameProblemLanguageResultExecution timeMemory
136678BoxworldAncient Books (IOI17_books)C++14
0 / 100
2 ms380 KiB
#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 6; if (p[0]==3&&p[1]==0&&p[2]==1)return 8; 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 (stderr)

books.cpp: In function 'long long int minimum_walk(std::vector<int>, int)':
books.cpp:49:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...