Advertisement
Guest User

Untitled

a guest
Jan 25th, 2020
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement