Baekjoon 11399.ATM c++[Silver IV]

2024. 12. 22. 22:12·Baekjoon/Silver
728x90
반응형

단순 구현

#include <iostream>
#include <unordered_set>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    int N;
    cin >> N;
    vector<int> times;

    for (int i = 0; i < N; i++)
    {
        int t;
        cin >> t;
        times.push_back(t);
    }
    sort(times.begin(), times.end());

    int total = 0;
    int hap = 0;

    for (int t : times)
    {
        hap += t;
        total += hap;
    }
    cout << total;
    return 0;
}
728x90
반응형
저작자표시 (새창열림)

'Baekjoon > Silver' 카테고리의 다른 글

Baekjoon 1436.영화감독 슘 c++ [Silver V]  (0) 2024.12.28
Baekjoon 17219.비밀번호 찾기 c++ [Silver IV]  (1) 2024.12.23
Baekjoon 1764.듣보잡 c++[Silver IV]  (1) 2024.12.18
Baekjoon 11723.집합 c++ [Silver V]  (1) 2024.12.13
Baekjoon 1874.스택 수열 c++ [Silver II]  (1) 2024.12.09
'Baekjoon/Silver' 카테고리의 다른 글
  • Baekjoon 1436.영화감독 슘 c++ [Silver V]
  • Baekjoon 17219.비밀번호 찾기 c++ [Silver IV]
  • Baekjoon 1764.듣보잡 c++[Silver IV]
  • Baekjoon 11723.집합 c++ [Silver V]
Hun-bot
Hun-bot
IT를 중심으로 다양한 것
  • Hun-bot
    로봇이 만드는 눈사람
    Hun-bot
  • 전체
    오늘
    어제
    • All Article (128)
      • Programmers (6)
        • TIP (1)
        • SQL (2)
        • LV1 (1)
        • LV2 (2)
        • LV3 (0)
      • Baekjoon (31)
        • Bronze (10)
        • Silver (19)
        • Gold (2)
        • Platinum (0)
        • Diamond (0)
      • Leetcode (0)
        • Easy (0)
        • Medium (0)
        • Hard (0)
        • SQL (0)
      • 알고리즘(Algorithm) (42)
      • JavaScript (40)
      • Linux (7)
      • JSP (1)
  • 블로그 메뉴

    • 링크

    • 공지사항

    • 인기 글

    • 태그

      async await #js #문법 #자바스크립트 #비동기
      Programmers
      JS #클래스
      오블완
      파이썬 #입력 #python #input
      티스토리챌린지
      JS #프로그래머스 #숫자의표현 #알고리즘
      Algorithm
      자바스크립트
      알고리즘
      리눅스 #입문
      JSP #Vscode #톰켓 #Tomcat #Java #Web #jdk
      JS #JavaScript #프로그래머스 #카카오
      프로그래머스
      JavaScript #Set #Collection
      SQL
      알고리즘 #Algorithm
      JS #JavaScript #프로그래머스 #알고리즘
      JS #javascript #객체 #Object
      Vue #Vue.js #정리
      리눅스
      BaekJoon
      자바스크립트 #연습문제
      프로그래머스 #자바스크립트 #JS
      고득점 Kit
      Python #알고리즘
      c++
      Javascript
      LeetCode #JS #Javascript #Algorithm
      JS #정규표현식
    • 최근 댓글

    • hELLO· Designed By정상우.v4.10.3
    Hun-bot
    Baekjoon 11399.ATM c++[Silver IV]
    상단으로

    티스토리툴바

    티스토리툴바