| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 377462 | marat0210 | Geppetto (COCI15_geppetto) | C++14 | 4 ms | 364 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
using namespace std;
const int MAXN = 21;
int n, m;
bool uzeo[MAXN];
vector <int> E[MAXN];
int calc (int x) {
  if (x == n) return 1;
  int ret = calc(x+1);
  bool ok = 1;
  for (auto v: E[x])
    if (uzeo[v]) ok = 0;
  if (ok){
    uzeo[x] = 1;
    ret += calc(x+1);
    uzeo[x] = 0;
  }
  return ret;
}
int main (void){
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; ++i) {
    int x, y; scanf("%d%d", &x, &y);
    --x; --y; 
    E[x].push_back(y);
    E[y].push_back(x);
  }
  printf("%d\n", calc(0));
  return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
