#include #include #include using namespace std; int solution(vector arr) { int gcd = *min_element(arr.begin(), arr.end()); int flag = 0; int j; for(; gcd >= 1 ; gcd--){ flag = 0; for(j = 0; j < arr.size(); j++){ if(arr[j] % gcd == 0) flag = 0; if(arr[j] % gcd != 0){ flag = 1; break; } } if(flag == 0) break; } int answer = gcd; for(j = 0; j < arr.size(); j++){ answer = answer * (arr[j]/gcd); } re..

#include #include using namespace std; // arr1(m * k 행렬) * arr2(k * n 행렬) = answer (m * n 행렬) vector solution(vector arr1, vector arr2) { vector answer; vector answer_temp; int m, n, k; int temp = 0; for(m = 0; m < arr1.size(); m++){ for(n = 0; n < arr2[0].size(); n++){ temp = 0; for( k = 0; k < arr2.size(); k++){ temp += arr1[m][k] * arr2[k][n]; } answer_temp.push_back(temp); } answer.push_back..
#include #include using namespace std; int fibo_arr[100001]; int fibo(int n){ if(n == 1 || n == 2) return 1; if(fibo_arr[n] != 0) return (fibo_arr[n]%1234567); else return fibo_arr[n] = (fibo(n-1) + fibo(n-2))%1234567; } int solution(int n) { int answer = 0; answer = fibo(n); return answer; } 옛날에 C만 할 줄 알던 시절에 풀었던 문제였다. 그 때는 1234567 저거 때문에 한 참 고생했던 기억이 났다. 하지만 이젠 난 메모이제이션까지 사용할 줄 아는 사람이 됐당.. 조금 ..
#include #include #include using namespace std; string solution(string s) { string answer = ""; vector str; string temp = ""; int i = 0; while(s[i] != '\0'){ if(s[i] == ' ') { str.push_back(stoi(temp)); temp = ""; } else temp = temp + s[i]; i += 1; } if(temp != "") str.push_back(stoi(temp)); answer = to_string(*min_element(str.begin(), str.end())) + " " + to_string(*max_element(str.begin(), str...
#include #include using namespace std; int solution(int n) { int answer = 0; int a = n; int b = 1; a -= 1; while(a>0){ b += 1; a = a-b; if(a%b == 0) answer += 1; } return answer+1; } 어디선가 풀어봤던 문제였다. 그것만 생각나고 풀이가 제대로 생각나지 않아서 다시 깃허브에서 확인했다. 이거는 정말 기가막힌 규칙이 있다. n 값이 15일 때, - 2개로 나누어 떨어지는 경우 ( 15 - (1+2) ) / 2 => 6 (6+1) + (6+2) == 15 -3개로 나누어 떨어지는 경우 ( 15 - (1+2+3) ) / 3 => 3 (3+1) + (3+2) + (3+3)..
#include #include using namespace std; vector value; map species_cnt; int maxx = 0; int answer = 0; void dfs(int index, int level){ if( level == value.size()/2){ answer = 0; for( auto j = species_cnt.begin(); j!=species_cnt.end(); j++){ if(j->second != 0 ) answer += 1; } maxx = maxx > answer ? maxx : answer; } else{ for(int i = index; i= n) answer = n; else answer = nums.size(); return answer; }
#include #include using namespace std; int solution(vector land) { int answer = 0; int pre_index = -1; int now_index = 0; int now_max = 0; for(int i = 0; i < land.size(); i++){ while(true){ now_max = *max_element(land[i].begin(), land[i].end()); now_index = find(land[i].begin(), land[i].end(), now_max) - land[i].begin(); if (now_index == pre_index){ land[i][now_index] = 0; } else break; } answer..
- Total
- Today
- Yesterday
- python 웹 배포
- iOS UITableView 출력안됨
- django 게시판
- 장고 태그달기
- iOS 검은 화면
- 실시간 데이터베이스
- django 로그인접근
- ModelForm Form 차이
- 웹 배포
- django 태그
- Firebase 데이터베이스 추천
- django tag
- Realtime Database
- 알파벳 카운팅
- django clean
- Django
- django 개발일지
- cleaned_data
- pythonanywhere배포방법
- UITableViewController Not Working
- django pythoneverywhere
- iOS 화면 안나옴
- 까만 화면
- iOS 데이터베이스
- CellForRowAt 호출안됨
- 장고 게시판
- pythonanywhere배포
- 데이터베이스 추천
- 테이블출력안됨
- CellForRowAt Not Called
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |