목록답 (102)
삐까냥의 파도타기
문제 출처 : https://www.acmicpc.net/problem/1152 현재 기준으로 정답률이 20.785%왜 그럴까 생각해봤는데, 앞, 뒤에 존재하는 띄어쓰기를 생각해야하고중복을 생각하여 코딩했는데, 중복은 신경 쓰지 않아야 하네요. import java.util.Scanner; public class Q1152 { public static void main(String[] args) {int result = 0;Scanner sc = new Scanner(System.in);String string = sc.nextLine();String[] temp = string.split(" ");for ( int i = 0 ; i < temp.length; i++ ) {if ( !temp[i].equ..
.문제 출처 : https://www.acmicpc.net/problem/14890 기출 문제라네요. import java.util.Scanner; public class Q14890 { static int num, L;static int[][] map;public static void main(String[] args) {Scanner sc = new Scanner(System.in);num = sc.nextInt();map = new int[num][num];L = sc.nextInt();for ( int i = 0 ; i < num; i++ ) {for ( int j = 0; j < num; j++ ) {map[i][j] = sc.nextInt();}}int result = 0;for ( int i..
문제 출처 : https://www.acmicpc.net/problem/14889 기출 문제 입니다. import java.util.ArrayList;import java.util.Collections;import java.util.Scanner; public class Main { static int[][] array;static int min = -1, num;public static void main(String[] args) {Scanner sc = new Scanner(System.in);num = sc.nextInt();array = new int[num][num]; for ( int i = 0; i < num; i++ ) {for ( int j = 0; j < num; j++ ) {array..
문제 출처 : https://www.acmicpc.net/problem/1507 import java.util.Scanner; public class Q1507 { public static void main(String[] args) {Scanner sc = new Scanner(System.in);int num = sc.nextInt();int[][] map = new int[num][num];int[][] newMap = new int[num][num];for ( int i = 0; i < num; i++ ) {for ( int j = 0; j < num; j++) {map[i][j] = newMap[i][j] = sc.nextInt();}} for ( int i = 0; i < num; i++ ) ..
문제 출처 : https://www.acmicpc.net/problem/5567 import java.util.HashSet;import java.util.Scanner; public class Q5567 { public static void main(String[] args) {Scanner sc = new Scanner(System.in);sc.nextInt();int num = sc.nextInt();int[][] relationShip = new int[num][2];HashSet friendList = new HashSet();for ( int i = 0 ; i < num; i++ ) {int temp1 = sc.nextInt();int temp2 = sc.nextInt();if ( temp1 ..
문제 출처 : https://www.acmicpc.net/problem/1068 import java.util.Scanner; public class Q1068 {static int[][] nodes;static Scanner sc;public static void main(String[] args) {sc = new Scanner(System.in);int number = sc.nextInt();nodes = new int[number][2];//0.부모노드 1.자식노드 개수for ( int i = 0; i < number; i++ ) {nodes[i][0] = sc.nextInt();}setNode(number);//자식노드 개수 세기removeNode(sc.nextInt());//노드 지우기Syst..
문제 출처 : https://www.acmicpc.net/problem/4963 import java.util.Scanner; public class Q4963 {static int[][] map;static int maxY, maxX;static Scanner sc;public static void main(String[] args) {sc = new Scanner(System.in);int x = 0;while ( (x = sc.nextInt()) != 0 ) {setMap(x);}}static void setMap(int x) {maxX = x;maxY = sc.nextInt();map = new int[maxY][maxX];for ( int i = 0; i < maxY; i++ ) {for ( i..
문제 출처 : https://www.acmicpc.net/problem/1700 import java.util.Scanner; public class Q1700 { static int[][] multiTab;static int[] jobList;public static void main(String[] args) {Scanner sc = new Scanner(System.in);int size = sc.nextInt();//구멍 개수int num = sc.nextInt(); multiTab = new int[size][2];jobList = new int[num];for ( int i = 0; i < num; i++ ) {jobList[i] = sc.nextInt();}int nowPoint = 0;in..
문제 출처 : https://www.acmicpc.net/problem/1049 import java.util.Scanner; public class Q1049 { static int eaNum;public static void main(String[] args) {Scanner sc = new Scanner(System.in);eaNum = sc.nextInt();int shopNum = sc.nextInt();int[] min = new int[2];min[0] = sc.nextInt();min[1] = sc.nextInt();for ( int i = 1; i < shopNum; i++ ) {int setPrice = sc.nextInt();min[0] = min[0] < setPrice ? min[..
문제 출처 : https://www.acmicpc.net/problem/2875 import java.util.Scanner; public class Q2875 {public static void main(String[] args) {Scanner sc = new Scanner(System.in);int[] member = new int[3];//0.여자, 1.남자, 2.인턴for ( int i = 0; i 1 && member[1] > 0 ) {member[0] -= 2;//여자 두명과 남자 한명을 팀으로 바꾼다.member[1] -= 1;team++;}member[2] -= member[0] + member[1];//나머지 인원들을 인턴으로 보낸다.if ( member[2] > 0 ) {//인턴 할당..