Skip to content

Commit

Permalink
2024-12-21 ATM
Browse files Browse the repository at this point in the history
  • Loading branch information
kangrae-jo committed Dec 21, 2024
1 parent 41b1744 commit 8e5c5e2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
28 changes: 28 additions & 0 deletions kangrae-jo/Greedy/11-kangrae-jo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
int N;
cin >> N;

vector<int> ATM(N);
for (int i = 0; i < N; i++) {
cin >> ATM[i];
}

sort(ATM.begin(), ATM.end());

int result = 0;
for (int wait = 0; wait < N; wait++) {
for (int use = 0; use <= wait; use++) {
result += ATM[use];
}
}

cout << result;

return 0;
}
1 change: 1 addition & 0 deletions kangrae-jo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
| 7μ°¨μ‹œ | 2024.11.09 | DP | [1둜 λ§Œλ“€κΈ°](https://www.acmicpc.net/problem/1463)|[#12](https://github.com/AlgoLeadMe/AlgoLeadMe-12/pull/24|)
| 8μ°¨μ‹œ | 2024.11.12 | HEAP | [더 맡게](https://school.programmers.co.kr/learn/courses/30/lessons/42626)|[#27](https://github.com/AlgoLeadMe/AlgoLeadMe-12/pull/27|)
| 9μ°¨μ‹œ | 2024.11.23 | DP | [μ •μˆ˜ μ‚Όκ°ν˜•](https://school.programmers.co.kr/learn/courses/30/lessons/43105)|[#30](https://github.com/AlgoLeadMe/AlgoLeadMe-12/pull/30|)
| 11μ°¨μ‹œ | 2024.12.21 | Greedy | [ATM](https://www.acmicpc.net/problem/11399)|[#41](https://github.com/AlgoLeadMe/AlgoLeadMe-12/pull/41|)

---

0 comments on commit 8e5c5e2

Please sign in to comment.