본문 바로가기

분류 전체보기

jdbc time zone Error 해결방법 String jdbc_url = "jdbc:mysql://127.0.0.1:3308/jspdb"; 위와같이 jdbc URL setting 할때, 명시적으로 언급해주는 방법이 있다. useUnicode=true&characterEncoding=utf8&verifyServerCertificate=false&useSSL=false&serverTimezone=UTC 를 아래와 같이 추가해준다. String jdbc_url = "jdbc:mysql://127.0.0.1:3308/jspdb?useUnicode=true&characterEncoding=utf8&verifyServerCertificate=false&useSSL=false&serverTimezone=UTC"; 혹은 server.xml를 아래와 같이 수정.. 더보기
[c++] 백준 - 치킨 배달 (15686번) https://www.acmicpc.net/problem/15686 15686번: 치킨 배달 크기가 N×N인 도시가 있다. 도시는 1×1크기의 칸으로 나누어져 있다. 도시의 각 칸은 빈 칸, 치킨집, 집 중 하나이다. 도시의 칸은 (r, c)와 같은 형태로 나타내고, r행 c열 또는 위에서부터 r번째 칸 www.acmicpc.net DFS의 응용문제로 보이고, vector와 구조체를 활용하면 간단하게 연산이 가능하다. #include #include #include using namespace std; int N, M; int map[51][51]; int minLength = 100000000; typedef struct { int x; int y; int len; }house; vector h; ty.. 더보기
2105. [모의 SW 역량테스트] 디저트 카페 https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5VwAr6APYDFAWu& SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com FIFO를 위한 Queue 의 응용 문제정도로 보인다. 입력에 대한 처리의 수월하게 해 줄 자료구조를 우선적으로 떠올려 보는 습관을 가져야겠다. #include #incluse using namespace std; int N, cnt=-1; int map[21][21]; int visit[21][21]; int dx[] = { 1,1,-1,-1 }; int dy[] = { 1,-1,-1,1 }; .. 더보기
1st_Lecture_Note 이진탐색 n개의 요소를 가진 배열이 있을때, 특정한 key 값을 탐색하는 여러가지 방법이 있다. 가장 간단한 방법은 선형탐색을 하는 것이다. - 이 방법의 시간 복잡도는 O(n) 이다. - 순차적으로 자료를 탐색하는 방법이다. 또 다른 방법으로는 이진 탐색이 있다. : 반복적으로 구간을 절반으로 나누며 탐색하는 방법 - 전체 배열의 절반을 기준으로 탐색을 시작한다. - 만약, key 값이 전체 구간의 중간 값보다 작은 경우, 탐색해야 하는 구간은 중간 값 이하의 구간으로 감소한다. - 그렇지 않다면 탐색 구간은 중간 값 이상의 구간이 된다. - 탐색 구간이 비게 될 경우까지 반복적으로 탐색한다. - 이진 탐색은 Divide and Conquer Algorithm 이다. Binary search 는 inf.. 더보기
<코드업> 4713 : 공주님의 정원 #include using namespace std; int main() { int n; cin >> n; int **F = new int*[n]; int curr[4]; // start_month, day / end_month, day curr[0] = 3; curr[1] = 1; curr[2] = 11; curr[3] = 30; int tmp[2]; tmp[0] = 0; tmp[1] = 0; for (int i = 0; i > F[i][0] >> F[i][1] >> F[i][2] >> F[i][3]; } int cnt = 0; int flag = 0; while (1) { flag = 0; for (int i = 0; i < n; i++.. 더보기
<코드업> 4684 : 자물쇠 #include using namespace std; int main() { int N; int out_sh1, out_sh2; cin >> N; int* ary = new int[N]; while (1) { for (int i = 0; i > ary[i]; int reverse_cnt = 0; // -1 count for (int i = 0; i < N; i++) { if ((ary[(i + 1) % N] - ary[i] + N) % N == 1) reverse_cnt++; } reverse_cnt = N - reverse_cnt - 1; int reverse_flag = 0; int reverse_end, reverse_start; if (reverse_cnt == -1) .. 더보기
<코드업> 4040 : 펜션 #include #include #include using namespace std; int main() { int n, m; string a; cin >> n >> m; int **schedule = new int*[n]; for (int i = 0; i > a; for (int j = 0; j > s >> t; s--; t -= 2 ; int *cnt_ary = new int[m]; int a1 = s; /// 탐색 시작구간 임시로 a1로 잡음.. 더보기
<코드업> 3321 : 최고의 피자 #include #include using namespace std; int main() { int n,A,B,C; int Total[2]; cin >> n; cin >> A >> B; cin >> C; Total[0] = C;// t_kcal Total[1] = A + B * n;// t_price int *to = new int[n]; for (int i = 0; i > to[i]; Total[0] += to[i]; } sort(to, to + n); int i = 0; while (i (to[i] / B)) { Total[0] -= to[i]; Total[1] -= B; i++; } else break; } cout 더보기