Role: Student: Name: Abhinav
Role: Student: Name: Abhinav
CHALLENGE INFORMATION
You have already solved this challenge ! Though you can run the code with different logic !
Kaaleppi has just robbed a bank and is now heading to the harbor. However, the police wants to stop him by closing some streets of the city.
What is the minimum number of streets that should be closed so that there is no route between the bank and the harbor?
Constraints
2≤n≤500
1≤m≤1000
1≤a,b≤n
Input
The first input line has two integers n and m: the number of crossings and streets. The crossings are numbered 1,2,…,n. The bank is located at
crossing 1, and the harbor is located at crossing n.
After this, there are m lines that describe the streets. Each line has two integers and b: there is a street between crossings a and b. All streets
are two-way streets, and there is at most one street between two crossings.
Output
First print an integer k: the minimum number of streets that should be closed. After this, print k lines describing the streets. You can print any
valid solution.
Test
Logical Test Cases
Cases
4 5 4 5
1 2 1 1
1 3 2 2
2 3 2 3
3 4 3 4
1 4 1 4
2 1
1 4 1 4
3 4
KEYWORD KEYWORD
1 735 93
Code
You have already solved this challenge ! Though you can run the code with different logic !
Editor
1 #include <stdio.h>
Type Here
2
3 #define N 500
4
5 #define M 1000
6 //abhinav Vats RA2311003030310 Output MATCH T1 MATCH T2
7
8 struct L {
9 struct L *next;
10 int h;
Empty
11 } aa[N];
12 int ij[M], cc[M * 4];
13 int dd[N];
14 void link(int i int h) {
14 void link(int i,int h) {
15 static struct L l91[M * 4], *l = l91; Complexity Analysis
16 l->h = h;
17 l->next = aa[i].next; aa[i].next = l++;
18 }
Test Case Status
19 int bfs(int n,int s,int t) {
20 static int qq[N];
21 int h, i, j, head, cnt, d;
22 for (i = 0; i < n; i++)
23 dd[i] = n;
24 dd[s] = 0;
25 head = cnt = 0;
26 qq[head + cnt++] = s;
27 while (cnt) {
28 struct L *l;
SAVE RESET RUN EVALUATE
For any inquiries, please contact your Faculty or Course Coordinator Student Manual DOWNLOAD