목록ATM (1)
GitHubSeob

문제 https://www.acmicpc.net/problem/11399 11399번: ATM 첫째 줄에 사람의 수 N(1 ≤ N ≤ 1,000)이 주어진다. 둘째 줄에는 각 사람이 돈을 인출하는데 걸리는 시간 Pi가 주어진다. (1 ≤ Pi ≤ 1,000) www.acmicpc.net 문제풀이 돈을 뽑는 시간 + 누적 시간을 계속해서 더하면 된다. 시간이 적게 걸리는 순으로 정렬을 한 뒤 시간을 누적시키기만 하면 된다. 코드 #include #include #include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); int N = 0; int idx = 0; int acc = 0; int answer = 0;..
Baekjoon/Silver
2021. 9. 5.