본문으로 바로가기

심화 정렬 알고리즘 문제 풀이

category onYouTube/Algorithm 2021. 4. 4. 06:37

handsukite.tistory.com/119?category=987470

 

[Sorting] 1181. 단어 정렬

#include #include using namespace std; string arr[20000]; int n; bool compare(string a, string b) { if(a.length() < b.length()) return 1; else if(a.length() > b.length()) return 0; else // 길이가 같..

handsukite.tistory.com

handsukite.tistory.com/120?category=987470

 

[Sorting] 1431. 시리얼 번호

#include #include using namespace std; string arr[1000]; int n; int getSum(string s) { int sum = 0; for(int i = 0; i < s.length(); i++) { if(0 <= s[i] - '0' && s[i] - '0' <= 9) // 숫자인 경우만 더하..

handsukite.tistory.com

handsukite.tistory.com/121?category=987470

 

[Sorting] 10989. 수 정렬하기

#include #include using namespace std; int arr[10000000]; int n; bool compare(int a, int b) { return a > b; } int main(void){ cin >> n; for(int i = 0; i < n; i++) cin >> arr[i]; sort(arr, arr+n, com..

handsukite.tistory.com

'onYouTube > Algorithm' 카테고리의 다른 글

계수 정렬(Counting Sort)  (0) 2021.04.04
힙 정렬(Heap Sort)  (0) 2021.04.03
C++ STL sort( ) 함수 다루기  (0) 2021.04.02
병합 정렬(Merge Sort)  (0) 2021.04.02
기초 정렬 알고리즘 문제 풀이  (0) 2021.04.02