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
- cs
- OS
- 컴퓨터공학과
- coding
- DP
- c++
- 정석학술정보관
- 오퍼레이팅시스템
- vector
- 코테
- 자료구조
- 문제풀이
- 컴공과
- 백준
- Stack
- 오에스
- 브루트포스
- 정석
- 구현
- Computer science
- 컴공
- 코딩
- Operating System
- 너비우선탐색
- 그래프
- 알고리즘
- 개발
- bfs
- 스택
- 북리뷰
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