목록공부/알고리즘 (52)
hara
https://www.acmicpc.net/problem/1260 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.LinkedList; import java.util.Queue; import java.util.Stack; import java.util.StringTokenizer; public class a1260 { public static void main(String[] args) throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); Stri..
https://www.acmicpc.net/problem/2877 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); int num=Integer.parseInt(br.readLine()); int[] a=new int[num+1]; a[0]=4; if(num==2){ a[1]=7; ..
https://www.acmicpc.net/problem/2921 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class a2921 { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); int num=Integer.parseInt(br.readLine()); int sum=0; for(int i=0; i=i;j--){ sum+=(i+j); } } S..
https://www.acmicpc.net/problem/1932 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.StringTokenizer; public class a1932 { public static void main(String[] args) throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); int num=Integer.parseInt(br.readLine()); int arr[][] = n..
https://www.acmicpc.net/problem/2839 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class a2839 { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); int num=Integer.parseInt(br.readLine()); int[] a=new int[num+1]; a[0]=0; a[1]=-1; a[2]=-1; f..
https://www.acmicpc.net/problem/11726 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class a11726 { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); int num=Integer.parseInt(br.readLine()); int []a=new int[num]; a[0]=1; if(num>=2){ a[1]=2;..