#문제상황 현재 일정 정리 웹을 개발하면서나는 할 일에 주로 할일 속성을 부여하여따로 날짜에 상관없이 보여주는 작업 을 하고 있었다 때문에 엔티티 속성을 변경해야했다. public class TodoEntity { @Id @GeneratedValue(generator="system-uuid") // 자동으로 id 생성 @GenericGenerator(name="system-uuid", strategy="uuid") private String id; private String userId; private String title; private boolean done; private Date date; // 날짜 필드 추가 private boolean isMainTask; // 메인 할 일 여부} 이렇게..
https://www.acmicpc.net/problem/27498 #문제 해결 방법크루스칼 알고리즘을 사용하자 기존에 주어진 사랑 성사 관계는 바뀌면 안되기 때문에 Union 함수로 이어주고 MST 를 최대 스패닝 트리로 만들어서 연결되지 않고 남은 사랑 관계들을 최소 값으로 만든다. 키 포인트를 정리하자면1. 이미 연결된 사랑 관계는 스패닝트리에 미리 포함시킨다.2.최대 스패닝 트리로 만들어서 남은 관계들의 값이 최소가 된게 한다. 로 요약 가능하다 #전체 코드 #include #include #include #include using namespace std;const int MAX = 100001;int parent[MAX];int Find(int a) { if (parent[a] == ..
#크루스칼 #include #include #include using namespace std;const int MAX = 1001;const int INF = 1e9;int parent[MAX];int Find(int a) { if (parent[a] == a) return a; return parent[a] = Find(parent[a]); // 경로 압축 기법}void Union(int a, int b) { a = Find(a); b = Find(b); if (a != b) parent[b] = a; // 부모를 갱신하여 연결}int main() { ios_base::sync_with_stdio(0); cin.tie(0); int N, M; cin >..
#include #include #include using namespace std;vector tree;vector a;int N, Q;// 세그먼트 트리 구축void build() { for (int i = 0; i 0; --i) { tree[i] = tree[i 1) { where >>= 1; tree[where] = tree[where >= 1; right >>= 1; } return sum;}int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> N >> Q; a.resize(N); tree.resi..
#H2 데이터베이스 h2 데이터 베이스는 3가지 모드가 있는데상세한 내용이 궁금하면 https://www.h2database.com/html/cheatSheet.html H2 Database EngineUsing H2 Documentation Reference: SQL grammar, functions, data types, tools, API Features: fulltext search, encryption, read-only (zip/jar), CSV, auto-reconnect, triggers, user functions Embedded jdbc:h2:~/test 'test' in the user home directory jdbc:h2:/dawww.h2database.com공식 문서를 참조하도..
#비트연산 우선 비트연산에 대해서 알아보자 1. NOT 연산 (~)~ (부정): NOT 연산은 단항 연산으로, 각 비트를 반전시킵니다. 즉, 1을 0으로, 0을 1로 바꿉니다.예시:입력: A = 1010 (2진수)결과: ~A = 01012. AND 연산 (&)& (AND): AND 연산은 두 비트가 모두 1일 때만 1을 반환하고, 나머지 경우에는 0을 반환합니다.진리표:A B A & B000010100111예시:입력: A = 1100, B = 1010결과: A & B = 10003. OR 연산 (|)| (OR): OR 연산은 두 비..
https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV18TrIqIwUCFAZN&categoryId=AV18TrIqIwUCFAZN&categoryType=CODE&problemTitle=%EC%9E%91%EC%97%85&orderBy=FIRST_REG_DATETIME&selectCodeLang=ALL&select-1=&pageSize=10&pageIndex=1&&&&&&&&& SW Expert AcademySW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!swexpertacademy.com #문제 간단 정리위상정렬 #문제 해결 방법정석적인 위상정렬이기 때문에위상정렬 코드를 구현하도록 하..
https://www.acmicpc.net/problem/18352 #개요bfs 를 사용해서 거리를 기록한 뒤에같은 거리에 있는 도시들을 벡터에 넣어준 뒤에하나씩 출력하면 된다. #전체 코드#include #include #include #include #include using namespace std;int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int N, M, K, X; cin >> N >> M >> K >> X; vector> graph(N+1); for (int i = 0; i > u >> v; graph[u].push_back(v); } ..
https://www.acmicpc.net/problem/9694 #개요 다익스트라를 활용한 문제라는걸 쉽게 알아 볼 수 있는데 관건은 다익스트라로 알게된 최소비용 + 경로를 기억하는게 관건이다. 이 경로를 기억하는데서 좀 삽질을 했다. #첫번째 코드 - 다익스트라/dfs가지치기 #include #include #include #include #include using namespace std;vector>> nodes;vector dist;vector visited;vector path;vector resultSeq;int N, M;int intimacy;int minIntimacy;void dijkstra(int start) { priority_queue, vector>, greater..
https://www.acmicpc.net/problem/20056 #개요말 그대로 따라가면 정답을 얻을 수 있는 구현문제지만풀기 전에 설계를 정확하게 한 후에 최대한 실수를 적게 하도록 하자.특히 3차원 벡터를 사용하기때문에 실수하기 쉽기 때문에 체감난이도가 조금 더 높게 느껴 질 수 있다. #전체 코드#include #include #include #include #define MAX 52using namespace std;struct fireBall { int y; int x; int mass; int speed; int dir;};int N, M, K;vector mapVec[MAX][MAX];int dx[8] = { 0,1,1,1,0,-1,-1,-1 };int dy[..