알고리즘
-
[java] 백준 알고리즘 11721번 열 개씩 끊어 출력하기 풀이소스알고리즘/백준 알고리즘 2018. 5. 16. 13:22
* 풀이소스 1234567891011121314public class Baekjoon11721{ public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String inputString = br.readLine(); int stringLength = inputString.length(); for(int i=0; i
-
[java] 백준 알고리즘 11720번 숫자의 합 풀이소스알고리즘/백준 알고리즘 2018. 5. 16. 11:59
* 풀이소스 12345678910111213141516171819public class Baekjoon11720{ public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); String inputNumber = br.readLine(); if(inputNumber.length() == n) { // 입력한 길이까지 문자 길이 제한을 둠. int sum = 0; for(int i=0; i
-
[java] 백준 알고리즘 8393번 합 풀이소스알고리즘/백준 알고리즘 2018. 5. 16. 11:45
* 풀이소스 12345678910111213141516public class Baekjoon8393{ public static void main(String[] args) throws NumberFormatException, IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); long sum = 0; for(int i=1; i
-
[java] 백준 알고리즘 1924번 2007년 풀이소스알고리즘/백준 알고리즘 2018. 5. 16. 11:43
* 풀이소스 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354public class Baekjoon1924{ public static void main(String[] args){ Scanner scanner = new Scanner(System.in); int m; int d; int sum=0; m= scanner.nextInt(); d= scanner.nextInt(); int[] month = new int[13]; month[1]=month[3]=month[5]=month[7]=month[8]=month[10]=31; month[4]=month[6]=month[9]=m..
-
[java] 백준 알고리즘 2440번 별찍기 - 3 풀이소스알고리즘/백준 알고리즘 2018. 5. 16. 11:36
* 풀이소스 1234567891011121314151617181920public class Baekjoon2440{ public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); for(int i=n; i>=1; i--){ String star = ""; for(int j=1; j=j){ star += "*"; } } System.out.println(star); } } }Colored by Color Scriptercs
-
[java] 백준 알고리즘 2747번 피보나치 풀이알고리즘/백준 알고리즘 2018. 5. 12. 16:57
말그대로 피보나치 함수를 구현하는 것이다. 난 자바로 구현~ 보통 피보나치 함수는 재귀함수로 많이 구현하는 것 같아서 예전에 푼 문제를 거의 베끼듯 + 직접 구현해보자는 마음으로 풀어보았다. -- p.s 채점기준이 바뀐건지 시간 초과로 결과가 나와있어서 memoization으로 다시 코드를 수정했다. * 풀이소스 1234567891011121314151617181920212223242526272829public class Baekjoon2747 { static long[] fibonacciArray; public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new Buffered..
-
[java] 백준 알고리즘 8393번 합 풀이소스알고리즘/백준 알고리즘 2018. 5. 12. 16:40
단순 for문을 이용한 문제. * 풀이소스 12345678910111213141516public class Baekjoon8393 { public static void main(String[] args) throws NumberFormatException, IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); long sum = 0; for(int i=1; i