All submissions for this problem are available.
This is the year 4242 and competitive programming has become a skill essential for survival. Our protoganist HarryPotter needs to access a MuggleBook today. MuggleBooks are made by DoubleUnicornTechnolgies and are very peculiar computers. They are identical to 21st century computers even in 43th century. No wonder they are called MuggleBooks. To access this particular MuggleBook, HarryPotter needs to solve the following competitive programming problem (remember how it's an essential skill in 4242).
" Asya has a fully connected undirected graph G with N nodes. The nodes are numbered from 1 to N. Each edge has an positive integer weight. Every time she picks a subset S of V(G) (the nodes of G), and the edges that connect them, she finds the sum of edges of the subgraph of G thus formed. She calls it the funk value, F(S) of the subset S of nodes picked.
Calculate the sum where the summation is over all subsets S of V(G).
Here is the floor operation and is the set cardinality operation. "
Help HarryPotter access the MuggleBook by solving the problem.
The first line contains a single positive integer N, the number of nodes in graph G.
Then follow N lines, with N positive integers each. The jth integer of ith line is Wi,j, the weight of edge between ith and jth node.
Print one integer, the answer to the problem.
- 1 <= N <= 23
- 1 <= Wi,j <= 106
- Wi,j = Wj,i
- Wi,i = 0
Input: 2 0 1 1 0 Output: 1
|Time Limit:||2 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, LISP sbcl, LISP clisp, SCM guile, ERL, TCL, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions