https://school.programmers.co.kr/learn/courses/30/lessons/120910
프로그램 제작자
코드 중심 개발자를 고용하십시오. 배치 기반 위치 매칭. 프로그래머의 개발자별 프로필에 가입하고 기술 호환성이 좋은 회사와 연결하십시오.
Programmer.co.kr
문제 상황
일부 박테리아는 한 시간 안에 두 배가 된다고 합니다. 첫 번째 세균의 수 N경과 시간 티가 매개변수로 지정된 경우 티풀이 함수를 완료하여 일정 시간이 지난 후 박테리아 수를 반환합니다.
문제를 해결하다
class Solution {
public int solution(int n, int t) {
int answer = n * (int)Math.pow(2,t);
return answer;
}
}
다른 솔루션
class Solution {
public int solution(int n, int t) {
int answer = 0;
answer = n << t;
return answer;
}
}
![[백준 2480번] 주사위 세개 [백준 2480번] 주사위 세개](https://if.dailygagu.kr/wp-content/plugins/contextual-related-posts/default.png)