📝 문제
🔑 풀이 과정
· 코드 수행횟수는 n^3이다. 그러므로 최고차항의 차수는 3
🔓 답안
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));
StringBuilder sb = new StringBuilder();
long n = Long.parseLong(br.readLine()); //입력의 크기
long count = n * n * n;
sb.append(count).append("\n");
sb.append(3).append("\n");
bw.write(sb.toString());
bw.flush();
bw.close();
}
}
🖤 알고리즘 분류
- 수학
- 구현
- 시뮬레이션
'PS > Baekjoon' 카테고리의 다른 글
[Baekjoon] 2845 - 파티가 끝나고 난 뒤 (0) | 2023.09.21 |
---|---|
[Baekjoon] 25372 - 성택이의 은밀한 비밀번호 (0) | 2023.09.20 |
[Baekjoon] 24265 - 알고리즘 수업 - 알고리즘의 수행 시간 4 (0) | 2023.09.18 |
[Baekjoon] 24264 - 알고리즘 수업 - 알고리즘의 수행 시간 3 (0) | 2023.09.17 |
[Baekjoon] 24263 - 알고리즘 수업 - 알고리즘의 수행 시간 2 (0) | 2023.09.16 |
댓글