Guest User

Untitled

a guest
Jan 25th, 2020
87
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2. public class ccc5j3s1_1 {
  3. //https://dmoj.ca/problem/nccc5j5s3
  4. public static void main(String[] args) {
  5. Scanner sc = new Scanner(System.in);
  6. //2D boolean map array
  7. //LinkedList
  8. //step
  9.  
  10. int N = sc.nextInt(); //how many vertice
  11. int M = sc.nextInt();
  12. boolean[][] map = new boolean[N][N];
  13. int[][] edge = new int[M][2];
  14. for (int i=0; i<M; i++) {
  15. int bv = sc.nextInt()-1;
  16. int ev = sc.nextInt()-1;
  17. map[bv][ev] = true;
  18. edge[i][0] = bv;
  19. edge[i][1] = ev;
  20. }
  21. }
  22. }
RAW Paste Data