분류 전체보기

· PS/BOJ
BFS / DFS 문제라고 생각은 했는데, 단계별로 풀어보기의 트리 카테고리 첫 문제라 '직접 구현해보는 건가?'라고 생각해서 시간만 날려먹었다. #include #include #include std::vector graph[100001]; int answer[100001]; void bfs(){ std::queue trace; trace.push(1); bool visited[100001] = {false, }; visited[1] = true; while(!trace.empty()){ int cur = trace.front(); trace.pop(); for(int i : graph[cur]){ if(!visited[i]){ answer[i] = cur; visited[i] = true; trace..
'Computer Systems: A Programmer's Perspective 3rd (Randal E. Bryant)'를 주교재로 한 시스템 소프트웨어 강의 수업자료를 복습하며 정리한 것 C, assembly, machine code Architecture also ISA : instruction set architecture machine, assembly code를 쓰기 위해 이해해야 하는 프로세서 설계 부분 e.g.) instruction set specification, registers Machine code : byte-level programs that a processor executes Assembly code : machine code를 text로 표현한 것 Microarchite..
'Computer Systems: A Programmer's Perspective 3rd (Randal E. Bryant)'를 주교재로 한 시스템 소프트웨어 강의 수업자료를 복습하며 정리한 것 Fractional Binary Numbers e.g) 111.11 -> 2^2 + 2^1 + 2^0 + 2^(-1) + 2^(-2) IEEE Floating Point IEEE Standard 754 Uniform standart for floating point arithmetic Nice standard for rounding, overflow, underflow Hard to make fast in H/W Representation Numerical Form (-1)^s * M * 2^E Sign bit s..
· PS/BOJ
문제 DP문제인걸 알아차리는데 한 5분 좀 더 걸린거 같다. 과정 배열의 인덱스가 제곱수인 곳은 1로 채움 dp[i - 1] + 1이 dp[i]보다 작다면 dp[i]를 dp[i - 1] + 1로 갱신. 1부터 루트n까지 순회하며 i + j * j가 n + 1보다 작고, 해당 인덱스(i + j * j) 값이 dp[i] + 1보다 크다면 dp[i] + 1로 갱신 #include #include int dp[50001]; void sol(int n){ dp[1] = 1; dp[2] = 2; dp[3] = 3; for(int i = 1; i < n + 1; i++){ if(i < (int)std::sqrt(n) + 1){ if(i * i < n + 1){ dp[i * i] = 1; } } if(dp[i - 1]..
닉네임정하기쉽지않음
'분류 전체보기' 카테고리의 글 목록 (18 Page)