Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 컴퓨터공학과
- DP
- cs
- 브루트포스
- Stack
- 그래프
- Operating System
- OS
- 오에스
- bfs
- 문제풀이
- 백준
- vector
- 코테
- 정석학술정보관
- 스택
- c++
- 컴공과
- 정석
- 컴공
- Computer science
- 알고리즘
- 너비우선탐색
- 코딩
- coding
- 개발
- 구현
- 자료구조
- 북리뷰
- 오퍼레이팅시스템
Archives
- Today
- Total
Little Jay
[C++] 백준 1010 - 다리놓기 본문
간단한 파스칼 삼각형 구하는 문제
#include<iostream>
#include<algorithm>
using namespace std;
int bridges[31][31];
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
for (int i = 1; i <= 30; i++)
bridges[1][i] = i;
for (int i = 2; i <= 30; i++) {
for (int j = i; j <= 30; j++) {
for (int k = j - 1; k >= 1; k--) {
bridges[i][j] += bridges[i - 1][k];
}
}
}
int t;
cin >> t;
while (t--) {
int n, m; cin >> n >> m;
cout << bridges[n][m] << "\n";
}
return 0;
}
'알고리즘 > BOJ' 카테고리의 다른 글
[C++] 백준 1712번 - 손익분기점 (0) | 2021.09.25 |
---|---|
[C++] 백준 10808번 - 알파벳 개수 (0) | 2021.09.25 |
[C++] 백준 16768번 - Mooyo Mooyo (0) | 2021.09.20 |
[C++]백준 14502 - 연구소 (0) | 2021.09.19 |
[C++] 백준 15683번 - 감시 (0) | 2021.09.18 |
Comments