Skip to content

Instantly share code, notes, and snippets.

@jayden-lee
Created October 16, 2018 14:49
Show Gist options
  • Save jayden-lee/0186f79202c4c2957c85593e0409d6a1 to your computer and use it in GitHub Desktop.
Save jayden-lee/0186f79202c4c2957c85593e0409d6a1 to your computer and use it in GitHub Desktop.
백준알고리즘 2163번: 초콜릿 자르기
import java.util.Scanner;
/**
* 초콜릿 자르기 문제<br>
* 알고리즘 분류 : DP
*
* @author gglee
*/
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int N = scanner.nextInt();
int M = scanner.nextInt();
int size = N * M;
System.out.println(size - 1);
scanner.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment