시작!(184)
-
백준 - 13458 시험 감독 ( in C )
그 ~ 나마 쉬운문제.... 수학문제다. https://www.acmicpc.net/problem/13458 13458번: 시험 감독 첫째 줄에 시험장의 개수 N(1 ≤ N ≤ 1,000,000)이 주어진다. 둘째 줄에는 각 시험장에 있는 응시자의 수 Ai (1 ≤ Ai ≤ 1,000,000)가 주어진다. 셋째 줄에는 B와 C가 주어진다. (1 ≤ B, C ≤ 1,000,000) www.acmicpc.net #include int main() { int A[1000000+50000]; int n, b, c; unsigned long long int sum = 0; n = b = c = 0; scanf("%d", &n); for(int i = 0; i < n; i++) scanf("%d", &A[i]); ..
2022.07.31 -
Adjacency list in C
https://www.geeksforgeeks.org/graph-and-its-representations/ Graph and its representations - GeeksforGeeks A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions. www.geeksforgeeks.org
2022.07.30 -
pyyaml version upgrade 시 Command !
pyyaml 버전이 낮아서 설치가 제대로 안되서 Error 가 났다. 요때는 어째야하나!? https://stackoverflow.com/questions/49911550/how-to-upgrade-disutils-package-pyyaml How to upgrade disutils package PyYAML? I was trying to install chatterbot which has a dependency on PyYAML=3.12. In my Ubuntu machine installed PyYAML version is 3.11. So I used the following command to upgrade PyYAML: sudo -H pip3 ins... stackoverflow.com --ign..
2022.07.26 -
Ubuntu update 시 에러 날 경우!
update 를 하려니 바로 이런 에러가 뜨면서 update 가 안되더라. ( 먼저는 net-tools를 깔려고 했는데 안되서 update 를 한것.) 요렇게 404 Not Found 가 뜨고, Err 가 발생한다. 이 문제는 , 현재 사용하고 있는 우분투 버전의 업뎃 지원이 끝나, 해당 버전의 패키지 저장소가 이전 버전 아카이브 페이지인 old-release.ubuntu.com으로 이동되어 받아올 수 없는 경우라고 한다 ! sudo sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list sudo apt-get update && sudo apt-get di..
2022.07.26 -
LeetCode - 509.Fibonacci Num & 1137. N-th Tribonacci Number
Fibonacci 와 Tribonacci 이다. 푸는 방법은 똑같지롱. Fibonacci int dp[100] = {0,}; int fib(int n){ if(n == 0) return 0; else if(n == 1) return 1; if(dp[n] > 0) return dp[n]; else { dp[n] = fib(n-1) + fib(n-2); } return dp[n]; } Tribonacci int dp[100] = {0,}; int tribonacci(int n) { if(n == 0) return 0; else if(n == 1|| n == 2) return 1; if(dp[n] > 0) return dp[n]; else { dp[n] = tribonacci(n-3) + tribonacci(..
2022.07.25 -
LeetCode - 240. Search a 2D Matrix II
Write an efficient algorithm that searches for a value target in an m x n integer matrix matrix. This matrix has the following properties: Integers in each row are sorted in ascending from left to right. Integers in each column are sorted in ascending from top to bottom. Example 1: Input: matrix = [[1,4,7,11,15],[2,5,8,12,19],[3,6,9,16,22],[10,13,14,17,24],[18,21,23,26,30]], target = 5 Output: t..
2022.07.24 -
Installation issue: "Failed building wheel for pycairo"
https://github.com/googlefonts/gftools/issues/121 Installation issue: "Failed building wheel for pycairo" · Issue #121 · googlefonts/gftools This seems to be related to @chrissimpkins issue #106 @thundernixon and I tried pip install --upgrade git+https://github.com/googlefonts/gftools and ended with up the following error. Failed buildi... github.com 감사합니다 hamid 님 ^^...
2022.07.21 -
About Graph & BFS,DFS
그래프가 제일 어렵구나........ ㅜㅜ 먼저 그래프란 무엇인가..? A graph is a data structure that consists of the following two components: 1. A finite set of verices also called as nodes. 2. A finite set of ordered pair of the form (u, v) called as edge. The pair is ordered because (u, v) is not the same as (v, u) in case of a directed graph(di-graph, -> oneway graph) . The pair of the form (u, v) indicates that there ..
2022.07.18 -
LeetCode - 733. Flood Fill
DFS.........문제다....... ㅠㅅㅠ; 재귀......다 ! 생각해보면 Ea--------sy한 문제.......? 이해는 요 아래 동영상 보고 이해했다. https://youtu.be/RwozX--B_Xs Question ) An image is represented by an m x n integer grid image where image[i][j] represents the pixel value of the image.You are also given three integers sr, sc, and color. You should perform a flood fill on the image starting from the pixel image[sr][sc]. To perform a fl..
2022.07.17 -
LeetCode - 19. Remove Nth Node From End of List
HA..... 이거 Two Pointer Category 라고..... ㅠㅠ 이 빠가사리야 (Po자책중wer) Given the head of a linked list, remove the nth node from the end of the list and return its head. Example 1: Input: head = [1,2,3,4,5], n = 2 Output: [1,2,3,5] Example 2: Input: head = [1], n = 1 Output: [] Example 3: Input: head = [1,2], n = 1 Output: [1] Constraints: The number of nodes in the list is sz. 1 next = H2->next->next; r..
2022.07.16