https://school.programmers.co.kr/learn/courses/30/lessons/84512
프로그래머스
코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.
programmers.co.kr
#include<bits/stdc++.h>
using namespace std;
int solution(string word) {
int dp[6]={0,5};
for(int i=2;i<=5;++i){
dp[i]=5*(dp[i-1]+1);
}
string v="AEIOU";
int ans=word.size();
for(int i=0;i<word.size();++i){
int p=v.find(word[i]);
if(p)ans+=p*(1+dp[4-i]);
}
return ans;
}
'프로그래머스 문제풀이 > LEVEL 2' 카테고리의 다른 글
[C++] 프로그래머스 문제풀이 LEVEL 2 2 x n 타일링 (0) | 2023.07.05 |
---|---|
[C++] 프로그래머스 문제풀이 LEVEL 2 뒤에 있는 큰 수 찾기 (0) | 2023.07.05 |
[C++] 프로그래머스 문제풀이 LEVEL 2 스킬트리 (0) | 2023.07.05 |
[C++] 프로그래머스 문제풀이 LEVEL 2 방문 길이 (0) | 2023.07.05 |
[C++] 프로그래머스 문제풀이 LEVEL 2 게임 맵 최단거리 (0) | 2023.07.05 |