알고리즘/BOJ

백준 15236번 Dominos

꾸준함. 2021. 3. 21. 23:09

문제 링크입니다: www.acmicpc.net/problem/15236

 

15236번: Dominos

Dominoes are gaming pieces used in numerous tile games. Each domino piece contains two marks. Each mark consists of a number of spots (possibly zero). The number of spots depends on the set size. Each mark in a size N domino set can contain between 0 and N

www.acmicpc.net

설명은 아이패드로 작성한 굿노트로 대체하겠습니다.

 

#include <iostream>
using namespace std;
int main(void)
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int N;
cin >> N;
int result = N * (N + 1) * (N + 2) / 2;
cout << result << "\n";
return 0;
}
view raw .cpp hosted with ❤ by GitHub

 

개발환경:Visual Studio 2017

 

지적, 조언, 질문 환영입니다! 댓글 남겨주세요~

반응형

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

백준 15610번 Abbey Courtyard  (0) 2021.03.22
백준 15474번 鉛筆  (0) 2021.03.22
백준 15128번 Congruent Numbers  (0) 2021.03.21
백준 15080번 Every Second Counts  (0) 2021.03.19
백준 15059번 Hard choice  (0) 2021.03.19