Make Unreal REAL.
article thumbnail
Level 0. 종이 자르기

 

 

#include <iostream>

using namespace std;

int solution(int M, int N)
{
    return M * N - 1;
}

 

(가로 - 1) + 가로 * (세로 - 1)

= (M - 1) + M * (N - 1)

= M * N - 1

'자료구조 & 알고리즘 > 프로그래머스' 카테고리의 다른 글

Level 0. 평행  (1) 2023.01.24
Level 0. 최빈값 구하기  (0) 2023.01.23
Level 0. 다음에 올 숫자  (0) 2023.01.22
Level 0. 연속된 수의 합  (0) 2023.01.21
Level 0. 캐릭터의 좌표  (0) 2023.01.19
profile

Make Unreal REAL.

@diesuki4

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!

검색 태그