File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed
Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ #include < string>
2+ #include < vector>
3+
4+ using namespace std ;
5+
6+ // 그냥 BFS는 시간초과
7+ // DP를 사용하자!
8+ int solution99 (int n, vector<int > money) {
9+ int MOD = 1000000007 ;
10+ int answer = 0 ;
11+ vector<int > d (n + 1 , 0 );
12+ d[0 ] = 1 ;
13+
14+ for (int i = 0 ; i < money.size (); i++) {
15+ for (int j = money[i]; j <= n ; j++) {
16+ d[j] = d[j] + d[j - money[i]] % MOD;
17+ }
18+ }
19+
20+ return d[n];
21+ }
Original file line number Diff line number Diff line change 9797 <ClCompile Include =" Lv3\Lv3_4단고음.cpp" />
9898 <ClCompile Include =" Lv3\Lv3_가장긴펠린드롬.cpp" />
9999 <ClCompile Include =" Lv3\Lv3_가장먼노드.cpp" />
100+ <ClCompile Include =" Lv3\Lv3_거스름돈.cpp" />
100101 <ClCompile Include =" Lv3\Lv3_네트워크.cpp" />
101102 <ClCompile Include =" Lv3\Lv3_단속카메라.cpp" />
102103 <ClCompile Include =" Lv3\Lv3_단어변환.cpp" />
Original file line number Diff line number Diff line change 318318 <ClCompile Include =" Lv3\Lv3_가장긴펠린드롬.cpp" >
319319 <Filter >소스 파일</Filter >
320320 </ClCompile >
321+ <ClCompile Include =" Lv3\Lv3_거스름돈.cpp" >
322+ <Filter >소스 파일</Filter >
323+ </ClCompile >
321324 </ItemGroup >
322325</Project >
You can’t perform that action at this time.
0 commit comments