개발 일지
-
백준 11047번 C++풀이카테고리 없음 2018. 10. 31. 08:28
#include #include #include #include using namespace std; int coin[11]; int main(){ cin.tie(NULL); ios::sync_with_stdio(false); int n, k; int answer =0; cin >> n >> k; for (auto i=0; i> coin[i]; } int iterator = n-1; while ( k != 0){ if (k >= coin[iterator]){ answer += k / coin[iterator]; k %= coin[iterator]; } iterator--; } cout
-
UIAlertViewController 에서 여러 줄의 인풋(UITextView) 을 받는 방법이 없을까?iOS 2018. 10. 12. 14:38
기본적으로 인풋을 받을 때는, UIAlertViewController에 UITextField 사용합니다. 그런데 개발 스펙에 따라 인풋에 엔터가 포함될 때가 있는데, 이럴 때는 문제가 발생합니다. 기본적으로 UITextField는 라인 하나일 때만 사용하고, UITextView는 글줄일 때 사용하는 인풋입니다. 그런데 UIAlertViewController 는 textField만 추가할 수 있고, textView를 추가하는 메소드가 없습니다. 따라서 해당 방식으로 구현하기 위해서는 어떤 방식이든 커스터마이제이션이 필요하죠. 해당 부분을 커스터마이징하는 코드는 다음과 같습니다.https://qiita.com/star__hoshi/items/ea4712aeb7bf503abac2 // textView を表示す..
-
백준 11725번 C++ 풀이백준 2018. 10. 9. 01:10
#include #include #include #define MAX 100001 using namespace std; vector adj[MAX]; bool isVisited[MAX] = {false}; int parent[MAX]; int n; int main() { cin.tie(NULL); ios::sync_with_stdio(false); cin >> n; for (auto i=1; i> a >> b; adj[a].push_back(b); adj[b].push_back(a); } queue q; q.push(1); while (!q.empty()){ int front = q.front(); q.pop(); isVisited[front] = true; int size = adj[front].siz..
-
백준 1300번 C++ 풀이백준 2018. 10. 7. 18:29
#include #include #define MAX 35002 using namespace std; queue q; //queue result; long long n; long long k; long long answer; void find(long long start, long long end) { if (start >= end) return; auto middle = (start + end) /2; auto cnt = 0; for (auto i=1; i= k){ answer = middle; find(start, middle); }else { find(middle+1, end); } } int main() { cin.tie(NULL); ios::sync_with_stdio(false); cin >>..