개발 관련 공부/알고리즘28 백준 11054 import java.util.Scanner; public class Main{ static public void main(String args[]){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); //가장 긴 증가하는 수열 int arr []=new int [n]; for(int i=0;i 2021. 7. 22. 백준 11053 import java.util.Scanner; public class Main{ static public void main(String args[]){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); //코드.... int arr []=new int [n]; for(int i=0;i 2021. 7. 21. 백준 11057 import java.util.Scanner; public class Main{ static public void main(String args[]){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long dp [][]=new long [n][10]; for(int i=0;i 2021. 7. 20. 백준 11726번 import java.util.Scanner; public class Main{ static public void main(String args[]){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); //f(1)=1, f(2)=2, f(n)=f(n-1)+f(n-2) (n>=2) int dp []=new int [n+1]; dp[0]=1; dp[1]=2; for(int i=2;i10007) dp[i]=dp[i]%10007; } //10007로 나눈 나머지 출력 System.out.println(dp[n-1]%10007); } } 2021. 7. 19. 이전 1 2 3 4 5 다음 반응형