8000 Create 11047.cpp · rinrin528/basic-algo-lecture@99ad6b4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 99ad6b4

Browse files
Create 11047.cpp
1 parent 75cbbed commit 99ad6b4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

0x11/11047.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include <bits/stdc++.h>
2+
using namespace std;
3+
4+
int n, k;
5+
int a[15];
6+
7+
int main(void){
8+
ios::sync_with_stdio(0);
9+
cin.tie(0);
10+
int ans = 0;
11+
cin >> n >> k;
12+
for(int i = 0; i < n; i++) cin >> a[i];
13+
for(int i = n-1; i >= 0; i--){
14+
ans += k / a[i];
15+
k %= a[i];
16+
}
17+
cout << ans;
18+
}

0 commit comments

Comments
 (0)
0