| //https://www.acmicpc.net/problem/1316 #include <iostream> |
| #include <string> |
| using namespace std; |
| int main() |
| { |
| int N; |
| cin >> N; |
| int cnt=0; |
| for(int i=0; i<N; i++) |
| { |
| string word; |
| cin >> word; |
| bool alphbet[26]={0}; |
| bool chk=0; |
| int l=word.size(); |
| for(int j=0; j<l; j++) |
| { |
| if(j>0 && word[j]!=word[j-1] && alphbet[word[j]-'a']) chk=1; |
| alphbet[word[j]-'a']=1; |
| } |
| if(!chk) cnt++; |
| } |
| cout << cnt; |
| } |
'알고리즘 문제 풀이 > 1DP_과제(~180615)' 카테고리의 다른 글
| 171204_5622_다이얼 (0) | 2017.12.04 |
|---|---|
| 171202_2775_부녀회장이 될테야 (0) | 2017.12.02 |
| 171130_2864_5와 6의 차이 (0) | 2017.11.30 |
| 171129_1226_미로1 (0) | 2017.11.29 |
| 171128_1495_기타리스트 (0) | 2017.11.28 |