# |
제출 시각 |
아이디 |
문제 |
언어 |
결과 |
실행 시간 |
메모리 |
52836 |
2018-06-27T04:40:06 Z |
윤교준(#1384) |
캥거루 (CEOI16_kangaroo) |
C++11 |
|
2000 ms |
520 KB |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int P[10];
int Ans;
int N, CS, CF;
int main() {
cin >> N >> CS >> CF;
iota(P, P+N+1, 0);
do {
if(P[1] != CS || P[N] != CF) continue;
bool flag = false;
for(int i = 2; i < N; i++) {
if((P[i-1] < P[i]) != (P[i+1] < P[i])) {
flag = true;
break;
}
}
if(flag) continue;
Ans++;
} while(next_permutation(P+1, P+N+1));
cout << Ans << endl;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
248 KB |
Output is correct |
2 |
Correct |
2 ms |
356 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
248 KB |
Output is correct |
2 |
Correct |
2 ms |
356 KB |
Output is correct |
3 |
Execution timed out |
2056 ms |
520 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
248 KB |
Output is correct |
2 |
Correct |
2 ms |
356 KB |
Output is correct |
3 |
Execution timed out |
2056 ms |
520 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
248 KB |
Output is correct |
2 |
Correct |
2 ms |
356 KB |
Output is correct |
3 |
Execution timed out |
2056 ms |
520 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |