개발 일지
-
백준 1547번 C++ 풀이백준 2018. 9. 6. 00:48
#include #include using namespace std; bool buffer[3]; void swap(int a, int b){ int temp = buffer[a]; buffer[a] = buffer[b]; buffer[b] = temp; } int main(int argc, const char * argv[]) { cin.tie(NULL); ios::sync_with_stdio(false); int n; buffer[0] = true; cin >> n; for (int i = 0; i > a >> b; swap(a-1, b-1); } for (int i = 0 ; i< 3; i++){ if(buffer[i]) cout
-
iOS 텍스트가 비었으면 확인 버튼 비활성하는 UIAlertController 생성iOS 2018. 9. 2. 09:32
텍스트가 비었으면 확인 버튼이 비활성화되는 텍스트뷰는 자주 사용되기에 UIAlertViewController을 상속해 생성하려고 했지만,해당 클래스가 상속을 지원하지 않기에, 익스텐션을 활용한 형태로 생성했습니다. extension UIViewController { func showInputDialog(title : String? = nil, message : String? = nil,placeholder : String? = nil , defaultText : String? = nil, confirm : ((String?)->Void)? = nil ) { //Creating UIAlertController and //Setting title and message for the alert dialog l..
-
백준 2448번 C++ 풀이백준 2018. 8. 29. 00:40
#include #include #include #include using namespace std; bool buffer[3100][6144]; void func(int x, int y, int length){ if (length == 3){ buffer[x][y] = true; buffer[x+1][y-1] = true; buffer[x+1][y+1] = true; buffer[x+2][y-2] = true; buffer[x+2][y-1] = true; buffer[x+2][y] = true; buffer[x+2][y+1] = true; buffer[x+2][y+2] = true; }else { func(x, y, length/2); func(x+length/2 , y+length/2, length/..
-
백준 1780번 C++ 풀이백준 2018. 8. 25. 09:53
#include #include #include using namespace std; struct Paper{ int minusOne; int zero; int plusOne; }; int buffer[2200][2200]; Paper cut(int startx, int starty, int length){ if (length == 1){ if (buffer[startx][starty]==1){ Paper paper; paper.minusOne = 0; paper.plusOne = 0; paper.zero = 1; return paper; }else if (buffer[startx][starty] == 0){ Paper paper; paper.minusOne = 1; paper.plusOne = 0; p..
-
백준 2156번 C++ 풀이백준 2018. 8. 24. 00:22
#include #include #include #include #include using namespace std; long wine[10001]; long didAteBefore[10001]; // i칸 , i-1칸 마심 long didAteBeforeBefore[10001]; //i칸, i-2칸 마심 long didAteBeforeBeforeBefore[10001]; //i칸, i-3칸 마심 int main() { cin.tie(NULL); ios::sync_with_stdio(false); int n; cin >> n; for (int i = 0; i> wine[i]; } didAteBefore[0] = wine[0]; didAteBeforeBefore[0] = wine[0]; didAteBefo..