oj mrJudge
Toggle navigation
  • Login
    • Forget Password
      Login
User Image

Hello, Stranger

Guest
  • Analysis Mode
  • Problems
    • All Problems
    • Latest Problems
  • Join Us Now
  • Registration
  • Contact Us
  • Infomation
  • About
    • Terms of Use
    • Technical Specifications
    • Credits

adjmatrix Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

adjmatrix.html

Input a list of connected nodes, and output its adjacency matrix.

Input

2 Integers, n and e. n represents the amount of nodes and e represents the amount of edges. You may assume n is less than 50.

The following e lines will have 2 integers each, ea and eb. It means ea is connected to eb (bi-directional)

Output

Output the adjacency matrix, with '1' meaning connected and '0' meaning its not connected.

Sample Input

5 8
1 2
1 3
1 4
1 5
2 4
3 5
5 4
3 4

Sample Output

01111
10010
10011
11101
10110

Tags

Graph Theory

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
1100101s32MBAverage
2011s32MBAverage

Judge Compile Command

g++-8 ans.cpp -o adjmatrix -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512

Accepted Submissions

subIDUserTimeMax Time

Past Submissions

subIDUserTimeScore
mrJudge 09.05.20
Copyright © 2020 mrJudge. All rights reserved.