분류 전체보기
-
[git] warning: LF will be replaced by CRLF공부/etc 2021. 11. 6. 02:31
내가 git add를 한 환경은 Windows 10인데 위와 같은 warning이 떠서 검색을 해봤다. 윈도우에서는 줄바꿈 시 CRLF(\r\n) 방식을 쓰는 반면에 유닉스, 리눅스에서는 LF(\n) 방식을 써서 위와 같은 경고가 뜨는 것이라고 한다. 운영체제별로 줄바꿈 규칙이 다르기때문에 git에서 위와 같은 경고를 표시해준 것이다. 아래와 같은 명령어를 입력해서 줄바꿈 문자가 자동 변환되도록 설정해주면 된다. git config core.autocrlf true
-
[BOJ] 21608 상어 초등학교 / C++공부/PS (백준) 2021. 10. 8. 02:36
#include #include #include using namespace std; int N; struct st { int num; int friends[4]; }; struct st students[20 * 20 + 10]; int seats[20 + 10][20 + 10]; // (1, 1) ~ (N, N) int dx[4] = { -1,1,0,0 }; int dy[4] = { 0,0,-1,1 }; int cur_x, cur_y; struct cand { int x, y; int cnt_empty; int cnt_friends; }; vector candidates; bool cmp(cand &vec1, cand &vec2) { if (vec1.cnt_friends > vec2.cnt_friend..
-
[C++] struct형의 vector를 함수 인자로 넘기기공부/C, C++ 2021. 10. 8. 02:31
1. struct cand를 선언 2. cand형을 가지는 vector을 선언 (vector candidates;) 3. candidates를 정렬하기 위한 기준을 세워주는 compare 함수 정의 (bool cmp(vector &vec1, vector &vec2) 문제) cmp 함수에서 vec1의 멤버변수들이 참조가 되지 않음 해결) cmp 함수의 인자로 cand &vec1, cand &vec2를 넘겨주었더니 멤버변수들이 잘 참조되는 것을 확인함 구조체형 vector를 함수의 인자로 넘겨받고 싶을 때: 구조체 tag명 &vector 변수명
-
[HackerRank/Basic Select] Weather Observation Station 3공부/PS ( SQL) 2021. 9. 24. 01:29
https://www.hackerrank.com/challenges/weather-observation-station-3/problem Weather Observation Station 3 | HackerRank Query a list of unique CITY names with even ID numbers. www.hackerrank.com SELECT DISTINCT CITY FROM STATION WHERE ID MOD 2 = 0
-
[HackerRank/Basic Select] Weather Observation Station 1공부/PS ( SQL) 2021. 9. 24. 01:23
https://www.hackerrank.com/challenges/weather-observation-station-1/problem Weather Observation Station 1 | HackerRank Write a query to print the CITY and STATE for each attribute in the STATION table. www.hackerrank.com SELECT CITY, STATE FROM STATION
-
[HackerRank/Basic Select] Japanese Cities' Names공부/PS ( SQL) 2021. 9. 24. 01:19
https://www.hackerrank.com/challenges/japanese-cities-name/problem Japanese Cities' Names | HackerRank In this challenge, you will query a list of all the Japanese cities' names. www.hackerrank.com SELECT NAME FROM CITY WHERE COUNTRYCODE LIKE 'JPN'