목록Algorithm/Programmers (43)
Try
1234567891011121314def solution(prices): answer = [] length = len(prices) for i in range(0, length): count = 0 for j in range(i, length-1): if prices[i] >prices[j]: break else: count +=1 answer.append(count) return answercs 출처https://programmers.co.kr/learn/courses/30/lessons/42584?language=python3
출처https://programmers.co.kr/learn/courses/30/lessons/12901 소스 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162#include #include #include using namespace std; string solution(int a, int b) { string answer = ""; string day[] = {"THU","FRI","SAT","SUN","MON","TUE","WED"}; if(a==1) {} else if(a==2) { b = b+31; } else if(a==3) { b = b..
출처https://programmers.co.kr/learn/courses/30/lessons/42576 소스 123456789101112131415161718192021222324#include #include #include #include using namespace std; string solution(vector par, vector com) { string answer = ""; sort(par.begin(), par.end()); sort(com.begin(), com.end()); for(int i = 0; i
출처https://programmers.co.kr/learn/courses/30/lessons/12899 소스 1234567891011121314151617181920212223242526272829#include #include using namespace std; string solution(int n) { string arr[3] = {"4","1","2"}; string answer = ""; int index; while(n>0) { index = n % 3; if(index == 0) { n = n-1; } n = n / 3; answer = arr[index] + answer; } return answer;}Colored by Color Scriptercs
출처https://programmers.co.kr/learn/courses/30/lessons/42586 소스 #include #include #include #include using namespace std;vector solution(vector pro, vector spe) { vector answer; queue q; for(int i = 0; i
출처https://programmers.co.kr/learn/courses/30/lessons/42588 소스 1234567891011121314151617181920212223242526272829303132333435#include #include #include using namespace std; vector solution(vector heights) { vector answer; for(int i = heights.size()-1; i>=0; i--) { for(int j = i-1; j>=0; j--) { if(i == 0) { answer.push_back(0); break; } else if(heights[j] > heights[i] && i != j) { answer.push_back(..
출처https://programmers.co.kr/learn/courses/30/lessons/14406 소스 #include using namespace std;int arr[10000000] = {0};long long solution(int N) { long long answer = 0;int i = 2; for(i = 2; i
출처https://programmers.co.kr/learn/courses/30/lessons/42842 소스 12345678910111213141516171819202122232425262728293031323334353637383940/*/* /* khsh5592@naver.com/* has3ong.tistory.com/* /* 2018 - 11 - 12/**/#include #include #include using namespace std; void Carfet(int brown, int red){ for(int i = 0; i
출처 http://codingdojang.com/scode/612#answer-filter-area 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697/*/* /* khsh5592@naver.com/* has3ong.tistory.com/* /* 2018 - 11 - 12/**/#include #include #include using namespace std; //int Check_Data[5] = {12, 17, 19, 17..
출처 https://programmers.co.kr/learn/courses/30/lessons/43165 소스 /*/*/*khsh5592@naver.com/*has3ong.tistory.com/*/*2018 - 11 - 12/**/#include#include#include#include#includeint answer = 0;using namespace std;void solution(vector numbers, int target, int index){int sum;if(index