Skip to content

Commit

Permalink
1475번 - 방 번호
Browse files Browse the repository at this point in the history
  • Loading branch information
MGPOCKY committed Jul 11, 2024
1 parent 1a96b70 commit 197eae2
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions 201902654/1475.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include <string>
#include <iostream>
#include <vector>

using namespace std;

int main(void) {
ios::sync_with_stdio(0);
cin.tie(0);

string N;
vector<int> arr(10, 0);
getline(cin, N);
for (char ch : N) {
++arr[ch - '0'];
}
arr[6] = (arr[6] + arr[9] + 1) / 2;
arr[9] = 0;
int max = 0;
for (int iter : arr) {
if (max < iter) {
max = iter;
}
}
cout << max;
}

0 comments on commit 197eae2

Please sign in to comment.