모르겠는디요 ;; 못품
package algo;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.LinkedList;
import java.util.StringTokenizer;
public class BJ11403 {
public static void main(String[] args) throws NumberFormatException, IOException {
BufferedReader br = new BufferedReader(new InputStreamReader (System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter (System.out));
LinkedList m = new LinkedList();
int N = Integer.parseInt(br.readLine());
int g [][] = new int [N][N];
int r [][] = new int [N][N];
for(int i=0; i
StringTokenizer st = new StringTokenizer(br.readLine());
for(int j=0; j<N; j++) {
g[i][j] = Integer.parseInt(st.nextToken());
}
}
for(int i=0; i for(int j=0; j<N; j++) {
if(g[i][j] == 1) {
m.add(i);
m.add(j);
}
}
}
for(int i=0; i for(int j=1; j<=N; j++) {
r[m.get(i)][m.get(j)] = 1;
System.out.print(r[i][j-1]);
}
System.out.println();
}
}
}
'백준알고리즘' 카테고리의 다른 글
백준 2096 내려가기 [DP][슬라이딩 윈도우] (0) | 2020.04.19 |
---|---|
백준 2003 수들의 합 2 [투 포인터] (0) | 2020.04.18 |
백준 2577 배열 숫자의 갯수 (0) | 2020.03.19 |
백준 10818 배열 최소, 최대 (0) | 2020.03.18 |
백준10951 EOF (0) | 2020.03.18 |
댓글