Notice
Recent Posts
Recent Comments
Link
«   2025/07   »
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 29 30 31
Archives
Today
Total
관리 메뉴

Baro's B

양꼬치 본문

알고리즘

양꼬치

Baro_forest 2023. 2. 9. 23:15

 

class Solution {
    public int solution(int n, int k) {
        int answer = 0;
        answer = 12000 * n  + k * 2000;
        if(10 <= n )
            answer -= n / 10 * 2000 ; 
        return answer;
    }
}

 

인분 / 을 10 으로 나눠진 정수 값을 만큼의 콜라 값에서 빼주기~

'알고리즘' 카테고리의 다른 글

[hackerrank, SQL]Weather Observation Station 7  (0) 2023.02.13
배열자르기  (0) 2023.02.09
특정 문자 제거하기  (0) 2023.02.09
[hackerrank, SQL]The Report  (0) 2023.02.08
[hackerrank, SQL]African Cities  (0) 2023.02.08