https://school.programmers.co.kr/learn/courses/30/lessons/120910
처음 세균의 수 n에 t번 만큼 2를 곱한다.
#include <string>
#include <vector>
using namespace std;
int solution(int n, int t) {
int answer = n;
for (int i = 0; i < t; i++)
answer *= 2;
return answer;
}
#include <string>
#include <vector>
using namespace std;
int solution(int n, int t) {
return n << t;
}
쉬프트연산을 사용하였다.