// Copyright © 2021 ์์ฃผํ. All rights reserved.
// https://github.com/dkswnkk
// https://www.acmicpc.net/problem/1010
// BOJ1010 ๋ค๋ฆฌ ๋๊ธฐ
#include <iostream>
using namespace std;
int arr[31][31];
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
int T; cin>>T;
while(T--){
int N,M; cin>>N>>M;
for(int i=0; i<=M; i++){
for(int k=0; k<=N; k++){
if(i==k||k==0) arr[i][k]=1;
else{
arr[i][k]=arr[i-1][k-1]+arr[i-1][k];
}
}
}
cout<<arr[M][N]<<'\n';
}
}
'Algorithm ๐ง๐ปโ๐ป > ๋ฐฑ์ค(BOJ)' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค,c++] 10159๋ฒ - ์ ์ธ (0) | 2021.10.16 |
---|---|
[๋ฐฑ์ค,c++] 1015๋ฒ - ์์ด ์ ๋ ฌ (0) | 2021.10.16 |
[๋ฐฑ์ค,c++] 1012๋ฒ - ์ ๊ธฐ๋ ๋ฐฐ์ถ (0) | 2021.10.16 |
[๋ฐฑ์ค,c++] 1009๋ฒ - ๋ถ์ฐ์ฒ๋ฆฌ (0) | 2021.10.16 |
[๋ฐฑ์ค,c++] 1005๋ฒ - ACM Craft (0) | 2021.10.16 |
[๋ฐฑ์ค,c++] 1003๋ฒ - ํผ๋ณด๋์น ํจ์ (0) | 2021.10.16 |
๋๊ธ