Submission #23197

#TimeUsernameProblemLanguageResultExecution timeMemory
23197model_codeGeppetto (COCI15_geppetto)C++11
80 / 80
3 ms1172 KiB
#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; }

Compilation message (stderr)

geppetto.cpp: In function 'int main()':
geppetto.cpp:32:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d", &n, &m);
                        ^
geppetto.cpp:34:36: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     int x, y; scanf("%d%d", &x, &y);
                                    ^
#Verdict Execution timeMemoryGrader output
Fetching results...