목록Computer/Coding Test (70)
Machineboy空
https://www.acmicpc.net/problem/2636 2636번: 치즈 아래 과 같이 정사각형 칸들로 이루어진 사각형 모양의 판이 있고, 그 위에 얇은 치즈(회색으로 표시된 부분)가 놓여 있다. 판의 가장자리(에서 네모 칸에 X친 부분)에는 치즈가 놓 www.acmicpc.net 문제요약 공기와 접촉한 치즈의 표면이 녹아내릴 때, 모두 녹는 데 걸리는 시간과 녹기 1시간 전의 크기. 난이도 Gold 4 풀이 포인트 어떤 것을 중심으로 dfs를 돌릴지 잘 생각해야함. REVIEW 내가 하고 싶었던 건, 이동 방향에 우선순위를 두어 치즈 덩이(연결요소)의 시작점으로부터 반 시계방향 (아래,오른쪽,위, 왼쪽으로) 탐색하며 가장자리를 칠해가는 방식이었다. 풀이가 복잡해지는데 느낀 순간 오답이겠거니..
https://www.acmicpc.net/problem/14502 14502번: 연구소 인체에 치명적인 바이러스를 연구하던 연구소에서 바이러스가 유출되었다. 다행히 바이러스는 아직 퍼지지 않았고, 바이러스의 확산을 막기 위해서 연구소에 벽을 세우려고 한다. 연구소는 크 www.acmicpc.net 문제요약 3개의 벽을 세워 바이러스가 퍼지지 않는 안전영역의 최대 크기 구하기 난이도 Gold 4 풀이 포인트 단계 꼼꼼히 if (nx >= 0 && nx = 0 && ny =n || ny =m || b[nx][ny] > 0) continue; /..
https://www.acmicpc.net/problem/2852 2852번: NBA 농구 첫째 줄에 골이 들어간 횟수 N(1 n; for (int i = 0; i > o >> s; if (A > B) go(asum, s); else if (B > A) go(bsum, s); o == 1 ? A++ : B++; prev = s; } if (A > B) go(asum, "48:00"); else if (B > A) go(bsum, "48:00"); cout
https://www.acmicpc.net/problem/1325 > n >> m; for (int i = 0; i > v >> u; adj[u].push_back(v); } for (int i = 1; i
https://solved.ac/contribute/17298 로그인 www.acmicpc.net 문제요약 오큰수(해당 요소보다 오른쪽에 있으면서 큰 가장 왼쪽의 수 찾기) 난이도 Gold 4 풀이 포인트 stack과 짝짓기 현재 인덱스들과 오큰수를 짝지어 pop하는 아이디어를 떠올려야 함. https://machineboy0.tistory.com/149 3986 : 좋은 단어 - 스택 https://www.acmicpc.net/problem/3986 3986번: 좋은 단어 이번 계절학기에 심리학 개론을 수강 중인 평석이는 오늘 자정까지 보고서를 제출해야 한다. 보고서 작성이 너무 지루했던 평석이는 노트북에 엎드 machineboy0.tistory.com 스택 자료 구조를 이용한 쌍 Pop의 아이디어는 ..
https://www.acmicpc.net/problem/9012 9012번: 괄호 괄호 문자열(Parenthesis String, PS)은 두 개의 괄호 기호인 ‘(’ 와 ‘)’ 만으로 구성되어 있는 문자열이다. 그 중에서 괄호의 모양이 바르게 구성된 문자열을 올바른 괄호 문자열(Valid PS, VPS)이라고 www.acmicpc.net 문제요약 괄호 쌍이 모두 충족되는지 난이도 Silver 4 풀이 포인트 stack 자료 구조 getline(cin, t) cin : 공백(' ')이나 개행 문자(\n)를 만날 때까지 입력 getline : 공백(' ')이나 개행 문자(\n)를 만날 때까지 한 줄 전체 입력. //내가 했던 실수 3 (( )) ())(() int n; string s; cin >> n;..
https://www.acmicpc.net/problem/1436 1436번: 영화감독 숌 666은 종말을 나타내는 수라고 한다. 따라서, 많은 블록버스터 영화에서는 666이 들어간 제목을 많이 사용한다. 영화감독 숌은 세상의 종말 이라는 시리즈 영화의 감독이다. 조지 루카스는 스타워 www.acmicpc.net 문제요약 666이 들어가는 수들 중 작은 것 부터 차례로 출력 난이도 Silver 5 풀이 포인트 단순하게 생각하기 숫자와 문자의 자유자재 변환 string 숫자 → int 형 숫자 : stoi(string) int 형 숫자 → string 숫자 : to_string(int) REVIEW 규칙 찾으려다 진짜 너무 어려운 문제라고 생각하다가, string으로 찾아낸다고 생각하면 엄청나게 쉬워지는 ..
https://www.acmicpc.net/problem/3474 3474번: 교수가 된 현우 첫째 줄에 테스트 케이스의 개수 T가 주어지고, 이어서 T개의 줄에 정수 N이 주어진다(1 n; int fiveCnt = 0; for(int i = 0; i > k; fiveCnt = k/5;//첫 5의 배수 카운트를 따로 해주지 않고 아래 반복에 끼워넣으면 오답이더라.. 왜인진 분석해보기 for(int j = 25; j