Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class ccc5j3s1_1 {
- //https://dmoj.ca/problem/nccc5j5s3
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- //2D boolean map array
- //LinkedList
- //step
- int N = sc.nextInt(); //how many vertice
- int M = sc.nextInt();
- boolean[][] map = new boolean[N][N];
- int[][] edge = new int[M][2];
- for (int i=0; i<M; i++) {
- int bv = sc.nextInt()-1;
- int ev = sc.nextInt()-1;
- map[bv][ev] = true;
- edge[i][0] = bv;
- edge[i][1] = ev;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement