목록문제/백준_자바 (102)
sm 기술 블로그
import java.util.*; import java.io.*; class Main{ public static void main(String[] args)throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ArrayList repo = new ArrayList(); String[] sBits = br.readLine().split(" "); int x = Integer.parseInt(sBits[0]); int y = Integer.parseInt(sBits[1]); int w = Integer.parseInt(sBits[2]); int h = Integer.parseInt(sBits..
import java.io.*; import java.util.*; class Main { public static void main(String[] args)throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); HashSet set = new HashSet(); String S = br.readLine(); for(int i = 0; i < S.length(); i++) { for(int j =i; j < S.length(); j++) { set.add(S.substring(i,j+1)); } } System.out.println(set.size()); } } 문제요약 문자열이 들어오면 ..
import java.util.*; import java.io.*; public class Main { public static void main(String[] args)throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); HashSet Aset = new HashSet(); HashSet Aset2 = new HashSet(); HashSet Bset = new HashSet(); br.readLine(); String[] AStr = br.readLine().split(" "); for(int i =0; i 집합자료형 집합에 다음과 같은 값이 있다고 해보자 HashSet s1 = ne..
import java.io.*; import java.util.*; class Main { public static void main(String args[])throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); Map cardMap = new HashMap(); ArrayList names = new ArrayList(); String[] NM = br.readLine().split(" "); int N = Integer.parseInt(NM[0]); int M = Integer.parseInt(NM[0]); int ..