11195
https://www.acmicpc.net/problem/11195
11195: Peragrams
Per recently learned about palindromes.
www.acmicpc.net
[정답]
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#include <iostream>
using namespace std;
int main(void){
int a[26] ={0,};
int cnt = 0;
int j=0;
string s;
cin >> s;
while (s[j]){
a[s[j]-'a'] += 1;
j++;
}
for (int i=0; i<26; i++){
if (a[i]%2) cnt++;
}
if (cnt > 1) cout << cnt-1;
else cout << 0;
return 0;
}
|
cs |
.
.
.
[풀이]
Palindrome과 유사한 Peragram 만들기이다.
Peragram을 만들기 위해 몇개의 문자를 제거해야하는지 구하면 된다.
p.s.
해석이 없어서 구글 번역 돌려 풀었다.
'백준 문제풀이' 카테고리의 다른 글
| [백준 : 18111] C++ : 마인크래프트 (0) | 2025.10.20 |
|---|---|
| [백준 : 2470] C++ : 두 용액 (1) | 2025.08.30 |
| [백준 : 10699] 파이썬 : 오늘 날짜 (0) | 2022.03.21 |
| [백준 2530] 파이썬 : 인공지능 시계 (0) | 2022.03.18 |
| [백준 1158] 파이썬 : 요세푸스 문제 (0) | 2022.03.16 |
