# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
24612 | 2017-06-10T18:14:44 Z | jiangzhi | Kangaroo (CEOI16_kangaroo) | C++11 | 0 ms | 1124 KB |
#include <cstdio> #include <algorithm> using namespace std; const int N = 2010; int vec[N]; int main(){ freopen("kangaroo.in","r",stdin); freopen("kangaroo.out","w",stdout); int n,s,e; scanf("%d%d%d", &n,&s,&e); for(int i = 0; i < n ;i++){ vec[i]=i+1; } int ans = 0; do{ if(s!=vec[0] || e != vec[n-1])continue; int ok = 1; for(int i = 0; i < n-2; i++){ if((vec[i] - vec[i+1] > 0) == (vec[i+1] - vec[i+2] >0))ok=0; } if(ok)ans++; }while(next_permutation(vec,vec+n)); printf("%d\n",ans); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 0 ms | 1124 KB | Execution killed because of forbidden syscall [unknown syscall - gap in table] (292) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 0 ms | 1124 KB | Execution killed because of forbidden syscall [unknown syscall - gap in table] (292) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 0 ms | 1124 KB | Execution killed because of forbidden syscall [unknown syscall - gap in table] (292) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 0 ms | 1124 KB | Execution killed because of forbidden syscall [unknown syscall - gap in table] (292) |
2 | Halted | 0 ms | 0 KB | - |