하다보니
1475번-방 번호 본문
#include<bits/stdc++.h>
using namespace std;
int num[10];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
string s;
cin >> s;
for (auto c : s) {
num[c - '0']++;
}
int sum = num[6] + num[9];
num[6] = sum / 2 + sum % 2;
num[9] = 0;
int max = num[0];
for (int i = 1; i < 9; i++) {
if (max < num[i]) {
max = num[i];
}
}
cout << max;
}
'알고리즘 풀이 > 백준' 카테고리의 다른 글
1406번-에디터 (0) | 2022.01.17 |
---|---|
3273번-두 수의 합 (0) | 2022.01.13 |
2577번-숫자의 개수 (0) | 2022.01.13 |
10808번-알파벳 개수 (0) | 2022.01.13 |
10804번-카드 역배치 (0) | 2022.01.13 |