목록전체 글 (222)
피너클의 it공부방
https://www.acmicpc.net/problem/7662 7662번: 이중 우선순위 큐 입력 데이터는 표준입력을 사용한다. 입력은 T개의 테스트 데이터로 구성된다. 입력의 첫 번째 줄에는 입력 데이터의 수를 나타내는 정수 T가 주어진다. 각 테스트 데이터의 첫째 줄에는 Q에 적 www.acmicpc.net 우선순위 큐를 이용한 복잡한 문제다. int test; cin >> test; while (test-- > 0) { priority_queue min_pq, max_pq; map m; cin >> n; for (int i = 0; i > c >> ll; 기본 준비를 한다음 if (c == 'D') { 만약 D를 입력받았다면 pop을 실행해야한다. 하지만 min_p..
https://www.acmicpc.net/problem/11945 11945번: 뜨거운 붕어빵 입력으로 주어지는 각 행을 반전시켜서 출력하면 됩니다. 입력의 1행 1열은 출력의 1행 M열로, 입력의 1행 2열은 출력의 1행 M-1열로 … 입력의 1행 M열은 출력의 1행 1열로 … 입력의 N행 M열은 출력 www.acmicpc.net 간단한 구현문제다. #include #include using namespace std; int n, m; string str[10]; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n >> m; for (int i = 0; i > str[i]; for (int i = ..
https://www.acmicpc.net/problem/9466 9466번: 텀 프로젝트 이번 가을학기에 '문제 해결' 강의를 신청한 학생들은 텀 프로젝트를 수행해야 한다. 프로젝트 팀원 수에는 제한이 없다. 심지어 모든 학생들이 동일한 팀의 팀원인 경우와 같이 한 팀만 있을 www.acmicpc.net 까다로운 dfs문제다. int n, cnt; bool visited[100001]; bool isCycle[100001]; int arr[100001]; visited는 방문한 학생, isCycle은 학생이 사이클 안에 있는지, cnt는 사이클안에 있는 학생의 수, n과 arr은 입력받는 값들이다. int test; cin >> test; while (test-- > 0) { cin >> n; for ..
https://www.acmicpc.net/problem/11943 11943번: 파일 옮기기 첫 번째 줄에는 첫 번째 바구니에 있는 사과와 오렌지의 수 A, B가 주어진다. (0 ≤ A, B ≤ 1,000) 두 번째 줄에는 두 번째 바구니에 있는 사과와 오렌지의 수 C, D가 주어진다. (0 ≤ C, D ≤ 1,000) www.acmicpc.net 간단한 구현문제다. #include #include using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int a, b, c, d; cin >> a >> b >> c >> d; cout
https://www.acmicpc.net/problem/13866 13866번: 팀 나누기 입력은 네 개의 정수 A, B, C 및 D가 포함된 한 줄로 구성되며 4명의 스킬 레벨이 주어진다. (0 ≤ A ≤ B ≤ C ≤ D ≤ 104) www.acmicpc.net 간단한 구현문제다. #include #include using namespace std; int arr[4]; int main() { for (int i = 0; i > arr[i]; sort(arr, arr + 4); cout
https://www.acmicpc.net/problem/9328 9328번: 열쇠 상근이는 1층 빌딩에 침입해 매우 중요한 문서를 훔쳐오려고 한다. 상근이가 가지고 있는 평면도에는 문서의 위치가 모두 나타나 있다. 빌딩의 문은 모두 잠겨있기 때문에, 문을 열려면 열쇠가 www.acmicpc.net 복잡한 bfs문제다. int h, w; bool can[27], visited[101][101]; string map[101]; string s; int dx[] = { -1, 0, 1, 0 }; int dy[] = { 0, 1, 0, -1 }; can은 가지고 있는 열쇠, visited는 현재까지 방문한 공간, map은 빌딩의 평면도, s는 처음 주어지는 열쇠다. int test; cin >> test; w..
https://www.acmicpc.net/problem/10807 10807번: 개수 세기 첫째 줄에 정수의 개수 N(1 ≤ N ≤ 100)이 주어진다. 둘째 줄에는 정수가 공백으로 구분되어져있다. 셋째 줄에는 찾으려고 하는 정수 v가 주어진다. 입력으로 주어지는 정수와 v는 -100보다 크거 www.acmicpc.net 간단한 구현문제다. #include using namespace std; int n, v; int arr[101]; int main() { int ans = 0; cin >> n; for (int i = 0; i > arr[i]; cin >> v; for (int i = 0; i < n; i++) if (arr[i] == v) ans++; cout
https://www.acmicpc.net/problem/11948 11948번: 과목선택 JOI는 물리, 화학, 생물, 지구과학, 역사, 지리 총 6 과목의 시험을 봤다. 각 시험의 만점은 100점이다. JOI는 물리, 화학, 생물, 지구과학 4과목 중에서 3 과목을 선택하고 역사, 지리 2 과목 중에 www.acmicpc.net 간단한 구현 문제다. #include #include using namespace std; int arr_1[4]; int arr_2[2]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); for (int i = 0; i > arr_1[i]; for (int i = 0; i <..
https://www.acmicpc.net/problem/1264 1264번: 모음의 개수 입력은 여러 개의 테스트 케이스로 이루어져 있으며, 각 줄마다 영어 대소문자, ',', '.', '!', '?', 공백으로 이루어진 문장이 주어진다. 각 줄은 최대 255글자로 이루어져 있다. 입력의 끝에는 한 줄 www.acmicpc.net 간단한 구현문제다. #include #include using namespace std; char c[] = { 'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U' }; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int a; string s; while (true..
https://www.acmicpc.net/problem/10768 10768번: 특별한 날 마지막 줄에 "Before", "After"나 "Special"을 출력한다. www.acmicpc.net 단순한 구현 문제다. #include using namespace std; int a, b; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> a >> b; if (a == 2 && b == 18) cout