| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1354506 | uranhishig | 캥거루 (CEOI16_kangaroo) | C++20 | 2093 ms | 348 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int mod = 1e9 + 7;
signed main() {
int n, cs, cf;
cin >> n >> cs >> cf;
vector<int> a(n);
for (int i = 0; i < n; i++) {
a[i] = i + 1;
}
int cnt = 0;
do{
if(a[0] == cs and a[n - 1] == cf){
bool ok = true;
for (int i = 1; i < n-1; i++) {
int pre = a[i - 1];
int cur = a[i];
int nxt = a[i + 1];
if(pre < cur and nxt >= cur) {
ok = false;
break;
}
if(pre >= cur and nxt <= cur){
ok = false;
break;
}
}
if(ok) cnt++;
}
}while(next_permutation(a.begin(), a.end()));
cout << cnt;
return 0;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
