ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Разделы > Неотсортированные > задача:


Edges list to Adjacency matrix

Задачи раздела

• Subsets
• Maximum Sum 2
• Gifts of Santa Claus
• Rectangles on a plane
• Permutations
• Reverse permutation
• Nameplates
• Adjacency matrix to edges list
• Edges list to Adjacency matrix
• Cities and roads
• Cycle detection
• Diameter of graph
• Divisors count
• GCD of ones
• Prime numbers
• Set cover problem
• Shopping

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 1000/1000/1000/1000 мс. Лимит памяти 65000/65000/65000/65000 Кб.

Problem description

Given edges list of undirected graph. Print this graph in form of adjacency matrix.

Input

The first line of the input contains two integers N and M (1 ≤ N ≤ 100, 1 ≤ M < 10000) where N denotes the number of verticies in graph, M - number of edges. Each of the following M lines contains two integers - one edge of graph.

Output

Print the adjacency matrix of given graph.

Example

stdin stdout

3 3
1 2
2 3
1 3

0 1 1
1 0 1
1 1 0

Для отправки решений необходимо выполнить вход.

www.contester.ru