목록전체 글 (294)
Muscardinus
https://www.acmicpc.net/problem/3190 3190번: 뱀 문제 'Dummy' 라는 도스게임이 있다. 이 게임에는 뱀이 나와서 기어다니는데, 사과를 먹으면 뱀 길이가 늘어난다. 뱀이 이리저리 기어다니다가 벽 또는 자기자신의 몸과 부딪히면 게임이 끝난다. www.acmicpc.net #include using namespace std; int map[101][101]; int snake_y[10101], snake_x[10101]; char cmd[10001]; int head_x, head_y,tail_index; int dx[] = { 1,0,-1,0 }; int dy[] = { 0,1,0,-1 }; int main() { ios_base::sync_with_stdio(false..
filter: grayscale(1); img에 흑백 넣기 filter: none; / filter: grayscale(0); 돌아오기 자기만의 속성주기 data-xxx 이것과 다른 element의 id와 연결 $('#'+$(this).attr('data-alt')).addClass('active'); 자신것 active class 넣고 나머지 빼기(siblings) $(this).addClass('active'); $(this).siblings().removeClass('active'); input 겉에 테두리 focus 없애기 outline: none; 해당 element 값 받기 var num = $('#id').val(); jQuery prev()/prevAll()/next()/nextAll() ..
https://programmers.co.kr/learn/courses/30/lessons/43162 코딩테스트 연습 - 네트워크 네트워크란 컴퓨터 상호 간에 정보를 교환할 수 있도록 연결된 형태를 의미합니다. 예를 들어, 컴퓨터 A와 컴퓨터 B가 직접적으로 연결되어있고, 컴퓨터 B와 컴퓨터 C가 직접적으로 연결되어 있�� programmers.co.kr Union and Find 사용 #include #include #include using namespace std; int g[201]={0}; int check[201]={0}; int find(int x) { if(g[x]==x) return x; else return g[x]=find(g[x]); } void Union(int x, int y) ..
https://www.acmicpc.net/problem/12100 #include using namespace std; int n; int answer = 0; struct BOARD { int map[20][20]; void rotate() { //90도 회전 int temp[20][20] = { 0 }; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { temp[j][n-i-1] = map[i][j]; } } for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { map[i][j] = temp[i][j]; } } } void up() { //위로 올리기 int temp[20][20]; for..
margin 0으로 하는 방법 font-size: 0 가능 position을 absolute, fixed 같은 것으로 바뀌면 붕떠서 부모의 height 사라짐 이를 보완해야함 label에 css 줄려면 부모가 선택되어 있어야함 linear-gradient(방향,처음,나중) position relative 2개가 있으면 나중께 위로 올라옴 background-attachment: fixed 배경이 고정된 느낌 주기
https://programmers.co.kr/learn/courses/30/lessons/42884 코딩테스트 연습 - 단속카메라 [[-20,15], [-14,-5], [-18,-13], [-5,-3]] 2 programmers.co.kr C++ #include #include using namespace std; struct pos { int st,end; pos(int a, int b) { st=a; end=b; } bool operator < (const pos &b) const { return end < b.end; } }; int solution(vector routes) { int answer = 0; vector v; for(int i=0;i
https://www.acmicpc.net/problem/13460 13460번: 구슬 탈출 2 첫 번째 줄에는 보드의 세로, 가로 크기를 의미하는 두 정수 N, M (3 ≤ N, M ≤ 10)이 주어진다. 다음 N개의 줄에 보드의 모양을 나타내는 길이 M의 문자열이 주어진다. 이 문자열은 '.', '#', 'O', 'R', 'B' www.acmicpc.net #include #include using namespace std; int n, m; char g[11][11]; int dx[4] = { 0,0,1,-1 }; int dy[4] = { 1,-1,0,0 }; int c[11][11][11][11] = { 0 }; // 지나갔는지 확인 int rx, ry, bx, by,d; struct bead {..
https://www.acmicpc.net/problem/14501 #include #include using namespace std; int n; int t[16] = { 0 }; int p[16] = { 0 }; int result = 0; void DFS(int day, int currentCost) { if (day == n + 1) { result = max(result, currentCost); } else { if (day + t[day] > n; int i, j; int time, cost; for (i = 1; i > time >> cost; t[i] = time; p[i] = cost; } DFS(1,0); cout n; for (int i = 1; i > t[i] >> p[i]; f..