-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSWEA_1249.java
More file actions
77 lines (77 loc) · 1.83 KB
/
SWEA_1249.java
File metadata and controls
77 lines (77 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//package swea_1249;
//
//import java.io.*;
//import java.util.*;
//
//class point{
// int x;
// int y;
// public point(int x, int y) {
// super();
// this.x = x;
// this.y = y;
// }
//
//}
//public class SWEA_1249 {
// static int N,ans;
// static boolean[][] visited;
// static int[][] map;
// static int[][] count;
// static int[] dx= {-1,1,0,0};
// static int[] dy= {0,0,-1,1};
//
// public static void main(String[] args) throws Exception {
// BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
// StringBuilder sb = new StringBuilder();
// int testCase = Integer.parseInt(br.readLine());
// for (int tc = 1; tc <= testCase; tc++) {
// N = Integer.parseInt(br.readLine());
//
// ans = Integer.MAX_VALUE;
// map = new int[N][N];
// count = new int[N][N];
// visited = new boolean[N][N];
//
// for (int i = 0; i < N; i++) {
// String temp = br.readLine();
// for (int j = 0; j < N; j++) {
// map[i][j] = temp.charAt(j)-'0';
// }
// }
// for (int i = 0; i < N; i++) {
// Arrays.fill(count[i], Integer.MAX_VALUE);
// }
// count[0][0]=0;
//
// bfs();
// sb.append("#"+tc+" "+ans+"\n");
// }
// System.out.println(sb);
// }
// private static void bfs() {
// Queue<point> q = new LinkedList<>();
// q.add(new point(0,0));
// visited[0][0] = true;
// while(!q.isEmpty()) {
// point cur = q.poll();
//
// if(cur.x ==N-1 && cur.y==N-1) {
// ans = ans > count[N-1][N-1]?count[N-1][N-1]:ans;
// }
//
// for (int k = 0; k < 4; k++) {
// int nx = cur.x + dx[k];
// int ny = cur.y + dy[k];
// if(nx<0||nx>=N||ny<0||ny>=N)continue;
// if(!visited[nx][ny] || count[nx][ny]> count[cur.x][cur.y]+map[nx][ny]) {
// visited[nx][ny] = true;
// count[nx][ny] = count[cur.x][cur.y]+map[nx][ny];
// q.offer(new point(nx, ny));
// }
// }
// }
// }
//
//
//}