백준 문제
-
[백준] 7785번: 회사에 있는 사람코딩(Coding)/백준 문제풀이 2020. 12. 29. 10:26
회사에 있는 사람 문제 상근이는 세계적인 소프트웨어 회사 기글에서 일한다. 이 회사의 가장 큰 특징은 자유로운 출퇴근 시간이다. 따라서, 직원들은 반드시 9시부터 6시까지 회사에 있지 않아도 된다. 각 직원은 자기가 원할 때 출근할 수 있고, 아무때나 퇴근할 수 있다. 상근이는 모든 사람의 출입카드 시스템의 로그를 가지고 있다. 이 로그는 어떤 사람이 회사에 들어왔는지, 나갔는지가 기록되어져 있다. 로그가 주어졌을 때, 현재 회사에 있는 모든 사람을 구하는 프로그램을 작성하시오. 입력 첫째 줄에 로그에 기록된 출입 기록의 수 n이 주어진다. (2 ≤ n ≤ 106) 다음 n개의 줄에는 출입 기록이 순서대로 주어지며, 각 사람의 이름이 주어지고 "enter"나 "leave"가 주어진다. "enter"인 경..
-
[백준] 10174번: 팰린드롬코딩(Coding)/백준 문제풀이 2020. 12. 29. 10:20
링크: www.acmicpc.net/problem/10174 팰린드롬 문제 팰린드롬은 앞으로 읽으나 뒤로 읽으나 똑같은 단어나 숫자들을 말한다. 일반적으로 대소문자를 구분하지 않지만, 공백은 구분한다. 다음은 팰린드롬의 예시이다. Anna Harrah Arora Nat tan 9998999 123 321 $$$&&$$$ 모든 라인에 대해 팰린드롬인지 아닌지를 구분하는 프로그램을 작성하시오. 입력 첫째 줄에 테스트 케이스의 개수 n이 주어진다. 각 테스트 케이스는 한 줄의 텍스트로 이루어져있으며, 비어있는 줄은 없다. 출력 각 테스트 케이스에 대해 정답을 출력한다. 팰린드롬일 경우 "Yes"를 출력하고, 그렇지 않을 경우 "No"를 출력한다. 간단히 말해서 이 문제는 앞뒤로 읽었을때, 같은 글을 판단(대소..