1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | #include<cstdio> #include<cmath> #include<algorithm> using namespace std; int arr[11]; int main(void) { int n,ans=0; scanf("%d", &n); if(n==0) { printf("1"); exit(0); } while(n>0) { arr[n%10]++; n/=10; } int temp=arr[6]+arr[9]; if(temp%2==0) arr[6]=temp/2; else arr[6]=temp/2+1; for(int i=0; i<9; i++) ans=max(ans,arr[i]); printf("%d", ans); return 0; } | cs |
'백준 1 > 수학' 카테고리의 다른 글
| [백준 2018] 수들의 합 5 (0) | 2020.12.06 |
|---|---|
| [백준 1356] 유진수 (0) | 2020.12.06 |
| [백준 4673] 셀프 넘버 (0) | 2020.12.06 |
| [백준 2749] 피보나치 수 3 (0) | 2020.12.06 |
| [백준 2748] 피보나치 수 2 (0) | 2020.12.06 |