Submission #706724

#TimeUsernameProblemLanguageResultExecution timeMemory
706724Username4132Hiperkocka (COCI21_hiperkocka)C++14
0 / 110
0 ms212 KiB
#include<iostream> #include<vector> using namespace std; #define forn(i, n) for(int i=0; i<(int)n; ++i) #define PB push_back const int MAXN = 18; int n, cnt; vector<int> g[MAXN]; void dfs(int v, int p, int cur){ ++cnt; printf("%d ", cur); for(int to:g[v]){ if(to==p) continue; dfs(to, v, cur^(1<<cnt)); } } int main(){ scanf("%d", &n); forn(i, n){ int a, b; scanf("%d %d", &a, &b); g[a].PB(b), g[b].PB(a); } printf("%d\n", 1<<(n-1)); forn(i, 1<<n) if(!(i && (__builtin_popcount(i)&1))) cnt=-1, dfs(0, 0, i), printf("\n"); }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:21:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   21 |     scanf("%d", &n);
      |     ~~~~~^~~~~~~~~~
Main.cpp:23:24: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   23 |         int a, b; scanf("%d %d", &a, &b);
      |                   ~~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...