Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 | 31 |
Tags
- 개발
- 오퍼레이팅시스템
- 정석
- 코테
- 북리뷰
- 컴공과
- Operating System
- 오에스
- 컴공
- OS
- vector
- 너비우선탐색
- 정석학술정보관
- 브루트포스
- 문제풀이
- 알고리즘
- 백준
- 컴퓨터공학과
- Computer science
- 구현
- 코딩
- 그래프
- c++
- 자료구조
- cs
- 스택
- coding
- DP
- bfs
- Stack
Archives
- Today
- Total
Little Jay
[C++] 백준 10818번 최소, 최대 본문
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
int testCase, num;
cin >> testCase;
vector<long long> numArr;
for (int i = 0; i < testCase; i++) {
cin >> num;
numArr.push_back(num);
}
int len = numArr.size();
sort(numArr.begin(), numArr.end());
cout << numArr[0] << " " << numArr[len - 1] << endl;
numArr.clear();
return 0;
}'알고리즘 > BOJ' 카테고리의 다른 글
| [C++] 백준 1259번 팰린드롬수 (0) | 2021.03.08 |
|---|---|
| [C++] 백준 10951번 A+B - 4 (0) | 2021.03.08 |
| [C++] 백준 8958번 OX퀴즈 (0) | 2021.03.08 |
| [C++] 백준 2657번 문자열 반복 (0) | 2021.03.07 |
| [C++] 백준 2476번 주사위 (0) | 2021.03.06 |
Comments