페이지

2163번: 초콜릿 자르기

https://www.acmicpc.net/problem/2163


$O(1)$

n*m인 초콜릿을 자르는 횟수가 n*m-1임은 수학적 귀납법을 통해 쉽게 증명할 수 있다.


#include<cstdio>
int n, m;
int main() {
    scanf("%d %d", &n, &m);
    printf("%d", n*m - 1);
    return 0;
}

댓글 없음 :

댓글 쓰기