문제 정답 풀이 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int N = Integer.parseInt(st.nextToken()); int M = I..
문제 정답 풀이 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int a1 = Integer.parseInt(st.nextToken()); int a0 =..
문제 정답 풀이 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); long n = Long.parseLong(br.readLine()); System.out.println((n*(n-1)*(n-2))/6); System.out.println(3); br.close(); } } 메모리 14156KB 시간 124ms for..
문제 정답 풀이 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); long n = Long.parseLong(br.readLine()); System.out.println(n*n*n); System.out.println(3); br.close(); } } 메모리 14168KB 시간 124ms 설명 생략..할게요..?!
문제 풀이 정답 풀이 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); long n = Long.parseLong(br.readLine()); System.out.println((n*(n-1))/2); System.out.println(2); br.close(); } } 메모리 14212KB 시간 120ms 첫 for문..
문제 정답 풀이 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); long n = Long.parseLong(br.readLine()); System.out.println(n*n); System.out.println(2); br.close(); } } 메모리 14120KB 시간 124ms 이중for이고 각 for문의 크..
문제 정답 풀이 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); System.out.println(n); System.out.println(1); br.close(); } } 메모리 14152KB 시간 120ms 첫째 줄에는 코드 1의 수행횟수를..
문제 정답 풀이 import java.io.IOException; public class Main { public static void main(String[] args) throws IOException { System.out.println(1); System.out.println(0); } } 메모리 14092KB 시간 124ms 문제 이해를 못해서 구글링으로 이해했어요..ㅋㅋㅋㅋㅋㅋㅋ 입력을 하지만 출력에 사용되는 값이 아니라 코드에 따로 작성해주지 않았습니다. 출력을 두 번 하게 되는데 첫째 줄에는 코드1의 수행 횟수를 출력해줘요. MenOfPassion 알고리즘을 보면 입력받은 배열의 크기를 나누기 2한 인덱스로 배열의 값을 리턴하는데 배열의 크기는 정해진 값이기 때문에 여러 번 할 일이 없죠...
문제 정답 풀이 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int a = Integer.parseInt(st.nextToken()); int b = I..
문제 정답 풀이 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st; while(true){ st = new StringTokenizer(br.readLine()); int n1 = Integer.parseInt(st.nextT..