https://www.acmicpc.net/problem/24266정답import java.io.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); long n = Long.parseLong(br.readLine()); br.close(); bw.write(n*n*n + "\n" ..
JAVA/백준
https://www.acmicpc.net/problem/24264정답import java.io.IOException;import java.io.BufferedReader;import java.io.InputStreamReader;public class Main{ public static void main(String[] args) throws IOException{ BufferedReader br= new BufferedReader(new InputStreamReader(System.in)); //n*n 했을 때 int로는 overflow가 발생할 수 있다.(n은 최대 500,000 될 수 있다) long n = Long.parseLong(br...
https://www.acmicpc.net/problem/24263정답import java.io.IOException;import java.io.BufferedReader;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.pri..
https://www.acmicpc.net/problem/24262정답public class Main{ public static void main(String[] args){ System.out.println('1'); System.out.println('0'); }}풀이콘솔로 부터 입력 크기 n을 입력받아 해당 위의 알고리즘의 수행횟수와 알고리즘 수행 시간을 예제로 출력하면 된다.MenOfPassion(A[], n) { i = ⌊n / 2⌋; return A[i]; # 코드1}위의 코드에는 반복시키는 문장이 없으므로 한 번 수행하고 나면 바로 return 된다. 그러므로 빅오 표기법 중 O(1)에 해당된다고 볼수 있다.
https://www.acmicpc.net/problem/10798정답풀이import java.io.IOException;import java.io.BufferedReader;import java.io.InputStreamReader;public class Main{ public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb= new StringBuilder(); String[][] arr =new String[5][15]; fo..
https://www.acmicpc.net/problem/2566정답import java.io.IOException;import java.io.BufferedReader;import java.io.InputStreamReader;import java.lang.StringBuilder;public class Main{ public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); int[][] res= new int[9..
https://www.acmicpc.net/problem/2738정답import java.io.IOException;import java.io.BufferedReader;import java.io.InputStreamReader;import java.io.BufferedWriter;import java.io.OutputStreamWriter;public class Main{ public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWrite..
https://www.acmicpc.net/problem/10988정답import java.io.IOException;import java.io.BufferedReader;import java.io.InputStreamReader;public class Main{ public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String str = br.readLine(); StringBuilder sb = new StringBuilder(str); String revStr =..
https://www.acmicpc.net/problem/11718정답import java.io.IOException;import java.io.BufferedReader;import java.io.InputStreamReader;public class Main{ public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); String str; while((str = br.readLine()) != nul..
https://www.acmicpc.net/problem/2908정답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(), " "); ..