18792번 - N의 배수 (3)
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
static int N;
static int count;
static int[] arr;
static boolean[] visited;
public static void main(String[] args) throws NumberFormatException, IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
N = Integer.parseInt(br.readLine());
count = 2*N-1;
arr = new int[count];
visited = new boolean[count];
StringTokenizer token = new StringTokenizer(br.readLine());
for (int i=0; i
댓글을 작성하려면 로그인해야 합니다.
kose135 4년 전
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
static int N;
static int count;
static int[] arr;
static boolean[] visited;
public static void main(String[] args) throws NumberFormatException, IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
N = Integer.parseInt(br.readLine());
count = 2*N-1;
arr = new int[count];
visited = new boolean[count];
StringTokenizer token = new StringTokenizer(br.readLine());
for (int i=0; i