diff --git a/.github/workflows/auto_check_solution_open.yml b/.github/workflows/auto_check_solution_open.yml new file mode 100644 index 0000000..cabdf42 --- /dev/null +++ b/.github/workflows/auto_check_solution_open.yml @@ -0,0 +1,60 @@ +name: Auto Check Solution + +on: + pull_request_target: + types: [opened, reopened] + +jobs: + create-pull-requst: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: main + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: '3.x' + architecture: 'x64' + - name: Setup Python Package + run: | + python -m pip install --upgrade pip + pip install bs4 requests + - name: tagging (1. Run script) + run: | + python scripts/check_pull_request.py --check_solution --pr_number ${{ github.event.number }} + echo "SOLUTION_LANG=`head -1 result`" >> $GITHUB_ENV + - name: add Label + if: contains(github.event.pull_request.labels.*.name, 'Solution') == false + uses: actions/github-script@v4 + with: + script: | + const { SOLUTION_LANG } = process.env + if (SOLUTION_LANG == "python") { + github.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ["Python", "Solution"] + }); + } + else if(SOLUTION_LANG == "cpp") { + github.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ["C++", "Solution"] + }); + } + else if(SOLUTION_LANG == "java") { + github.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ["Java", "Solution"] + }); + } + - name: Check Solution + run: | + python scripts/check_pull_request.py --pr_number ${{ github.event.number }} diff --git a/.github/workflows/auto_check_solution_pr.yml b/.github/workflows/auto_check_solution_pr.yml new file mode 100644 index 0000000..c3ad5fb --- /dev/null +++ b/.github/workflows/auto_check_solution_pr.yml @@ -0,0 +1,29 @@ +name: Auto Check Solution + +on: + pull_request: + branches: [main] + +jobs: + create-pull-requst: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: main + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: '3.x' + architecture: 'x64' + - name: Setup Python Package + run: | + python -m pip install --upgrade pip + pip install bs4 requests + - name: tagging (1. Run script) + run: | + python scripts/check_pull_request.py --check_solution --pr_number ${{ github.event.number }} + - name: Check Solution + run: | + python scripts/check_pull_request.py --pr_number ${{ github.event.number }} diff --git a/.github/workflows/auto_pick.yml b/.github/workflows/auto_pick.yml new file mode 100644 index 0000000..c672252 --- /dev/null +++ b/.github/workflows/auto_pick.yml @@ -0,0 +1,34 @@ +name: Auto Pick Problem (Daliy) + +on: + schedule: + - cron: '30 16 * * *' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: '3.x' + architecture: 'x64' + - name: Setup pip + run: | + python -m pip install --upgrade pip + pip install pytz + - name: PICK + run: | + python scripts/pick_problem.py + - name: Commits + run: | + git config --local user.email "tony9402@naver.com" + git config --local user.name "tony9402" + git add . + git commit -m "Today Problem" + - name: Push + uses: ad-m/github-push-action@master + with: + branch: 'main' + github_token: $ diff --git a/.github/workflows/auto_solution_update.yml b/.github/workflows/auto_solution_update.yml new file mode 100644 index 0000000..5f13bdb --- /dev/null +++ b/.github/workflows/auto_solution_update.yml @@ -0,0 +1,48 @@ +name: Auto Solution Update + +on: + push: + branches: [ main ] + paths-ignore: + - assets + - .github + - markdown + - scripts + - '.gitignore' + - 'CodingTest.md' + - 'LICENSE' + - 'README.md' + - 'algorithm_list.md' + - 'change_level.log' + - 'guideline_for_contribute.md' + - 'picked.md' + - 'status.md' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: '3.x' + architecture: 'x64' + - name: Setup pip + run: | + python -m pip install --upgrade pip + pip install pytz + - name: Run auto_update.py + run: | + python scripts/auto_update.py --push + - name: Config Github + run: | + git config --local user.email "tony9402@naver.com" + git config --local user.name "tony9402" + git add . + git commit -m "Auto Update (PUSH)" + - name: Push + uses: ad-m/github-push-action@master + with: + branch: ${{ github.ref }} + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/auto_update.yml b/.github/workflows/auto_update.yml new file mode 100644 index 0000000..1a8a4c8 --- /dev/null +++ b/.github/workflows/auto_update.yml @@ -0,0 +1,34 @@ +name: Auto Update README + +on: + schedule: + - cron: '30 19 * * *' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: '3.x' + architecture: 'x64' + - name: Setup pip + run: | + python -m pip install --upgrade pip + pip install pytz + - name: Run assemble.py + run: | + python scripts/auto_update.py --all + - name: Commits + run: | + git config --local user.email "tony9402@naver.com" + git config --local user.name "tony9402" + git add . + git commit -m "Auto UPDATE (ALL)" + - name: Push + uses: ad-m/github-push-action@master + with: + branch: 'main' + github_token: $ diff --git a/CodingTest.md b/CodingTest.md new file mode 100644 index 0000000..53a2530 --- /dev/null +++ b/CodingTest.md @@ -0,0 +1,57 @@ +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +### 최근 코딩테스트 정리 + +|회사|알고리즘| +|:--:|:--:| +|카카오(2021 카카오 개발자 여름 인턴십)|구현, 문자열, 그래프, 최단경로, 비트마스크, 그리디, 트리DP, 자료구조, 이분탐색| +|라인(2021 상반기)|구현, 시뮬레이션, BFS, 완전탐색| +|삼성(2021 상반기)|BFS, 시뮬레이션| +|네이버(2020 하반기)|구현, 시뮬레이션, BFS, DP, 완전탐색| +|삼성(2020 하반기)|BFS, 시뮬레이션| +|삼성(2020 상반기)|BFS, 시뮬레이션| +|카카오(2021 블라인드 1차)|투포인터, 완전탐색, DP, 트라이, 파싱, 최단경로, 이분탐색| +|카카오(2020 하반기)|구현, 문자열| +|카카오(2020 블라인드)|문자열, 재귀, 탐색, 트라이, 구현, 완전탐색, BFS| +|카카오(2020 카카오 인턴십)|구현, 완전탐색, 투포인터, BFS, DFS, 트리, 유니온파인드 | +|카카오(2019 블라인드)|배열, 해싱, map, 정렬, 조합, DFS, 정렬, 시뮬레이션, 트리 순회, 구현| +|카카오(2019 카카오 개발자 겨울 인터십)| BFS, 세그먼트 트리, 완전탐색, 자료구조, 다익스트라 | +|카카오(2018 블라인드 3차)|구현, 정렬,문자열,트라이| +|카카오(2018 블라인드 1차)|Bitwise, 문자열, 구현, 정렬, 시뮬레이션, 스케쥴링| +|라인(2020 하반기)|구현, 문자열, 시뮬레이션, 덱| +|라인(2019 상반기)|구현, BFS, DFS, DP| +|NHN(2020 하반기)|모노톤 스택, 그래프| +|NHN(2019 1차 면접)|플러드 필| +|NHN(2019 코테)|구현, 시뮬레이션| +|NHN(2018 1차 면접)|Trie, 비트마스킹| +|NHN(2018 코테)|구현, 시뮬레이션| +|모비스(2019)| DFS, DP| +|신한(2020 상반기)|BFS, 시뮬레이션| +|신한(2020 하반기)|유니온파인드, 문자열, 우선순위큐, 완전탐색, [SQL]| +|쿠팡(2020)|정렬, 위상정렬, 트리DP, 해싱(Map)| +|카카오커머스(2021)|구현, 완전탐색, 트리, DP| +|현대 오토에버|문자열, DP, 순열조합| +|SK C&C|Heap, 구현, 순열, BFS| +|파수|트리, 조합, 파싱, 구현| + +#### 코딩테스트 Algorithm 분류 + - 구현 + - DFS + - BFS + - Two pointer + - Brute Force + - DP + - Tree DP + - 시뮬레이션 + - Union Find + - String + - 자료구조 -> 우선순위 큐, 스택, 트리 + - 순열조합 + - Trie + - Flood fill + - Bit masking + - 위상정렬 + - 이분탐색 + - 최단거리 + - 파싱 + - Segment Tree diff --git a/algorithm_list.md b/algorithm_list.md new file mode 100644 index 0000000..8d91f51 --- /dev/null +++ b/algorithm_list.md @@ -0,0 +1,36 @@ +# 알고리즘 유형 정리 + +코테에 나올 만한 & 코테에 나온 적 있는 알고리즘을 정리 해봤습니다. + +### 알고리즘 + +- 수학 +- 그리디 +- 동적계획법 +- 투 포인터 +- 구현 +- BFS +- DFS +- 완전 탐색 +- 시뮬레이션 +- 이분탐색 +- 백트래킹 +- 분할정복 +- 누적 합 +- 문자열 +- 최단거리 +- 위상정렬 +- 분리 집합 +- 최소 스패닝 트리 +- 트라이 +- 트리디피 + +### 자료구조 +- map +- set +- tree +- priority queue +- queue +- stack +- deque +- list diff --git a/backtracking/README.md b/backtracking/README.md new file mode 100644 index 0000000..2ee39f7 --- /dev/null +++ b/backtracking/README.md @@ -0,0 +1,92 @@ +# Backtracking (백트래킹) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +백트래킹 문제를 뽑았습니다. + +백트래킹의 기본 연습 문제인 N과 M 시리즈 모든 문제를 추천 문제로 뽑았습니다. + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/7135) +| 순번 | 추천 문제 | 문제 번호 | 문제 이름 | 난이도 | 풀이 링크 | +| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | +| 00 | :heavy_check_mark: | 15649 | N과 M (1) | | 바로가기 | +| 01 | :heavy_check_mark: | 15650 | N과 M (2) | | 바로가기 | +| 02 | :heavy_check_mark: | 15651 | N과 M (3) | | 바로가기 | +| 03 | :heavy_check_mark: | 15652 | N과 M (4) | | 바로가기 | +| 04 | :heavy_check_mark: | 15654 | N과 M (5) | | 바로가기 | +| 05 | :heavy_check_mark: | 15655 | N과 M (6) | | 바로가기 | +| 06 | :heavy_check_mark: | 15656 | N과 M (7) | | 바로가기 | +| 07 | :heavy_check_mark: | 15657 | N과 M (8) | | 바로가기 | +| 08 | :heavy_check_mark: | 15663 | N과 M (9) | | 바로가기 | +| 09 | :heavy_check_mark: | 15664 | N과 M (10) | | 바로가기 | +| 10 | :heavy_check_mark: | 15665 | N과 M (11) | | 바로가기 | +| 11 | :heavy_check_mark: | 15666 | N과 M (12) | | 바로가기 | +| 12 | :heavy_check_mark: | 1182 | 부분수열의 합 | | 바로가기 | +| 13 | :heavy_check_mark: | 10971 | 외판원 순회 2 | | | +| 14 | :heavy_check_mark: | 16987 | 계란으로 계란치기 | | | +| 15 | :heavy_check_mark: | 14712 | 넴모넴모 (Easy) | | 바로가기 | +| 16 | :heavy_check_mark: | 14888 | 연산자 끼워넣기 | | | +| 17 | :heavy_check_mark: | 1174 | 줄어드는 수 | | | +| 18 | :heavy_check_mark: | 18430 | 무기 공학 | | 바로가기 | +| 19 | :heavy_check_mark: | 9663 | N-Queen | | 바로가기 | +| 20 | :heavy_check_mark: | 6443 | 애너그램 | | | +| 21 | :heavy_check_mark: | 2580 | 스도쿠 | | 바로가기 | +| 22 | :heavy_check_mark: | 1062 | 가르침 | | | +| 23 | :heavy_check_mark: | 2661 | 좋은수열 | | | +| 24 | :heavy_check_mark: | 3980 | 선발 명단 | | | +| 25 | :heavy_check_mark: | 22944 | 죽음의 비 | | 바로가기 | +| 26 | :heavy_check_mark: | 17136 | 색종이 붙이기 | | | +| 27 | :heavy_check_mark: | 1799 | 비숍 | | | +| 28 | | 14889 | 스타트와 링크 | | 바로가기 | +| 29 | | 10974 | 모든 순열 | | 바로가기 | +| 30 | | 16922 | 로마 숫자 만들기 | | | +| 31 | | 18429 | 근손실 | | | +| 32 | | 19949 | 영재의 시험 | | | +| 33 | | 15658 | 연산자 끼워넣기 (2) | | 바로가기 | +| 34 | | 20950 | 미술가 미미 | | | +| 35 | | 6603 | 로또 | | | +| 36 | | 10819 | 차이를 최대로 | | | +| 37 | | 2529 | 부등호 | | | +| 38 | | 19699 | 소-난다! | | | +| 39 | | 1553 | 도미노 찾기 | | | +| 40 | | 16198 | 에너지 모으기 | | 바로가기 | +| 41 | | 12101 | 1, 2, 3 더하기 2 | | | +| 42 | | 10597 | 순열장난 | | | +| 43 | | 1189 | 컴백홈 | | 바로가기 | +| 44 | | 18290 | NM과 K (1) | | | +| 45 | | 1497 | 기타콘서트 | | | +| 46 | | 15566 | 개구리 1 | | | +| 47 | | 1342 | 행운의 문자열 | | | +| 48 | | 6987 | 월드컵 | | | +| 49 | | 19942 | 다이어트 | | | +| 50 | | 1759 | 암호 만들기 | | | +| 51 | | 1038 | 감소하는 수 | | 바로가기 | +| 52 | | 2023 | 신기한 소수 | | | +| 53 | | 1405 | 미친 로봇 | | 바로가기 | +| 54 | | 7490 | 0 만들기 | | | +| 55 | | 13908 | 비밀번호 | | | +| 56 | | 7682 | 틱택토 | | | +| 57 | | 20208 | 진우의 민트초코우유 | | | +| 58 | | 10421 | 수식 완성하기 | | | +| 59 | | 15684 | 사다리 조작 | | | +| 60 | | 1469 | 숌 사이 수열 | | | +| 61 | | 1987 | 알파벳 | | | +| 62 | | 2239 | 스도쿠 | | | +| 63 | | 16938 | 캠프 준비 | | | +| 64 | | 2922 | 즐거운 단어 | | | +| 65 | | 15918 | 랭퍼든 수열쟁이야!! | | | +| 66 | | 1941 | 소문난 칠공주 | | | +| 67 | | 1248 | 맞춰봐 | | | +| 68 | | 9944 | NxM 보드 완주하기 | | | +| 69 | | 2026 | 소풍 | | 바로가기 | +| 70 | | 15659 | 연산자 끼워넣기 (3) | | | +| 71 | | 12908 | 텔레포트 3 | | | +| 72 | | 16571 | 알파 틱택토 | | | +| 73 | | 3165 | 5 | | | +| 74 | | 1729 | 이차원 배열의 합 | | | diff --git a/backtracking/header.md b/backtracking/header.md new file mode 100644 index 0000000..63e5fed --- /dev/null +++ b/backtracking/header.md @@ -0,0 +1,15 @@ +# Backtracking (백트래킹) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +백트래킹 문제를 뽑았습니다. + +백트래킹의 기본 연습 문제인 N과 M 시리즈 모든 문제를 추천 문제로 뽑았습니다. + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/7135) diff --git a/backtracking/list.md b/backtracking/list.md new file mode 100644 index 0000000..c838222 --- /dev/null +++ b/backtracking/list.md @@ -0,0 +1,75 @@ +1,15649,./../solution/backtracking/15649 +1,15650,./../solution/backtracking/15650 +1,15651,./../solution/backtracking/15651 +1,15652,./../solution/backtracking/15652 +1,15654,./../solution/backtracking/15654 +1,15655,./../solution/backtracking/15655 +1,15656,./../solution/backtracking/15656 +1,15657,./../solution/backtracking/15657 +1,15663,./../solution/backtracking/15663 +1,15664,./../solution/backtracking/15664 +1,15665,./../solution/backtracking/15665 +1,15666,./../solution/backtracking/15666 +,14889,./../solution/backtracking/14889 +,10974,./../solution/backtracking/10974 +,15658,./../solution/backtracking/15658 +,16922, +,18429, +,19949, +,1553, +,20950, +,6603, +1,1182,./../solution/backtracking/1182 +,10819, +1,10971, +,2529, +,6987, +1,16987, +,19699, +1,14712,./../solution/backtracking/14712 +1,14888, +,16198,./../solution/backtracking/16198 +,12101, +,10597, +1,1174, +,1189,./../solution/backtracking/1189 +,19942, +,18290, +,1497, +1,18430,./../solution/backtracking/18430 +,15566, +1,9663,./../solution/backtracking/9663 +,1759, +,15684, +,1038,./../solution/backtracking/1038 +,2023, +,1405,./../solution/backtracking/1405 +,1342, +,7490, +,13908, +,7682, +,20208, +,1469, +,10421, +,1987, +1,2580,./../solution/backtracking/2580 +1,1062, +1,2661, +,2239, +1,3980, +,16938, +,2922, +,15918, +,1941, +,1248, +,9944, +1,6443, +,2026,./../solution/backtracking/2026 +,15659, +,12908, +,1729, +1,17136, +1,1799, +,16571, +,3165, +1,22944,./../solution/backtracking/22944 diff --git a/binary_search/README.md b/binary_search/README.md new file mode 100644 index 0000000..30363fb --- /dev/null +++ b/binary_search/README.md @@ -0,0 +1,81 @@ +# Binary Search (이분탐색) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +추천 문제 아닌 나머지는 나머지를 난이도 섞었습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/7277) +| 순번 | 추천 문제 | 문제 번호 | 문제 이름 | 난이도 | 풀이 링크 | +| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | +| 00 | :heavy_check_mark: | 1789 | 수들의 합 | | 바로가기 | +| 01 | :heavy_check_mark: | 2417 | 정수 제곱근 | | 바로가기 | +| 02 | :heavy_check_mark: | 10815 | 숫자 카드 | | 바로가기 | +| 03 | :heavy_check_mark: | 2805 | 나무 자르기 | | 바로가기 | +| 04 | :heavy_check_mark: | 1654 | 랜선 자르기 | | 바로가기 | +| 05 | :heavy_check_mark: | 2512 | 예산 | | 바로가기 | +| 06 | :heavy_check_mark: | 19637 | IF문 좀 대신 써줘 | | 바로가기 | +| 07 | :heavy_check_mark: | 11663 | 선분 위의 점 | | | +| 08 | :heavy_check_mark: | 3079 | 입국심사 | | 바로가기 | +| 09 | :heavy_check_mark: | 22871 | 징검다리 건너기 (large) | | | +| 10 | :heavy_check_mark: | 2110 | 공유기 설치 | | 바로가기 | +| 11 | :heavy_check_mark: | 2470 | 두 용액 | | 바로가기 | +| 12 | :heavy_check_mark: | 20444 | 색종이와 가위 | | | +| 13 | :heavy_check_mark: | 1477 | 휴게소 세우기 | | 바로가기 | +| 14 | :heavy_check_mark: | 1939 | 중량제한 | | | +| 15 | :heavy_check_mark: | 2473 | 세 용액 | | | +| 16 | :heavy_check_mark: | 13397 | 구간 나누기 2 | | | +| 17 | :heavy_check_mark: | 2412 | 암벽 등반 | | | +| 18 | :heavy_check_mark: | 1300 | K번째 수 | | | +| 19 | :heavy_check_mark: | 7453 | 합이 0인 네 정수 | | | +| 20 | | 17266 | 어두운 굴다리 | | | +| 21 | | 1920 | 수 찾기 | | 바로가기 | +| 22 | | 10816 | 숫자 카드 2 | | 바로가기 | +| 23 | | 20551 | Sort 마스터 배지훈의 후계자 | | | +| 24 | | 2776 | 암기왕 | | 바로가기 | +| 25 | | 16960 | 스위치와 램프 | | | +| 26 | | 1072 | 게임 | | | +| 27 | | 7795 | 먹을 것인가 먹힐 것인가 | | | +| 28 | | 2792 | 보석 상자 | | | +| 29 | | 16401 | 과자 나눠주기 | | | +| 30 | | 13702 | 이상한 술집 | | | +| 31 | | 11561 | 징검다리 | | | +| 32 | | 14627 | 파닭파닭 | | | +| 33 | | 1166 | 선물 | | | +| 34 | | 17451 | 평행 우주 | | | +| 35 | | 17393 | 다이나믹 롤러 | | | +| 36 | | 17124 | 두 개의 배열 | | | +| 37 | | 2121 | 넷이 놀기 | | | +| 38 | | 6236 | 용돈 관리 | | 바로가기 | +| 39 | | 15810 | 풍선 공장 | | | +| 40 | | 17503 | 맥주 축제 | | | +| 41 | | 18113 | 그르다 김가놈 | | | +| 42 | | 2343 | 기타 레슨 | | | +| 43 | | 2022 | 사다리 | | | +| 44 | | 16564 | 히오스 프로게이머 | | | +| 45 | | 18114 | 블랙 프라이데이 | | | +| 46 | | 14575 | 뒤풀이 | | | +| 47 | | 17179 | 케이크 자르기 | | | +| 48 | | 20495 | 수열과 헌팅 | | | +| 49 | | 11687 | 팩토리얼 0의 개수 | | | +| 50 | | 3020 | 개똥벌레 | | | +| 51 | | 2467 | 용액 | | | +| 52 | | 2866 | 문자열 잘라내기 | | | +| 53 | | 9024 | 두 수의 합 | | | +| 54 | | 8983 | 사냥꾼 | | | +| 55 | | 17951 | 흩날리는 시험지 속에서 내 평점이 느껴진거야 | | | +| 56 | | 22945 | 팀 빌딩 | | | +| 57 | | 9007 | 카누 선수 | | | +| 58 | | 12757 | 전설의 JBNU | | | +| 59 | | 2143 | 두 배열의 합 | | 바로가기 | +| 60 | | 16434 | 드래곤 앤 던전 | | | +| 61 | | 15823 | 카드 팩 구매하기 | | | +| 62 | | 2613 | 숫자구슬 | | | +| 63 | | 1561 | 놀이 공원 | | | +| 64 | | 15732 | 도토리 숨기기 | | | +| 65 | | 6209 | 제자리 멀리뛰기 | | | diff --git a/binary_search/header.md b/binary_search/header.md new file mode 100644 index 0000000..a672999 --- /dev/null +++ b/binary_search/header.md @@ -0,0 +1,13 @@ +# Binary Search (이분탐색) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +추천 문제 아닌 나머지는 나머지를 난이도 섞었습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/7277) diff --git a/binary_search/list.md b/binary_search/list.md new file mode 100644 index 0000000..b098ac4 --- /dev/null +++ b/binary_search/list.md @@ -0,0 +1,66 @@ +1,1789,./../solution/binary_search/1789 +1,2417,./../solution/binary_search/2417 +,17266, +,1920,./../solution/binary_search/1920 +1,10815,./../solution/binary_search/10815 +,10816,./../solution/binary_search/10816 +,20551, +1,2805,./../solution/binary_search/2805 +1,1654,./../solution/binary_search/1654 +1,2512,./../solution/binary_search/2512 +,1072, +,2776,./../solution/binary_search/2776 +,6236,./../solution/binary_search/6236 +,7795, +,2792, +,16401, +,13702, +,11561, +,14627, +,1166, +,17451, +1,19637,./../solution/binary_search/19637 +,17393, +,17124, +1,11663, +,15810, +,17503, +,18113, +,2121, +1,2110,./../solution/binary_search/2110 +,2343, +1,3079,./../solution/binary_search/3079 +,2022, +,16564, +,11687, +,18114, +,14575, +,17179, +,16960, +,20495, +1,2470,./../solution/binary_search/2470 +,3020, +,2467, +1,1477,./../solution/binary_search/1477 +,2866, +1,20444, +,9024, +1,1939, +,8983, +1,2473, +1,13397, +,9007, +1,2412, +,17951, +,12757, +1,1300, +,2143,./../solution/binary_search/2143 +,16434, +,15823, +1,7453, +,2613, +,1561, +,15732, +,6209, +1,22871, +,22945, diff --git a/brute_force/README.md b/brute_force/README.md new file mode 100644 index 0000000..13873ac --- /dev/null +++ b/brute_force/README.md @@ -0,0 +1,113 @@ +# Brute Force (완전탐색) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +추천 문제 아닌 나머지는 나머지를 난이도 섞었습니다. + +완전탐색 중 백트래킹 있었던 문제와 최대한 겹치지 않도록 했습니다. + +다른 알고리즘 풀었어도 완전탐색으로 풀어보시면 좋습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/7271) +| 순번 | 추천 문제 | 문제 번호 | 문제 이름 | 난이도 | 풀이 링크 | +| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | +| 00 | :heavy_check_mark: | 22864 | 피로도 | | | +| 01 | :heavy_check_mark: | 2798 | 블랙잭 | | 바로가기 | +| 02 | :heavy_check_mark: | 2231 | 분해합 | | 바로가기 | +| 03 | :heavy_check_mark: | 19532 | 수학은 비대면강의입니다 | | 바로가기 | +| 04 | :heavy_check_mark: | 18312 | 시각 | | 바로가기 | +| 05 | :heavy_check_mark: | 15721 | 번데기 | | 바로가기 | +| 06 | :heavy_check_mark: | 1969 | DNA | | 바로가기 | +| 07 | :heavy_check_mark: | 2422 | 한윤정이 이탈리아에 가서 아이스크림을 사먹는데 | | 바로가기 | +| 08 | :heavy_check_mark: | 5568 | 카드 놓기 | | 바로가기 | +| 09 | :heavy_check_mark: | 18511 | 큰 수 구성하기 | | 바로가기 | +| 10 | :heavy_check_mark: | 2503 | 숫자 야구 | | 바로가기 | +| 11 | :heavy_check_mark: | 17626 | Four Squares | | 바로가기 | +| 12 | :heavy_check_mark: | 9079 | 동전 게임 | | 바로가기 | +| 13 | :heavy_check_mark: | 16937 | 두 스티커 | | | +| 14 | :heavy_check_mark: | 16439 | 치킨치킨치킨 | | 바로가기 | +| 15 | :heavy_check_mark: | 14501 | 퇴사 | | | +| 16 | :heavy_check_mark: | 2615 | 오목 | | 바로가기 | +| 17 | :heavy_check_mark: | 16508 | 전공책 | | | +| 18 | :heavy_check_mark: | 14620 | 꽃길 | | 바로가기 | +| 19 | :heavy_check_mark: | 12919 | A와 B 2 | | | +| 20 | :heavy_check_mark: | 1548 | 부분 삼각 수열 | | | +| 21 | :heavy_check_mark: | 2961 | 도영이가 만든 맛있는 음식 | | | +| 22 | :heavy_check_mark: | 15661 | 링크와 스타트 | | 바로가기 | +| 23 | :heavy_check_mark: | 1025 | 제곱수 찾기 | | | +| 24 | :heavy_check_mark: | 14500 | 테트로미노 | | 바로가기 | +| 25 | :heavy_check_mark: | 15686 | 치킨 배달 | | | +| 26 | :heavy_check_mark: | 21278 | 호석이 두 마리 치킨 | | 바로가기 | +| 27 | :heavy_check_mark: | 21315 | 카드 섞기 | | 바로가기 | +| 28 | :heavy_check_mark: | 22944 | 죽음의 비 | | | +| 29 | :heavy_check_mark: | 16637 | 괄호 추가하기 | | | +| 30 | :heavy_check_mark: | 14391 | 종이 조각 | | | +| 31 | :heavy_check_mark: | 18808 | 스티커 붙이기 | | 바로가기 | +| 32 | :heavy_check_mark: | 21943 | 연산 최대로 | | | +| 33 | | 9094 | 수학적 호기심 | | 바로가기 | +| 34 | | 4690 | 완전 세제곱 | | 바로가기 | +| 35 | | 3040 | 백설 공주와 일곱 난쟁이 | | | +| 36 | | 10448 | 유레카 이론 | | | +| 37 | | 2309 | 일곱 난쟁이 | | 바로가기 | +| 38 | | 14697 | 방 배정하기 | | | +| 39 | | 1668 | 트로피 진열 | | | +| 40 | | 13410 | 거꾸로 구구단 | | 바로가기 | +| 41 | | 1145 | 적어도 대부분의 배수 | | 바로가기 | +| 42 | | 2160 | 그림 비교 | | | +| 43 | | 18512 | 점프 점프 | | | +| 44 | | 18868 | 멀티버스 Ⅰ | | | +| 45 | | 4096 | 팰린드로미터 | | 바로가기 | +| 46 | | 1436 | 영화감독 숌 | | 바로가기 | +| 47 | | 1018 | 체스판 다시 칠하기 | | | +| 48 | | 7568 | 덩치 | | 바로가기 | +| 49 | | 2435 | 기상청 인턴 신현수 | | | +| 50 | | 2635 | 수 이어가기 | | | +| 51 | | 1059 | 좋은 구간 | | | +| 52 | | 11170 | 0의 개수 | | | +| 53 | | 1251 | 단어 나누기 | | | +| 54 | | 14912 | 숫자 빈도수 | | | +| 55 | | 17521 | Byte Coin | | | +| 56 | | 19947 | 투자의 귀재 배주형 | | | +| 57 | | 15779 | Zigzag | | | +| 58 | | 5671 | 호텔 방 번호 | | | +| 59 | | 1359 | 복권 | | | +| 60 | | 17484 | 진우의 달 여행 (Small) | | | +| 61 | | 1065 | 한수 | | | +| 62 | | 1120 | 문자열 | | | +| 63 | | 1543 | 문서 검색 | | | +| 64 | | 15970 | 화살표 그리기 | | | +| 65 | | 5883 | 아이폰 9S | | | +| 66 | | 16951 | 블록 놀이 | | | +| 67 | | 11502 | 세 개의 소수 문제 | | | +| 68 | | 1895 | 필터 | | | +| 69 | | 3085 | 사탕 게임 | | | +| 70 | | 1487 | 물건 팔기 | | | +| 71 | | 15270 | 친구 팰린드롬 | | | +| 72 | | 9996 | 한국이 그리울 땐 서버에 접속하지 | | | +| 73 | | 19949 | 영재의 시험 | | | +| 74 | | 15728 | 에리 - 카드 | | | +| 75 | | 1503 | 세 수 고르기 | | | +| 76 | | 10472 | 십자뒤집기 | | | +| 77 | | 1421 | 나무꾼 이다솜 | | | +| 78 | | 1411 | 비슷한 단어 | | | +| 79 | | 2304 | 창고 다각형 | | | +| 80 | | 1254 | 팰린드롬 만들기 | | | +| 81 | | 1527 | 금민수의 개수 | | | +| 82 | | 17610 | 양팔저울 | | | +| 83 | | 16943 | 숫자 재배치 | | | +| 84 | | 17085 | 십자가 2개 놓기 | | | +| 85 | | 14225 | 부분수열의 합 | | | +| 86 | | 1107 | 리모컨 | | | +| 87 | | 1747 | 소수&팰린드롬 | | | +| 88 | | 1034 | 램프 | | | +| 89 | | 1711 | 직각삼각형 | | | +| 90 | | 17471 | 게리맨더링 | | 바로가기 | +| 91 | | 1581 | 락스타 락동호 | | | +| 92 | | 16986 | 인싸들의 가위바위보 | | | +| 93 | | 22947 | 실행 시간 | | | diff --git a/brute_force/header.md b/brute_force/header.md new file mode 100644 index 0000000..695f95c --- /dev/null +++ b/brute_force/header.md @@ -0,0 +1,17 @@ +# Brute Force (완전탐색) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +추천 문제 아닌 나머지는 나머지를 난이도 섞었습니다. + +완전탐색 중 백트래킹 있었던 문제와 최대한 겹치지 않도록 했습니다. + +다른 알고리즘 풀었어도 완전탐색으로 풀어보시면 좋습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/7271) diff --git a/brute_force/list.md b/brute_force/list.md new file mode 100644 index 0000000..0818c49 --- /dev/null +++ b/brute_force/list.md @@ -0,0 +1,94 @@ +,9094,./../solution/brute_force/9094 +,4690,./../solution/brute_force/4690 +,3040, +,10448, +1,2798,./../solution/brute_force/2798 +,2309,./../solution/brute_force/2309 +1,2231,./../solution/brute_force/2231 +,14697, +,1668, +,13410,./../solution/brute_force/13410 +1,19532,./../solution/brute_force/19532 +1,18312,./../solution/brute_force/18312 +,1145,./../solution/brute_force/1145 +,2160, +,18512, +,18868, +1,15721,./../solution/brute_force/15721 +1,1969,./../solution/brute_force/1969 +1,2503,./../solution/brute_force/2503 +,1436,./../solution/brute_force/1436 +,1018, +,7568,./../solution/brute_force/7568 +1,2422,./../solution/brute_force/2422 +,2435, +1,17626,./../solution/brute_force/17626 +,2635, +,1059, +1,5568,./../solution/brute_force/5568 +,11170, +,1251, +,14912, +,17521, +,19947, +,1359, +,15779, +1,18511,./../solution/brute_force/18511 +,17484, +1,9079,./../solution/brute_force/9079 +,4096,./../solution/brute_force/4096 +,1065, +1,14501, +,1120, +,3085, +,1543, +,15970, +,5671, +1,16937, +,5883, +,16951, +,1487, +,15270, +1,2615,./../solution/brute_force/2615 +,11502, +,9996, +,10472, +,1895, +1,16439,./../solution/brute_force/16439 +,19949, +,15728, +1,16508, +,1503, +1,14620,./../solution/brute_force/14620 +1,12919, +,1421, +,1411, +1,1548, +,1254, +1,2961, +1,15661,./../solution/brute_force/15661 +,1527, +,17610, +,16943, +1,1025, +,17085, +1,14500,./../solution/brute_force/14500 +1,15686, +,1107, +,17471,./../solution/brute_force/17471 +,1747, +,14225, +,1034, +1,16637, +1,14391, +1,18808,./../solution/brute_force/18808 +,16986, +,1711, +,1581, +1,21278,./../solution/brute_force/21278 +1,21315,./../solution/brute_force/21315 +,2304, +1,21943, +1,22864, +1,22944, +,22947, diff --git a/data_structure/README.md b/data_structure/README.md new file mode 100644 index 0000000..b923218 --- /dev/null +++ b/data_structure/README.md @@ -0,0 +1,40 @@ +# Data Structre (자료구조) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +이 자료구조에서는 큐, 스택, 덱을 익히는 문제들로 뽑았습니다. + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/6779) +| 순번 | 추천 문제 | 문제 번호 | 문제 이름 | 난이도 | 풀이 링크 | +| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | +| 00 | :heavy_check_mark: | 1158 | 요세푸스 문제 | | 바로가기 | +| 01 | :heavy_check_mark: | 10828 | 스택 | | 바로가기 | +| 02 | :heavy_check_mark: | 9012 | 괄호 | | 바로가기 | +| 03 | :heavy_check_mark: | 18258 | 큐 2 | | 바로가기 | +| 04 | :heavy_check_mark: | 2164 | 카드2 | | 바로가기 | +| 05 | :heavy_check_mark: | 10866 | | | 바로가기 | +| 06 | :heavy_check_mark: | 1874 | 스택 수열 | | 바로가기 | +| 07 | :heavy_check_mark: | 1935 | 후위 표기식2 | | 바로가기 | +| 08 | :heavy_check_mark: | 10799 | 쇠막대기 | | 바로가기 | +| 09 | :heavy_check_mark: | 1966 | 프린터 큐 | | 바로가기 | +| 10 | :heavy_check_mark: | 2346 | 풍선 터뜨리기 | | 바로가기 | +| 11 | :heavy_check_mark: | 2504 | 괄호의 값 | | 바로가기 | +| 12 | :heavy_check_mark: | 2800 | 괄호 제거 | | 바로가기 | +| 13 | :heavy_check_mark: | 2493 | | | 바로가기 | +| 14 | :heavy_check_mark: | 22942 | 데이터 체커 | | 바로가기 | +| 15 | :heavy_check_mark: | 1918 | 후위 표기식 | | 바로가기 | +| 16 | | 10845 | | | 바로가기 | +| 17 | | 4949 | 균형잡힌 세상 | | | +| 18 | | 3986 | 좋은 단어 | | 바로가기 | +| 19 | | 1021 | 회전하는 큐 | | 바로가기 | +| 20 | | 5397 | 키로거 | | 바로가기 | +| 21 | | 18115 | 카드 놓기 | | | +| 22 | | 5430 | AC | | 바로가기 | +| 23 | | 1863 | 스카이라인 쉬운거 | | | +| 24 | | 22866 | 탑 보기 | | | diff --git a/data_structure/header.md b/data_structure/header.md new file mode 100644 index 0000000..0cb41b5 --- /dev/null +++ b/data_structure/header.md @@ -0,0 +1,13 @@ +# Data Structre (자료구조) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +이 자료구조에서는 큐, 스택, 덱을 익히는 문제들로 뽑았습니다. + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/6779) diff --git a/data_structure/list.md b/data_structure/list.md new file mode 100644 index 0000000..deb9974 --- /dev/null +++ b/data_structure/list.md @@ -0,0 +1,25 @@ +1,10828,./../solution/data_structure/10828 +1,9012,./../solution/data_structure/9012 +1,1874,./../solution/data_structure/1874 +1,1935,./../solution/data_structure/1935 +1,10799,./../solution/data_structure/10799 +1,2504,./../solution/data_structure/2504 +1,2800,./../solution/data_structure/2800 +1,2493,./../solution/data_structure/2493 +1,1918,./../solution/data_structure/1918 +1,18258,./../solution/data_structure/18258 +1,1158,./../solution/data_structure/1158 +1,2164,./../solution/data_structure/2164 +1,1966,./../solution/data_structure/1966 +1,10866,./../solution/data_structure/10866 +1,2346,./../solution/data_structure/2346 +,10845,./../solution/data_structure/10845 +,4949, +,3986,./../solution/data_structure/3986 +,1021,./../solution/data_structure/1021 +,5397,./../solution/data_structure/5397 +,18115, +,5430,./../solution/data_structure/5430 +,1863, +,22866, +1,22942,./../solution/data_structure/22942 diff --git a/data_structure2/README.md b/data_structure2/README.md new file mode 100644 index 0000000..3affff3 --- /dev/null +++ b/data_structure2/README.md @@ -0,0 +1,36 @@ +# Data Structre2 (자료구조2) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +이 자료구조에서는 Map, Set, Priority Queue(우선순위 큐)를 익히는 문제들로 뽑았습니다. + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/6780) +| 순번 | 추천 문제 | 문제 번호 | 문제 이름 | 난이도 | 풀이 링크 | +| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | +| 00 | :heavy_check_mark: | 1620 | 나는야 포켓몬 마스터 이다솜 | | 바로가기 | +| 01 | :heavy_check_mark: | 14425 | 문자열 집합 | | 바로가기 | +| 02 | :heavy_check_mark: | 11279 | 최대 힙 | | 바로가기 | +| 03 | :heavy_check_mark: | 11286 | 절댓값 힙 | | 바로가기 | +| 04 | :heavy_check_mark: | 4358 | 생태학 | | 바로가기 | +| 05 | :heavy_check_mark: | 7662 | 이중 우선순위 큐 | | 바로가기 | +| 06 | :heavy_check_mark: | 2075 | N번째 큰 수 | | 바로가기 | +| 07 | :heavy_check_mark: | 21939 | 문제 추천 시스템 Version 1 | | 바로가기 | +| 08 | :heavy_check_mark: | 21944 | 문제 추천 시스템 Version 2 | | | +| 09 | :heavy_check_mark: | 2696 | 중앙값 구하기 | | 바로가기 | +| 10 | :heavy_check_mark: | 21942 | 부품 대여장 | | 바로가기 | +| 11 | | 2776 | 암기왕 | | | +| 12 | | 10546 | 배부른 마라토너 | | 바로가기 | +| 13 | | 1302 | 베스트셀러 | | 바로가기 | +| 14 | | 9375 | 패션왕 신해빈 | | | +| 15 | | 1269 | 대칭 차집합 | | 바로가기 | +| 16 | | 1927 | 최소 힙 | | 바로가기 | +| 17 | | 19583 | 싸이버개강총회 | | | +| 18 | | 17255 | N으로 만들기 | | | +| 19 | | 12764 | 싸지방에 간 준하 | | | +| 20 | | 1655 | 가운데를 말해요 | | | diff --git a/data_structure2/header.md b/data_structure2/header.md new file mode 100644 index 0000000..170b2d9 --- /dev/null +++ b/data_structure2/header.md @@ -0,0 +1,13 @@ +# Data Structre2 (자료구조2) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +이 자료구조에서는 Map, Set, Priority Queue(우선순위 큐)를 익히는 문제들로 뽑았습니다. + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/6780) diff --git a/data_structure2/list.md b/data_structure2/list.md new file mode 100644 index 0000000..b33430a --- /dev/null +++ b/data_structure2/list.md @@ -0,0 +1,21 @@ +1,1620,./../solution/data_structure2/1620 +1,14425,./../solution/data_structure2/14425 +1,11279,./../solution/data_structure2/11279 +1,11286,./../solution/data_structure2/11286 +1,7662,./../solution/data_structure2/7662 +1,2075,./../solution/data_structure2/2075 +1,4358,./../solution/data_structure2/4358 +1,2696,./../solution/data_structure2/2696 +,9375, +,1927,./../solution/data_structure2/1927 +,19583, +,17255, +,12764, +,1655, +,2776, +,1269,./../solution/data_structure2/1269 +,10546,./../solution/data_structure2/10546 +,1302,./../solution/data_structure2/1302 +1,21939,./../solution/data_structure2/21939 +1,21942,./../solution/data_structure2/21942 +1,21944, diff --git a/disjoint_set/README.md b/disjoint_set/README.md new file mode 100644 index 0000000..fbded2d --- /dev/null +++ b/disjoint_set/README.md @@ -0,0 +1,40 @@ +# Disjoint Set (분리집합) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +추천 문제 아닌 나머지는 나머지를 난이도 섞었습니다. + +일반적으로 분리집합을 표현하는데에는 배열을 활용한 유니언 파인드 자료구조를 사용합니다. + +다만, 카카오 기출 문제에서 일반적인 유니언 파인드 구조를 사용하지 못하도록 전체 크기를 엄청나게 늘린 문제가 출제 되었던 만큼, +배열이 아닌 해시나 이진트리를 활용해 유니언 파인드 구조를 만들어 보는 연습도 필요합니다! + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/6784) +| 순번 | 추천 문제 | 문제 번호 | 문제 이름 | 난이도 | 풀이 링크 | +| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | +| 00 | :heavy_check_mark: | 1717 | 집합의 표현 | | 바로가기 | +| 01 | :heavy_check_mark: | 1976 | 여행 가자 | | 바로가기 | +| 02 | :heavy_check_mark: | 16562 | 친구비 | | 바로가기 | +| 03 | :heavy_check_mark: | 18116 | 로봇 조립 | | 바로가기 | +| 04 | :heavy_check_mark: | 4195 | 친구 네트워크 | | 바로가기 | +| 05 | :heavy_check_mark: | 10775 | 공항 | | 바로가기 | +| 06 | | 17352 | 여러분의 다리가 되어 드리겠습니다! | | 바로가기 | +| 07 | | 7511 | 소셜 네트워킹 어플리케이션 | | | +| 08 | | 20040 | 사이클 게임 | | | +| 09 | | 12893 | 적의 적 | | | +| 10 | | 1043 | 거짓말 | | 바로가기 | +| 11 | | 16168 | 퍼레이드 | | | +| 12 | | 20955 | 민서의 응급 수술 | | | +| 13 | | 11085 | 군사 이동 | | | +| 14 | | 3108 | 로고 | | | +| 15 | | 15789 | CTP 왕국은 한솔 왕국을 이길 수 있을까? | | | +| 16 | | 17090 | 미로 탈출하기 | | | +| 17 | | 16724 | 피리 부는 사나이 | | | +| 18 | | 14595 | 동방 프로젝트 (Large) | | | +| 19 | | 17398 | 통신망 분할 | | | diff --git a/disjoint_set/header.md b/disjoint_set/header.md new file mode 100644 index 0000000..8836fab --- /dev/null +++ b/disjoint_set/header.md @@ -0,0 +1,18 @@ +# Disjoint Set (분리집합) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +추천 문제 아닌 나머지는 나머지를 난이도 섞었습니다. + +일반적으로 분리집합을 표현하는데에는 배열을 활용한 유니언 파인드 자료구조를 사용합니다. + +다만, 카카오 기출 문제에서 일반적인 유니언 파인드 구조를 사용하지 못하도록 전체 크기를 엄청나게 늘린 문제가 출제 되었던 만큼, +배열이 아닌 해시나 이진트리를 활용해 유니언 파인드 구조를 만들어 보는 연습도 필요합니다! + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/6784) diff --git a/disjoint_set/list.md b/disjoint_set/list.md new file mode 100644 index 0000000..8b55759 --- /dev/null +++ b/disjoint_set/list.md @@ -0,0 +1,20 @@ +1,1717,./../solution/disjoint_set/1717 +1,1976,./../solution/disjoint_set/1976 +1,16562,./../solution/disjoint_set/16562 +1,4195,./../solution/disjoint_set/4195 +1,10775,./../solution/disjoint_set/10775 +,20040, +,11085, +,17398, +,17352,./../solution/disjoint_set/17352 +,12893, +,1043,./../solution/disjoint_set/1043 +,16168, +,7511, +,20955, +,3108, +,15789, +1,18116,./../solution/disjoint_set/18116 +,17090, +,16724, +,14595, diff --git a/divide_and_conquer/README.md b/divide_and_conquer/README.md new file mode 100644 index 0000000..0a880fb --- /dev/null +++ b/divide_and_conquer/README.md @@ -0,0 +1,33 @@ +# Divide and conquer (분할정복) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +추천 문제 아닌 나머지는 나머지를 난이도 섞었습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/7275) +| 순번 | 추천 문제 | 문제 번호 | 문제 이름 | 난이도 | 풀이 링크 | +| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | +| 00 | :heavy_check_mark: | 2630 | 색종이 만들기 | | 바로가기 | +| 01 | :heavy_check_mark: | 17829 | 222-풀링 | | 바로가기 | +| 02 | :heavy_check_mark: | 18222 | 투에-모스 문자열 | | 바로가기 | +| 03 | :heavy_check_mark: | 2447 | 별 찍기 - 10 | | 바로가기 | +| 04 | :heavy_check_mark: | 1992 | 쿼드트리 | | 바로가기 | +| 05 | :heavy_check_mark: | 1074 | Z | | 바로가기 | +| 06 | :heavy_check_mark: | 2448 | 별 찍기 - 11 | | 바로가기 | +| 07 | :heavy_check_mark: | 4256 | 트리 | | 바로가기 | +| 08 | | 4779 | 칸토어 집합 | | 바로가기 | +| 09 | | 1780 | 종이의 개수 | | | +| 10 | | 1802 | 종이 접기 | | 바로가기 | +| 11 | | 5904 | Moo 게임 | | | +| 12 | | 14600 | 샤워실 바닥 깔기 (Small) | | | +| 13 | | 1493 | 박스 채우기 | | | +| 14 | | 2374 | 같은 수로 만들기 | | | +| 15 | | 1030 | 프렉탈 평면 | | | +| 16 | | 16438 | 원숭이 스포츠 | | | +| 17 | | 14601 | 샤워실 바닥 깔기 (Large) | | | diff --git a/divide_and_conquer/header.md b/divide_and_conquer/header.md new file mode 100644 index 0000000..21cc939 --- /dev/null +++ b/divide_and_conquer/header.md @@ -0,0 +1,13 @@ +# Divide and conquer (분할정복) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +추천 문제 아닌 나머지는 나머지를 난이도 섞었습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/7275) diff --git a/divide_and_conquer/list.md b/divide_and_conquer/list.md new file mode 100644 index 0000000..c9652d1 --- /dev/null +++ b/divide_and_conquer/list.md @@ -0,0 +1,18 @@ +1,2630,./../solution/divide_and_conquer/2630 +,4779,./../solution/divide_and_conquer/4779 +,1780, +1,17829,./../solution/divide_and_conquer/17829 +1,18222,./../solution/divide_and_conquer/18222 +,1802,./../solution/divide_and_conquer/1802 +1,2447,./../solution/divide_and_conquer/2447 +1,1992,./../solution/divide_and_conquer/1992 +1,1074,./../solution/divide_and_conquer/1074 +,5904, +,1493, +,2374, +1,4256,./../solution/divide_and_conquer/4256 +,14600, +,1030, +,16438, +,14601, +1,2448,./../solution/divide_and_conquer/2448 diff --git a/dynamic_programming_1/README.md b/dynamic_programming_1/README.md new file mode 100644 index 0000000..a67e23b --- /dev/null +++ b/dynamic_programming_1/README.md @@ -0,0 +1,100 @@ +# Dynamic Programming 1 (동적계획법 1) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +다이나믹 프로그래밍 유형 쉬운 문제 위주로 뽑았습니다. + +다이나믹 프로그래밍은 점화식을 세우면 절반 이상은 풀었다고 볼 수 있습니다. + +점화식 세우는 건 금방 익히기 힘들어 코딩테스트에 나올만한 문제들, +다이나믹 프로그래밍을 공부할만한 문제들을 최대한 뽑았습니다. + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/7020) +| 순번 | 추천 문제 | 문제 번호 | 문제 이름 | 난이도 | 풀이 링크 | +| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | +| 00 | :heavy_check_mark: | 10870 | 피보나치 수 5 | | 바로가기 | +| 01 | :heavy_check_mark: | 2839 | 설탕 배달 | | 바로가기 | +| 02 | :heavy_check_mark: | 2748 | 피보나치 수 2 | | 바로가기 | +| 03 | :heavy_check_mark: | 1010 | 다리 놓기 | | 바로가기 | +| 04 | :heavy_check_mark: | 9655 | 돌 게임 | | 바로가기 | +| 05 | :heavy_check_mark: | 17626 | Four Squares | | 바로가기 | +| 06 | :heavy_check_mark: | 1463 | 1로 만들기 | | 바로가기 | +| 07 | :heavy_check_mark: | 9095 | 1, 2, 3 더하기 | | 바로가기 | +| 08 | :heavy_check_mark: | 11726 | 2×n 타일링 | | 바로가기 | +| 09 | :heavy_check_mark: | 2579 | 계단 오르기 | | 바로가기 | +| 10 | :heavy_check_mark: | 11727 | 2×n 타일링 2 | | 바로가기 | +| 11 | :heavy_check_mark: | 2407 | 조합 | | 바로가기 | +| 12 | :heavy_check_mark: | 22857 | 가장 긴 짝수 연속한 부분 수열 (small) | | | +| 13 | :heavy_check_mark: | 11053 | 가장 긴 증가하는 부분 수열 | | 바로가기 | +| 14 | :heavy_check_mark: | 1912 | 연속합 | | 바로가기 | +| 15 | :heavy_check_mark: | 11055 | 가장 큰 증가 부분 수열 | | 바로가기 | +| 16 | :heavy_check_mark: | 1890 | 점프 | | 바로가기 | +| 17 | :heavy_check_mark: | 9465 | 스티커 | | 바로가기 | +| 18 | :heavy_check_mark: | 15486 | 퇴사 2 | | 바로가기 | +| 19 | :heavy_check_mark: | 1106 | 호텔 | | 바로가기 | +| 20 | :heavy_check_mark: | 2156 | 포도주 시식 | | | +| 21 | :heavy_check_mark: | 10844 | 쉬운 계단 수 | | | +| 22 | :heavy_check_mark: | 2294 | 동전 2 | | 바로가기 | +| 23 | :heavy_check_mark: | 11660 | 구간 합 구하기 5 | | 바로가기 | +| 24 | :heavy_check_mark: | 21317 | 징검다리 건너기 | | 바로가기 | +| 25 | :heavy_check_mark: | 22869 | 징검다리 건너기 (small) | | 바로가기 | +| 26 | :heavy_check_mark: | 2293 | 동전 1 | | | +| 27 | | 15489 | 파스칼 삼각형 | | | +| 28 | | 2670 | 연속부분최대곱 | | | +| 29 | | 13699 | 점화식 | | 바로가기 | +| 30 | | 15624 | 피보나치 수 7 | | | +| 31 | | 14501 | 퇴사 | | | +| 32 | | 1003 | 피보나치 함수 | | | +| 33 | | 2193 | 이친수 | | | +| 34 | | 9461 | 파도반 수열 | | 바로가기 | +| 35 | | 1699 | 제곱수의 합 | | | +| 36 | | 10211 | Maximum Subarray | | | +| 37 | | 17175 | 피보나치는 지겨웡~ | | | +| 38 | | 17212 | 달나라 토끼를 위한 구매대금 지불 도우미 | | | +| 39 | | 20152 | Game Addiction | | | +| 40 | | 2491 | 수열 | | | +| 41 | | 15990 | 1, 2, 3 더하기 5 | | 바로가기 | +| 42 | | 2876 | 그래픽스 퀴즈 | | | +| 43 | | 11722 | 가장 긴 감소하는 부분 수열 | | 바로가기 | +| 44 | | 1965 | 상자넣기 | | | +| 45 | | 11060 | 점프 점프 | | | +| 46 | | 15988 | 1, 2, 3 더하기 3 | | | +| 47 | | 1660 | 캡틴 이다솜 | | | +| 48 | | 14430 | 자원 캐기 | | | +| 49 | | 18353 | 병사 배치하기 | | | +| 50 | | 17291 | 새끼치기 | | | +| 51 | | 4097 | 수익 | | | +| 52 | | 20162 | 간식 파티 | | | +| 53 | | 19622 | 회의실 배정 3 | | 바로가기 | +| 54 | | 1633 | 최고의 팀 만들기 | | | +| 55 | | 1149 | RGB거리 | | | +| 56 | | 1932 | 정수 삼각형 | | | +| 57 | | 11052 | 카드 구매하기 | | | +| 58 | | 11057 | 오르막 수 | | | +| 59 | | 11051 | 이항 계수 2 | | | +| 60 | | 11048 | 이동하기 | | 바로가기 | +| 61 | | 1309 | 동물원 | | | +| 62 | | 2011 | 암호코드 | | | +| 63 | | 10164 | 격자상의 경로 | | 바로가기 | +| 64 | | 16194 | 카드 구매하기 2 | | | +| 65 | | 15989 | 1, 2, 3 더하기 4 | | 바로가기 | +| 66 | | 12101 | 1, 2, 3 더하기 2 | | | +| 67 | | 15992 | 1, 2, 3 더하기 7 | | | +| 68 | | 15991 | 1, 2, 3 더하기 6 | | | +| 69 | | 16195 | 1, 2, 3 더하기 9 | | | +| 70 | | 15993 | 1, 2, 3 더하기 8 | | | +| 71 | | 1495 | 기타리스트 | | | +| 72 | | 2302 | 극장 좌석 | | | +| 73 | | 11568 | 민균이의 계략 | | | +| 74 | | 12026 | BOJ 거리 | | | +| 75 | | 13910 | 개업 | | | +| 76 | | 22871 | 징검다리 건너기 (large) | | | +| 77 | | 14852 | 타일 채우기 3 | | | +| 78 | | 2565 | 전깃줄 | | | +| 79 | | 14722 | 우유 도시 | | 바로가기 | diff --git a/dynamic_programming_1/header.md b/dynamic_programming_1/header.md new file mode 100644 index 0000000..a5020df --- /dev/null +++ b/dynamic_programming_1/header.md @@ -0,0 +1,18 @@ +# Dynamic Programming 1 (동적계획법 1) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +다이나믹 프로그래밍 유형 쉬운 문제 위주로 뽑았습니다. + +다이나믹 프로그래밍은 점화식을 세우면 절반 이상은 풀었다고 볼 수 있습니다. + +점화식 세우는 건 금방 익히기 힘들어 코딩테스트에 나올만한 문제들, +다이나믹 프로그래밍을 공부할만한 문제들을 최대한 뽑았습니다. + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/7020) diff --git a/dynamic_programming_1/list.md b/dynamic_programming_1/list.md new file mode 100644 index 0000000..d5e4f4d --- /dev/null +++ b/dynamic_programming_1/list.md @@ -0,0 +1,80 @@ +1,10870,./../solution/dynamic_programming_1/10870 +1,2839,./../solution/dynamic_programming_1/2839 +1,2748,./../solution/dynamic_programming_1/2748 +1,1010,./../solution/dynamic_programming_1/1010 +1,9655,./../solution/dynamic_programming_1/9655 +1,17626,./../solution/dynamic_programming_1/17626 +,15489, +,14501, +,2670, +,13699,./../solution/dynamic_programming_1/13699 +1,1463,./../solution/dynamic_programming_1/1463 +1,9095,./../solution/dynamic_programming_1/9095 +,1003, +1,11726,./../solution/dynamic_programming_1/11726 +1,2579,./../solution/dynamic_programming_1/2579 +,2193, +1,11727,./../solution/dynamic_programming_1/11727 +,9461,./../solution/dynamic_programming_1/9461 +,1699, +,15990,./../solution/dynamic_programming_1/15990 +,10211, +,17175, +,15624, +,17212, +,2876, +,20152, +1,11053,./../solution/dynamic_programming_1/11053 +1,1912,./../solution/dynamic_programming_1/1912 +1,9465,./../solution/dynamic_programming_1/9465 +1,11055,./../solution/dynamic_programming_1/11055 +,11722,./../solution/dynamic_programming_1/11722 +1,1890,./../solution/dynamic_programming_1/1890 +,1965, +1,2407,./../solution/dynamic_programming_1/2407 +,11060, +,15988, +,2491, +1,15486,./../solution/dynamic_programming_1/15486 +,1660, +,14852, +,14430, +,1633, +,18353, +1,1106,./../solution/dynamic_programming_1/1106 +,17291, +,4097, +,20162, +,1149, +,1932, +1,2156, +1,10844, +,11052, +,11057, +1,2293, +,11051, +,11048,./../solution/dynamic_programming_1/11048 +1,2294,./../solution/dynamic_programming_1/2294 +,1309, +,2565, +,2011, +1,11660,./../solution/dynamic_programming_1/11660 +,10164,./../solution/dynamic_programming_1/10164 +,16194, +,19622,./../solution/dynamic_programming_1/19622 +,15989,./../solution/dynamic_programming_1/15989 +,12101, +,15992, +,15991, +,16195, +,15993, +,1495, +,2302, +,11568, +,12026, +,14722,./../solution/dynamic_programming_1/14722 +,13910, +1,21317,./../solution/dynamic_programming_1/21317 +1,22857, +1,22869,./../solution/dynamic_programming_1/22869 +,22871, diff --git a/dynamic_programming_2/README.md b/dynamic_programming_2/README.md new file mode 100644 index 0000000..259fae3 --- /dev/null +++ b/dynamic_programming_2/README.md @@ -0,0 +1,101 @@ +# Dynamic Programming 2 (동적계획법 2) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +다이나믹 프로그래밍 유형 문제 위주로 뽑았습니다. + +다이나믹 프로그래밍은 점화식을 세우면 절반 이상은 풀었다고 볼 수 있습니다. + +점화식 세우는 건 금방 익히기 힘들어 코딩테스트에 나올만한 문제들, +다이나믹 프로그래밍을 공부할만한 문제들을 최대한 뽑았습니다. + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/7021) +| 순번 | 추천 문제 | 문제 번호 | 문제 이름 | 난이도 | 풀이 링크 | +| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | +| 00 | :heavy_check_mark: | 15724 | 주지수 | | | +| 01 | :heavy_check_mark: | 9084 | 동전 | | | +| 02 | :heavy_check_mark: | 12865 | 평범한 배낭 | | | +| 03 | :heavy_check_mark: | 9251 | LCS | | 바로가기 | +| 04 | :heavy_check_mark: | 2225 | 합분해 | | | +| 05 | :heavy_check_mark: | 5557 | 1학년 | | 바로가기 | +| 06 | :heavy_check_mark: | 2631 | 줄세우기 | | | +| 07 | :heavy_check_mark: | 2624 | 동전 바꿔주기 | | | +| 08 | :heavy_check_mark: | 2228 | 구간 나누기 | | | +| 09 | :heavy_check_mark: | 14567 | 선수과목 (Prerequisite) | | 바로가기 | +| 10 | :heavy_check_mark: | 17485 | 진우의 달 여행 (Large) | | 바로가기 | +| 11 | :heavy_check_mark: | 2073 | 수도배관공사 | | | +| 12 | :heavy_check_mark: | 21941 | 문자열 제거 | | | +| 13 | :heavy_check_mark: | 18427 | 함께 블록 쌓기 | | 바로가기 | +| 14 | :heavy_check_mark: | 1915 | 가장 큰 정사각형 | | | +| 15 | :heavy_check_mark: | 2758 | 로또 | | | +| 16 | :heavy_check_mark: | 1520 | 내리막 길 | | 바로가기 | +| 17 | :heavy_check_mark: | 2056 | 작업 | | | +| 18 | :heavy_check_mark: | 1695 | 팰린드롬 만들기 | | | +| 19 | :heavy_check_mark: | 20542 | 받아쓰기 | | | +| 20 | :heavy_check_mark: | 21923 | 곡예 비행 | | 바로가기 | +| 21 | :heavy_check_mark: | 1005 | ACM Craft | | 바로가기 | +| 22 | :heavy_check_mark: | 11049 | 행렬 곱셈 순서 | | | +| 23 | :heavy_check_mark: | 1823 | 수확 | | | +| 24 | :heavy_check_mark: | 10942 | 팰린드롬? | | | +| 25 | :heavy_check_mark: | 2629 | 양팔저울 | | | +| 26 | :heavy_check_mark: | 20181 | 꿈틀꿈틀 호석 애벌레 - 효율성 | | | +| 27 | :heavy_check_mark: | 3687 | 성냥개비 | | 바로가기 | +| 28 | | 1535 | 안녕 | | | +| 29 | | 17216 | 가장 큰 감소 부분 수열 | | | +| 30 | | 3067 | Coins | | | +| 31 | | 14728 | 벼락치기 | | | +| 32 | | 17845 | 수강 과목 | | | +| 33 | | 17070 | 파이프 옮기기 1 | | | +| 34 | | 14226 | 이모티콘 | | | +| 35 | | 5582 | 공통 부분 문자열 | | | +| 36 | | 13398 | 연속합 2 | | | +| 37 | | 4811 | 알약 | | | +| 38 | | 2688 | 줄어들지 않아 | | | +| 39 | | 13302 | 리조트 | | | +| 40 | | 17069 | 파이프 옮기기 2 | | | +| 41 | | 2229 | 조 짜기 | | | +| 42 | | 5569 | 출근 경로 | | | +| 43 | | 14699 | 관악산 등산 | | | +| 44 | | 17265 | 나의 인생에는 수학과 함께 | | | +| 45 | | 1757 | 달려달려 | | | +| 46 | | 4095 | 최대 정사각형 | | | +| 47 | | 16400 | 소수 화폐 | | | +| 48 | | 11985 | 오렌지 출하 | | 바로가기 | +| 49 | | 20002 | 사과나무 | | | +| 50 | | 11909 | 배열 탈출 | | 바로가기 | +| 51 | | 17208 | 카우버거 알바생 | | | +| 52 | | 5624 | 좋은 수 | | | +| 53 | | 14925 | 목장 건설하기 | | | +| 54 | | 10653 | 마라톤 2 | | | +| 55 | | 17255 | N으로 만들기 | | | +| 56 | | 2602 | 돌다리 건너기 | | | +| 57 | | 2616 | 소형기관차 | | | +| 58 | | 17404 | RGB거리 2 | | | +| 59 | | 2157 | 여행 | | | +| 60 | | 14863 | 서울에서 경산까지 | | | +| 61 | | 1577 | 도로의 개수 | | | +| 62 | | 1082 | 방 번호 | | | +| 63 | | 2411 | 아이템 먹기 | | | +| 64 | | 1301 | 비즈 공예 | | | +| 65 | | 2253 | 점프 | | | +| 66 | | 13902 | 개업 2 | | | +| 67 | | 13707 | 합분해 2 | | | +| 68 | | 14945 | 불장난 | | | +| 69 | | 7579 | | | 바로가기 | +| 70 | | 1943 | 동전 분배 | | | +| 71 | | 11054 | 가장 긴 바이토닉 부분 수열 | | | +| 72 | | 1937 | 욕심쟁이 판다 | | | +| 73 | | 11066 | 파일 합치기 | | | +| 74 | | 1516 | 게임 개발 | | 바로가기 | +| 75 | | 1958 | LCS 3 | | | +| 76 | | 1727 | 커플 만들기 | | | +| 77 | | 21925 | 짝수 팰린드롬 | | | +| 78 | | 12015 | 가장 긴 증가하는 부분 수열 2 | | 바로가기 | +| 79 | | 19645 | 햄최몇? | | | +| 80 | | 20667 | 크롬 | | | diff --git a/dynamic_programming_2/header.md b/dynamic_programming_2/header.md new file mode 100644 index 0000000..bd299ed --- /dev/null +++ b/dynamic_programming_2/header.md @@ -0,0 +1,18 @@ +# Dynamic Programming 2 (동적계획법 2) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +다이나믹 프로그래밍 유형 문제 위주로 뽑았습니다. + +다이나믹 프로그래밍은 점화식을 세우면 절반 이상은 풀었다고 볼 수 있습니다. + +점화식 세우는 건 금방 익히기 힘들어 코딩테스트에 나올만한 문제들, +다이나믹 프로그래밍을 공부할만한 문제들을 최대한 뽑았습니다. + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/7021) diff --git a/dynamic_programming_2/list.md b/dynamic_programming_2/list.md new file mode 100644 index 0000000..fb71d38 --- /dev/null +++ b/dynamic_programming_2/list.md @@ -0,0 +1,81 @@ +,1535, +1,9084, +,3067, +1,12865, +,14728, +,17845, +,17208, +1,18427,./../solution/dynamic_programming_2/18427 +,7579,./../solution/dynamic_programming_2/7579 +1,2629, +,19645, +,20667, +1,9251,./../solution/dynamic_programming_2/9251 +1,2225, +1,1915, +,17070, +1,5557,./../solution/dynamic_programming_2/5557 +1,2631, +,14226, +,5582, +,13398, +,4811, +,2688, +1,2624, +,13302, +1,2228, +,17069, +,2229, +,5569, +,5624, +,14925, +,14699, +1,14567,./../solution/dynamic_programming_2/14567 +,17265, +,1757, +,4095, +1,2758, +,10653, +,16400, +,17216, +,11985,./../solution/dynamic_programming_2/11985 +1,17485,./../solution/dynamic_programming_2/17485 +1,15724, +,20002, +,17255, +1,2073, +1,1520,./../solution/dynamic_programming_2/1520 +1,2056, +,2602, +,2616, +,17404, +1,1695, +,2157, +,14863, +,1577, +,1082, +,2411, +,1301, +,2253, +,13902, +,13707, +,14945, +,1943, +1,20542, +,11054, +1,1005,./../solution/dynamic_programming_2/1005 +,1937, +,11066, +1,11049, +,1516,./../solution/dynamic_programming_2/1516 +,1958, +,1727, +1,1823, +1,10942, +1,20181, +1,3687,./../solution/dynamic_programming_2/3687 +,12015,./../solution/dynamic_programming_2/12015 +,11909,./../solution/dynamic_programming_2/11909 +,21925, +1,21923,./../solution/dynamic_programming_2/21923 +1,21941, diff --git a/dynamic_programming_on_trees/README.md b/dynamic_programming_on_trees/README.md new file mode 100644 index 0000000..8f6459d --- /dev/null +++ b/dynamic_programming_on_trees/README.md @@ -0,0 +1,29 @@ +# Dynamic Programming On Trees (트리 디피) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +트리에서의 다이나믹 프로그래밍(Tree DP, 트리디피) 문제를 뽑아봤습니다. + +이 유형은 코딩테스트에서 나올 확률이 매우 적습니다. + +이 유형을 몰라도 충분히 통과할 수 있다고 추측되니 다른 유형을 더 보완하는게 좋을 수 있습니다. +**또한 이 유형은 최근 카카오 코딩테스트를 제외하고 본 적이 없습니다. + 하지만 카카오 코딩테스트에서 나왔기 때문에 추가하였습니다.** + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/7166) +| 순번 | 추천 문제 | 문제 번호 | 문제 이름 | 난이도 | 풀이 링크 | +| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | +| 00 | :heavy_check_mark: | 15681 | 트리와 쿼리 | | 바로가기 | +| 01 | :heavy_check_mark: | 2533 | 사회망 서비스(SNS) | | 바로가기 | +| 02 | :heavy_check_mark: | 2213 | 트리의 독립집합 | | 바로가기 | +| 03 | :heavy_check_mark: | 1949 | 우수 마을 | | 바로가기 | +| 04 | | 2058 | 원자의 에너지 | | | +| 05 | | 12978 | 스크루지 민호 2 | | | +| 06 | | 1135 | 뉴스 전하기 | | 바로가기 | +| 07 | | 17831 | 대기업 승범이네 | | 바로가기 | diff --git a/dynamic_programming_on_trees/header.md b/dynamic_programming_on_trees/header.md new file mode 100644 index 0000000..2e77273 --- /dev/null +++ b/dynamic_programming_on_trees/header.md @@ -0,0 +1,19 @@ +# Dynamic Programming On Trees (트리 디피) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +트리에서의 다이나믹 프로그래밍(Tree DP, 트리디피) 문제를 뽑아봤습니다. + +이 유형은 코딩테스트에서 나올 확률이 매우 적습니다. + +이 유형을 몰라도 충분히 통과할 수 있다고 추측되니 다른 유형을 더 보완하는게 좋을 수 있습니다. +**또한 이 유형은 최근 카카오 코딩테스트를 제외하고 본 적이 없습니다. + 하지만 카카오 코딩테스트에서 나왔기 때문에 추가하였습니다.** + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/7166) diff --git a/dynamic_programming_on_trees/list.md b/dynamic_programming_on_trees/list.md new file mode 100644 index 0000000..32328fb --- /dev/null +++ b/dynamic_programming_on_trees/list.md @@ -0,0 +1,8 @@ +1,15681,./../solution/dynamic_programming_on_trees/15681 +1,2533,./../solution/dynamic_programming_on_trees/2533 +,2058, +1,2213,./../solution/dynamic_programming_on_trees/2213 +1,1949,./../solution/dynamic_programming_on_trees/1949 +,12978, +,17831,./../solution/dynamic_programming_on_trees/17831 +,1135,./../solution/dynamic_programming_on_trees/1135 diff --git a/graph_traversal/README.md b/graph_traversal/README.md new file mode 100644 index 0000000..c68752e --- /dev/null +++ b/graph_traversal/README.md @@ -0,0 +1,115 @@ +# Graph Traversal (그래프 탐색) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +추천 문제 아닌 나머지는 나머지를 난이도 섞었습니다. + +BFS, DFS 유형을 다양하게 골랐습니다. + +문제를 보고 어떤 알고리즘을 써야할지 잘 판단하셔야 합니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/6853) +| 순번 | 추천 문제 | 문제 번호 | 문제 이름 | 난이도 | 풀이 링크 | +| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | +| 00 | :heavy_check_mark: | 2606 | 바이러스 | | 바로가기 | +| 01 | :heavy_check_mark: | 1260 | DFS와 BFS | | 바로가기 | +| 02 | :heavy_check_mark: | 11725 | 트리의 부모 찾기 | | 바로가기 | +| 03 | :heavy_check_mark: | 1325 | 효율적인 해킹 | | 바로가기 | +| 04 | :heavy_check_mark: | 2178 | 미로 탐색 | | 바로가기 | +| 05 | :heavy_check_mark: | 2667 | 단지번호붙이기 | | 바로가기 | +| 06 | :heavy_check_mark: | 7576 | 토마토 | | 바로가기 | +| 07 | :heavy_check_mark: | 7569 | 토마토 | | 바로가기 | +| 08 | :heavy_check_mark: | 16918 | 봄버맨 | | 바로가기 | +| 09 | :heavy_check_mark: | 5547 | 일루미네이션 | | 바로가기 | +| 10 | :heavy_check_mark: | 14502 | 연구소 | | 바로가기 | +| 11 | :heavy_check_mark: | 16234 | 인구 이동 | | 바로가기 | +| 12 | :heavy_check_mark: | 2636 | 치즈 | | 바로가기 | +| 13 | :heavy_check_mark: | 13549 | 숨바꼭질 3 | | 바로가기 | +| 14 | :heavy_check_mark: | 17836 | 공주님을 구해라! | | 바로가기 | +| 15 | :heavy_check_mark: | 14940 | 쉬운 최단거리 | | 바로가기 | +| 16 | :heavy_check_mark: | 18513 | 샘터 | | 바로가기 | +| 17 | :heavy_check_mark: | 2668 | 숫자고르기 | | | +| 18 | :heavy_check_mark: | 13023 | ABCDE | | | +| 19 | :heavy_check_mark: | 1600 | 말이 되고픈 원숭이 | | | +| 20 | :heavy_check_mark: | 16954 | 움직이는 미로 탈출 | | 바로가기 | +| 21 | :heavy_check_mark: | 16973 | 직사각형 탈출 | | | +| 22 | :heavy_check_mark: | 2206 | 벽 부수고 이동하기 | | 바로가기 | +| 23 | :heavy_check_mark: | 2573 | 빙산 | | | +| 24 | :heavy_check_mark: | 4179 | 불! | | 바로가기 | +| 25 | :heavy_check_mark: | 16932 | 모양 만들기 | | | +| 26 | :heavy_check_mark: | 1967 | 트리의 지름 | | | +| 27 | :heavy_check_mark: | 9466 | 텀 프로젝트 | | | +| 28 | :heavy_check_mark: | 22868 | 산책 (small) | | | +| 29 | :heavy_check_mark: | 22946 | 원 이동하기 1 | | | +| 30 | :heavy_check_mark: | 22948 | 원 이동하기 2 | | | +| 31 | | 16956 | 늑대와 양 | | | +| 32 | | 1012 | 유기농 배추 | | 바로가기 | +| 33 | | 11724 | 연결 요소의 개수 | | 바로가기 | +| 34 | | 4963 | 섬의 개수 | | 바로가기 | +| 35 | | 7562 | 나이트의 이동 | | | +| 36 | | 2644 | 촌수계산 | | | +| 37 | | 3184 | | | | +| 38 | | 18352 | 특정 거리의 도시 찾기 | | | +| 39 | | 13565 | 침투 | | | +| 40 | | 12761 | 돌다리 | | | +| 41 | | 3187 | 양치기 꿍 | | | +| 42 | | 18232 | 텔레포트 정거장 | | | +| 43 | | 14248 | 점프 점프 | | | +| 44 | | 5567 | 결혼식 | | | +| 45 | | 17086 | 아기 상어 2 | | | +| 46 | | 1058 | 친구 | | 바로가기 | +| 47 | | 21938 | 영상처리 | | | +| 48 | | 16928 | 뱀과 사다리 게임 | | | +| 49 | | 1697 | 숨바꼭질 | | | +| 50 | | 2583 | 영역 구하기 | | | +| 51 | | 1926 | 그림 | | | +| 52 | | 1743 | 음식물 피하기 | | | +| 53 | | 6118 | 숨바꼭질 | | | +| 54 | | 16953 | A → B | | 바로가기 | +| 55 | | 16948 | 데스 나이트 | | | +| 56 | | 18405 | 경쟁적 전염 | | | +| 57 | | 15558 | 점프 게임 | | | +| 58 | | 1303 | 전쟁 - 전투 | | | +| 59 | | 14496 | 그대, 그머가 되어 | | | +| 60 | | 11123 | 양 한마리... 양 두마리... | | | +| 61 | | 18404 | 현명한 나이트 | | | +| 62 | | 14716 | 현수막 | | 바로가기 | +| 63 | | 16174 | 점프왕 쩰리 (Large) | | 바로가기 | +| 64 | | 21937 | 작업 | | | +| 65 | | 10026 | 적록색약 | | | +| 66 | | 5014 | 스타트링크 | | | +| 67 | | 2589 | 보물섬 | | 바로가기 | +| 68 | | 9019 | DSLR | | | +| 69 | | 12851 | 숨바꼭질 2 | | | +| 70 | | 17129 | 윌리암슨수액빨이딱따구리가 정보섬에 올라온 이유 | | | +| 71 | | 2194 | 유닛 이동시키기 | | | +| 72 | | 1068 | 트리 | | | +| 73 | | 16432 | 떡장수와 호랑이 | | | +| 74 | | 3055 | 탈출 | | | +| 75 | | 11559 | Puyo Puyo | | | +| 76 | | 17141 | 연구소 2 | | | +| 77 | | 1707 | 이분 그래프 | | 바로가기 | +| 78 | | 17142 | 연구소 3 | | | +| 79 | | 5427 | | | | +| 80 | | 13913 | 숨바꼭질 4 | | | +| 81 | | 2638 | 치즈 | | | +| 82 | | 2665 | 미로만들기 | | | +| 83 | | 2234 | 성곽 | | | +| 84 | | 6087 | 레이저 통신 | | | +| 85 | | 2151 | 거울 설치 | | | +| 86 | | 14923 | 미로 탈출 | | | +| 87 | | 1726 | 로봇 | | 바로가기 | +| 88 | | 2146 | 다리 만들기 | | | +| 89 | | 14442 | 벽 부수고 이동하기 2 | | | +| 90 | | 10711 | 모래성 | | | +| 91 | | 16947 | 서울 지하철 2호선 | | | +| 92 | | 16988 | Baaaaaaaaaduk2 (Easy) | | | +| 93 | | 16985 | Maaaaaaaaaze | | | +| 94 | | 17616 | 등수 찾기 | | | +| 95 | | 22949 | 회전 미로 탐색 | | | diff --git a/graph_traversal/header.md b/graph_traversal/header.md new file mode 100644 index 0000000..32545da --- /dev/null +++ b/graph_traversal/header.md @@ -0,0 +1,17 @@ +# Graph Traversal (그래프 탐색) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +추천 문제 아닌 나머지는 나머지를 난이도 섞었습니다. + +BFS, DFS 유형을 다양하게 골랐습니다. + +문제를 보고 어떤 알고리즘을 써야할지 잘 판단하셔야 합니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/6853) diff --git a/graph_traversal/list.md b/graph_traversal/list.md new file mode 100644 index 0000000..25ef0f9 --- /dev/null +++ b/graph_traversal/list.md @@ -0,0 +1,96 @@ +1,1260,./../solution/graph_traversal/1260 +1,2606,./../solution/graph_traversal/2606 +,1012,./../solution/graph_traversal/1012 +,11724,./../solution/graph_traversal/11724 +,4963,./../solution/graph_traversal/4963 +,7562, +,2644, +1,11725,./../solution/graph_traversal/11725 +1,1325,./../solution/graph_traversal/1325 +,3184, +,18352, +,16928, +,13565, +,12761, +,3187, +,18232, +,14248, +1,2178,./../solution/graph_traversal/2178 +1,2667,./../solution/graph_traversal/2667 +1,7576,./../solution/graph_traversal/7576 +,1697, +,2583, +1,7569,./../solution/graph_traversal/7569 +,5567, +,1926, +,1743, +,6118, +,16953,./../solution/graph_traversal/16953 +,16948, +1,16918,./../solution/graph_traversal/16918 +,18405, +,15558, +,1303, +,17086, +,14496, +,11123, +,18404, +1,5547,./../solution/graph_traversal/5547 +1,14502,./../solution/graph_traversal/14502 +,10026, +,3055, +1,16234,./../solution/graph_traversal/16234 +,5014, +,2589,./../solution/graph_traversal/2589 +,9019, +1,2636,./../solution/graph_traversal/2636 +1,13549,./../solution/graph_traversal/13549 +,11559, +1,1600, +,12851, +,17141, +1,16954,./../solution/graph_traversal/16954 +,14716,./../solution/graph_traversal/14716 +1,17836,./../solution/graph_traversal/17836 +1,16973, +,17129, +,16174,./../solution/graph_traversal/16174 +1,14940,./../solution/graph_traversal/14940 +,2194, +1,18513,./../solution/graph_traversal/18513 +1,2206,./../solution/graph_traversal/2206 +,1707,./../solution/graph_traversal/1707 +1,2573, +,17142, +,5427, +,13913, +,2638, +,2665, +,1726,./../solution/graph_traversal/1726 +1,4179,./../solution/graph_traversal/4179 +,2234, +,6087, +,2151, +,14923, +1,16932, +,2146, +,14442, +,10711, +,16947, +,16988, +,16985, +,16956, +,1068, +,1058,./../solution/graph_traversal/1058 +1,2668, +1,13023, +,16432, +1,9466, +1,1967, +,17616, +,21937, +,21938, +1,22868, +1,22946, +1,22948, +,22949, diff --git a/greedy/README.md b/greedy/README.md new file mode 100644 index 0000000..1a2d626 --- /dev/null +++ b/greedy/README.md @@ -0,0 +1,77 @@ +# Greedy (그리디) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +쉬운 그리디부터 조금 고민을 해야하는 그리디까지 다양하게 뽑아봤습니다. + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/6833) +| 순번 | 추천 문제 | 문제 번호 | 문제 이름 | 난이도 | 풀이 링크 | +| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | +| 00 | :heavy_check_mark: | 14916 | 거스름돈 | | 바로가기 | +| 01 | :heavy_check_mark: | 1343 | 폴리오미노 | | | +| 02 | :heavy_check_mark: | 2217 | 로프 | | 바로가기 | +| 03 | :heavy_check_mark: | 13305 | 주유소 | | 바로가기 | +| 04 | :heavy_check_mark: | 1758 | 알바생 강호 | | 바로가기 | +| 05 | :heavy_check_mark: | 11508 | 2+1 세일 | | 바로가기 | +| 06 | :heavy_check_mark: | 11399 | ATM | | 바로가기 | +| 07 | :heavy_check_mark: | 20115 | 에너지 드링크 | | 바로가기 | +| 08 | :heavy_check_mark: | 20300 | 서강근육맨 | | 바로가기 | +| 09 | :heavy_check_mark: | 1931 | 회의실 배정 | | 바로가기 | +| 10 | :heavy_check_mark: | 1541 | 잃어버린 괄호 | | 바로가기 | +| 11 | :heavy_check_mark: | 20365 | 블로그2 | | 바로가기 | +| 12 | :heavy_check_mark: | 11047 | 동전 0 | | | +| 13 | :heavy_check_mark: | 16953 | A → B | | | +| 14 | :heavy_check_mark: | 21314 | 민겸 수 | | | +| 15 | :heavy_check_mark: | 21758 | 꿀 따기 | | 바로가기 | +| 16 | :heavy_check_mark: | 11000 | 강의실 배정 | | 바로가기 | +| 17 | :heavy_check_mark: | 13164 | 행복 유치원 | | 바로가기 | +| 18 | :heavy_check_mark: | 19598 | 최소 회의실 개수 | | 바로가기 | +| 19 | :heavy_check_mark: | 2212 | 센서 | | 바로가기 | +| 20 | :heavy_check_mark: | 1092 | | | | +| 21 | :heavy_check_mark: | 2141 | 우체국 | | 바로가기 | +| 22 | :heavy_check_mark: | 2812 | 크게 만들기 | | 바로가기 | +| 23 | :heavy_check_mark: | 13975 | 파일 합치기 3 | | | +| 24 | :heavy_check_mark: | 1715 | 카드 정렬하기 | | | +| 25 | :heavy_check_mark: | 2285 | 우체국 | | | +| 26 | :heavy_check_mark: | 8980 | 택배 | | | +| 27 | | 21313 | 문어 | | | +| 28 | | 1439 | 뒤집기 | | | +| 29 | | 17521 | Byte Coin | | | +| 30 | | 19939 | 박 터뜨리기 | | | +| 31 | | 16208 | 귀찮음 | | 바로가기 | +| 32 | | 11256 | 사탕 | | | +| 33 | | 16435 | 스네이크버드 | | 바로가기 | +| 34 | | 1817 | 짐 챙기는 숌 | | 바로가기 | +| 35 | | 12782 | 비트 우정지수 | | | +| 36 | | 2847 | 게임을 만든 동준이 | | | +| 37 | | 13413 | 오셀로 재배치 | | | +| 38 | | 16162 | 가희와 3단 고음 | | | +| 39 | | 1449 | 수리공 항승 | | | +| 40 | | 14247 | 나무 자르기 | | 바로가기 | +| 41 | | 13019 | A를 B로 | | | +| 42 | | 1080 | 행렬 | | | +| 43 | | 14400 | 편의점 2 | | | +| 44 | | 1455 | 뒤집기 II | | | +| 45 | | 2138 | 전구와 스위치 | | | +| 46 | | 1946 | 신입 사원 | | | +| 47 | | 11509 | 풍선 맞추기 | | | +| 48 | | 17615 | 볼 모으기 | | | +| 49 | | 19539 | 사과나무 | | | +| 50 | | 1474 | 밑 줄 | | | +| 51 | | 16206 | 롤케이크 | | | +| 52 | | 20117 | 호반우 상인의 이상한 품질 계산법 | | | +| 53 | | 1374 | 강의실 | | | +| 54 | | 6068 | 시간 관리하기 | | | +| 55 | | 1744 | 수 묶기 | | | +| 56 | | 2457 | 공주님의 정원 | | | +| 57 | | 1082 | 방 번호 | | | +| 58 | | 12931 | 두 배 더하기 | | | +| 59 | | 18234 | 당근 훔쳐 먹기 | | | +| 60 | | 2109 | 순회강연 | | | +| 61 | | 21925 | 짝수 팰린드롬 | | | diff --git a/greedy/header.md b/greedy/header.md new file mode 100644 index 0000000..8d27b05 --- /dev/null +++ b/greedy/header.md @@ -0,0 +1,13 @@ +# Greedy (그리디) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +쉬운 그리디부터 조금 고민을 해야하는 그리디까지 다양하게 뽑아봤습니다. + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/6833) diff --git a/greedy/list.md b/greedy/list.md new file mode 100644 index 0000000..4679b44 --- /dev/null +++ b/greedy/list.md @@ -0,0 +1,62 @@ +1,11000,./../solution/greedy/11000 +1,13164,./../solution/greedy/13164 +1,1931,./../solution/greedy/1931 +1,14916,./../solution/greedy/14916 +,1439, +,17521, +,19939, +,12782, +,16208,./../solution/greedy/16208 +,11256, +,13019, +1,2217,./../solution/greedy/2217 +1,13305,./../solution/greedy/13305 +,2847, +1,1343, +,13413, +1,1758,./../solution/greedy/1758 +,16162, +,16435,./../solution/greedy/16435 +1,11399,./../solution/greedy/11399 +,1449, +1,11508,./../solution/greedy/11508 +,1817,./../solution/greedy/1817 +1,20115,./../solution/greedy/20115 +1,20300,./../solution/greedy/20300 +,14247,./../solution/greedy/14247 +1,1541,./../solution/greedy/1541 +,1080, +,2138, +1,20365,./../solution/greedy/20365 +,14400, +1,11047, +,1946, +1,16953, +,11509, +,17615, +,19539, +,1474, +,1455, +,16206, +1,2141,./../solution/greedy/2141 +1,19598,./../solution/greedy/19598 +,20117, +1,2812,./../solution/greedy/2812 +1,2212,./../solution/greedy/2212 +1,1092, +,1374, +1,13975, +,6068, +,1744, +1,1715, +1,8980, +,2457, +,2109, +,1082, +,12931, +,18234, +1,2285, +,21313, +1,21314, +1,21758,./../solution/greedy/21758 +,21925, diff --git a/implementation/README.md b/implementation/README.md new file mode 100644 index 0000000..0ab5585 --- /dev/null +++ b/implementation/README.md @@ -0,0 +1,70 @@ +# Implementation (구현) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +추천 문제 아닌 나머지는 나머지를 난이도 섞었습니다. + +시뮬레이션 관련 문제는 시뮬레이션에 있습니다. + +(매우 [단순한 구현](https://www.acmicpc.net/problem/1000)는 추가하지 않았습니다.) + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/6783) +| 순번 | 추천 문제 | 문제 번호 | 문제 이름 | 난이도 | 풀이 링크 | +| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | +| 00 | :heavy_check_mark: | 21608 | 상어 초등학교 | | 바로가기 | +| 01 | :heavy_check_mark: | 21611 | 마법사 상어와 블리자드 | | | +| 02 | :heavy_check_mark: | 2753 | 윤년 | | 바로가기 | +| 03 | :heavy_check_mark: | 1212 | 8진수 2진수 | | 바로가기 | +| 04 | :heavy_check_mark: | 20053 | 최소, 최대 2 | | 바로가기 | +| 05 | :heavy_check_mark: | 5597 | 과제 안 내신 분..? | | 바로가기 | +| 06 | :heavy_check_mark: | 21918 | 전구 | | 바로가기 | +| 07 | :heavy_check_mark: | 20546 | 🐜 기적의 매매법 🐜 | | 바로가기 | +| 08 | :heavy_check_mark: | 14467 | 소가 길을 건너간 이유 1 | | 바로가기 | +| 09 | :heavy_check_mark: | 2578 | 빙고 | | 바로가기 | +| 10 | :heavy_check_mark: | 4396 | 지뢰 찾기 | | 바로가기 | +| 11 | :heavy_check_mark: | 1913 | 달팽이 | | 바로가기 | +| 12 | :heavy_check_mark: | 12933 | 오리 | | 바로가기 | +| 13 | :heavy_check_mark: | 1244 | 스위치 켜고 끄기 | | 바로가기 | +| 14 | :heavy_check_mark: | 10994 | 별 찍기 - 19 | | 바로가기 | +| 15 | :heavy_check_mark: | 20436 | ZOAC 3 | | 바로가기 | +| 16 | :heavy_check_mark: | 20291 | 파일 정리 | | 바로가기 | +| 17 | :heavy_check_mark: | 17413 | 단어 뒤집기 2 | | 바로가기 | +| 18 | :heavy_check_mark: | 2615 | 오목 | | | +| 19 | :heavy_check_mark: | 22858 | 원상 복구 (small) | | | +| 20 | :heavy_check_mark: | 16926 | 배열 돌리기 1 | | 바로가기 | +| 21 | :heavy_check_mark: | 15787 | 기차가 어둠을 헤치고 은하수를 | | 바로가기 | +| 22 | :heavy_check_mark: | 17276 | 배열 돌리기 | | | +| 23 | :heavy_check_mark: | 20207 | 달력 | | 바로가기 | +| 24 | :heavy_check_mark: | 20164 | 홀수 홀릭 호석 | | | +| 25 | :heavy_check_mark: | 14719 | 빗물 | | 바로가기 | +| 26 | :heavy_check_mark: | 16719 | ZOAC | | | +| 27 | :heavy_check_mark: | 22856 | 트리 순회 | | | +| 28 | :heavy_check_mark: | 22860 | 폴더 정리 (small) | | | +| 29 | :heavy_check_mark: | 22859 | HTML 파싱 | | | +| 30 | | 21756 | 지우개 | | 바로가기 | +| 31 | | 1316 | 그룹 단어 체커 | | | +| 32 | | 18311 | 왕복 | | | +| 33 | | 5766 | 할아버지는 유명해! | | | +| 34 | | 2729 | 이진수 덧셈 | | 바로가기 | +| 35 | | 10703 | 유성 | | | +| 36 | | 17128 | 소가 정보섬에 올라온 이유 | | | +| 37 | | 1283 | 단축키 지정 | | | +| 38 | | 15886 | 내 선물을 받아줘 2 | | | +| 39 | | 16935 | 배열 돌리기 3 | | 바로가기 | +| 40 | | 9934 | 완전 이진 트리 | | | +| 41 | | 2469 | 사다리 타기 | | | +| 42 | | 2877 | 4와 7 | | | +| 43 | | 9081 | 단어 맞추기 | | | +| 44 | | 16927 | 배열 돌리기 2 | | | +| 45 | | 17406 | 배열 돌리기 4 | | | +| 46 | | 1022 | 소용돌이 예쁘게 출력하기 | | | +| 47 | | 20327 | 배열 돌리기 6 | | | +| 48 | | 21277 | 짠돌이 호석 | | | +| 49 | | 15806 | 영우의 기숙사 청소 | | 바로가기 | +| 50 | | 17470 | 배열 돌리기 5 | | | diff --git a/implementation/header.md b/implementation/header.md new file mode 100644 index 0000000..64f510b --- /dev/null +++ b/implementation/header.md @@ -0,0 +1,17 @@ +# Implementation (구현) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +추천 문제 아닌 나머지는 나머지를 난이도 섞었습니다. + +시뮬레이션 관련 문제는 시뮬레이션에 있습니다. + +(매우 [단순한 구현](https://www.acmicpc.net/problem/1000)는 추가하지 않았습니다.) + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/6783) diff --git a/implementation/list.md b/implementation/list.md new file mode 100644 index 0000000..24a3003 --- /dev/null +++ b/implementation/list.md @@ -0,0 +1,51 @@ +1,1212,./../solution/implementation/1212 +1,2753,./../solution/implementation/2753 +1,20053,./../solution/implementation/20053 +1,5597,./../solution/implementation/5597 +1,20546,./../solution/implementation/20546 +,1316, +1,1913,./../solution/implementation/1913 +1,14467,./../solution/implementation/14467 +1,12933,./../solution/implementation/12933 +1,2578,./../solution/implementation/2578 +1,4396,./../solution/implementation/4396 +,18311, +1,1244,./../solution/implementation/1244 +1,10994,./../solution/implementation/10994 +,5766, +1,20291,./../solution/implementation/20291 +1,20436,./../solution/implementation/20436 +1,17413,./../solution/implementation/17413 +1,2615, +,2729,./../solution/implementation/2729 +1,17276, +1,16926,./../solution/implementation/16926 +,16927, +,16935,./../solution/implementation/16935 +,17406, +,17470, +,20327, +,17128, +,1283, +,10703, +,9934, +,2469, +,2877, +1,15787,./../solution/implementation/15787 +1,20164, +1,20207,./../solution/implementation/20207 +1,14719,./../solution/implementation/14719 +,15886, +1,16719, +,1022, +,9081, +,15806,./../solution/implementation/15806 +,21277, +2,21611, +2,21608,./../solution/implementation/21608 +,21756,./../solution/implementation/21756 +1,21918,./../solution/implementation/21918 +1,22860, +1,22859, +1,22856, +1,22858, diff --git a/markdown/TODO.md b/markdown/TODO.md new file mode 100644 index 0000000..d4533bb --- /dev/null +++ b/markdown/TODO.md @@ -0,0 +1,14 @@ + +## TODO + +
+ 자세히 + +- [x] 코드 리팩토링 +- [x] Contributors 추가 스크립트화 +- [ ] 문제 뽑으면 Discussions 또는 Issue에서 바로 간단한 명령어로 추가 기능(스크립트화) +- [x] 문제 추가 방식 변경 + +
+ + diff --git a/markdown/codingtest_info.md b/markdown/codingtest_info.md new file mode 100644 index 0000000..df14351 --- /dev/null +++ b/markdown/codingtest_info.md @@ -0,0 +1,8 @@ +## 최근 기업 코딩테스트 알고리즘 분류 정리 + +[바로가기](./CodingTest.md) + +최근 기업 코딩테스트에 나왔던 알고리즘들을 정리해보았습니다. + +대부분은 코딩테스트를 본 분들에게 들은거라 몇개가 누락되었거나 잘못된 부분이 있을 수도 있습니다. + diff --git a/markdown/contributor.json b/markdown/contributor.json new file mode 100644 index 0000000..18a53c9 --- /dev/null +++ b/markdown/contributor.json @@ -0,0 +1,169 @@ +{ + "id": [ + "tony9402", + "VSFe", + "kim1109123", + "cola314", + "nnnlog", + "inclue", + "yeonjungin", + "cpprhtn", + "seastar105", + "Dev-RubinJo", + "shjeong92", + "chj3748", + "seung-00", + "bn-tw2020", + "kjh03160", + "CoodingPenguin", + "bsm8734", + "gkgg123", + "simon-hoon", + "gusdn3477", + "rlawngus0910", + "tallua", + "kyjun719", + "chance0523", + "lms0806", + "zmrdltl", + "cieske", + "Rain3321", + "sio2whocodes", + "kang-hyuck", + "witch-factory", + "youngjun0627", + "suinj8" + ], + "tony9402": { + "githubid": "30228292", + "baekjoon": "tony9402" + }, + "VSFe": { + "githubid": "4595546", + "baekjoon": "klm03025" + }, + "kim1109123": { + "githubid": "66085474", + "baekjoon": "amsminn" + }, + "cola314": { + "githubid": "66579357", + "baekjoon": "18sht1710" + }, + "nnnlog": { + "githubid": "20399222", + "baekjoon": "chansol" + }, + "inclue": { + "githubid": "13315923", + "baekjoon": "dlstj0923" + }, + "yeonjungin": { + "githubid": "47666431", + "baekjoon": "$" + }, + "cpprhtn": { + "githubid": "63298243", + "baekjoon": "xkzl9830" + }, + "seastar105": { + "githubid": "30820469", + "baekjoon": "seastar105" + }, + "Dev-RubinJo": { + "githubid": "16368650", + "baekjoon": "jybin321" + }, + "shjeong92": { + "githubid": "75003424", + "baekjoon": "shjeong92" + }, + "chj3748": { + "githubid": "60089817", + "baekjoon": "chj3748" + }, + "seung-00": { + "githubid": "46865281", + "baekjoon": "osy0056" + }, + "bn-tw2020": { + "githubid": "66770613", + "baekjoon": "ap4o" + }, + "kjh03160": { + "githubid": "49090888", + "baekjoon": "kis03160" + }, + "CoodingPenguin": { + "githubid": "37505775", + "baekjoon": "unodostre" + }, + "bsm8734": { + "githubid": "35002768", + "baekjoon": "bsoomin8734" + }, + "gkgg123": { + "githubid": "60089810", + "baekjoon": "gkgg123" + }, + "simon-hoon": { + "githubid": "54058621", + "baekjoon": "ropeiny" + }, + "gusdn3477": { + "githubid": "46596758", + "baekjoon": "gusdn3477" + }, + "rlawngus0910": { + "githubid": "57345435", + "baekjoon": "rlawngus0910" + }, + "tallua": { + "githubid": "34978069", + "baekjoon": "tallua_y" + }, + "kyjun719": { + "githubid": "24643002", + "baekjoon": "kyj1991719" + }, + "chance0523": { + "githubid": "51807128", + "baekjoon": "samuel95" + }, + "lms0806": { + "githubid": "42136056", + "baekjoon": "lms0806" + }, + "zmrdltl": { + "githubid": "22141521", + "baekjoon": "xhdxhl" + }, + "cieske": { + "githubid": "36599490", + "baekjoon": "cieske" + }, + "Rain3321": { + "githubid": "39397110", + "baekjoon": "smw123123" + }, + "sio2whocodes": { + "githubid": "41771874", + "baekjoon": "fltcy2039" + }, + "kang-hyuck" : { + "githubid": "61424701", + "baekjoon": "bakh1" + }, + "witch-factory": { + "githubid": "51201821", + "baekjoon": "dart" + }, + "youngjun0627": { + "githubid": "57058726", + "baekjoon": "yj2221" + }, + "suinj8": { + "githubid": "90179555", + "baekjoon": "suin8" + } +} diff --git a/markdown/contributors.md b/markdown/contributors.md new file mode 100644 index 0000000..c1f6911 --- /dev/null +++ b/markdown/contributors.md @@ -0,0 +1,427 @@ +## Contributors + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ tony9402 +
+ +
+ VSFe +
+ +
+ kim1109123 +
+ +
+ cola314 +
+ +
+ nnnlog +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ inclue +
+ +
+ yeonjungin +
+ +
+ cpprhtn +
+ +
+ seastar105 +
+ +
+ Dev-RubinJo +
+ +
+ Baekjoon +
+ solved.ac +
+ PRIVATE + + +
+ Baekjoon +
+ solved.ac +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ shjeong92 +
+ +
+ chj3748 +
+ +
+ seung-00 +
+ +
+ bn-tw2020 +
+ +
+ kjh03160 +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ CoodingPenguin +
+ +
+ bsm8734 +
+ +
+ gkgg123 +
+ +
+ simon-hoon +
+ +
+ gusdn3477 +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ rlawngus0910 +
+ +
+ tallua +
+ +
+ kyjun719 +
+ +
+ chance0523 +
+ +
+ lms0806 +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ zmrdltl +
+ +
+ cieske +
+ +
+ Rain3321 +
+ +
+ sio2whocodes +
+ +
+ kang-hyuck +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ witch-factory +
+ +
+ youngjun0627 +
+ +
+ suinj8 +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ Baekjoon +
+ solved.ac +
+ +
+ Baekjoon +
+ solved.ac +
+ + diff --git a/markdown/footer.md b/markdown/footer.md new file mode 100644 index 0000000..9d10167 --- /dev/null +++ b/markdown/footer.md @@ -0,0 +1,28 @@ +[Backtracking]: ./backtracking +[Binary Search]: ./binary_search +[Data Structure]: ./data_structure +[Data Structure2]: ./data_structure2 +[Math]: ./math +[Greedy]: ./greedy +[DP1]: ./dynamic_programming_1 +[DP2]: ./dynamic_programming_2 +[MST]: ./minimum_spanning_tree +[Two Pointer]: ./two_pointer +[Topological Sorting]: ./topological_sorting +[Implementation]: ./implementation +[Graph Traversal]: ./graph_traversal +[Simulation]: ./simulation +[DFS]: ./dfs +[BFS]: ./bfs +[Brute Force]: ./brute_force +[Disjoint Set]: ./disjoint_set +[Trie]: ./trie +[TreeDP]: ./dynamic_programming_on_trees +[Shortest Path]: ./shortest_path +[Prefix Sum]: ./prefix_sum +[Divide and conquer]: ./divide_and_conquer +[String]: ./string +[Tree]: ./tree +[TODO]: https://img.shields.io/badge/-TODO-DFFD26 +[DOING]: https://img.shields.io/badge/-DOING-31AE0F +[DONE]: https://img.shields.io/badge/-DONE-0885CC diff --git a/markdown/header.md b/markdown/header.md new file mode 100644 index 0000000..e54dca8 --- /dev/null +++ b/markdown/header.md @@ -0,0 +1,20 @@ +# 코딩테스트 대비 문제집 with Baekjoon + +[![Auto Update README](https://github.com/tony9402/baekjoon/actions/workflows/auto_update.yml/badge.svg)](https://github.com/tony9402/baekjoon/actions/workflows/auto_update.yml) +[![Auto Update README](https://github.com/tony9402/baekjoon/actions/workflows/auto_solution_update.yml/badge.svg)](https://github.com/tony9402/baekjoon/actions/workflows/auto_solution_update.yml) +[![Auto Update README](https://github.com/tony9402/baekjoon/actions/workflows/auto_pick.yml/badge.svg)](https://github.com/tony9402/baekjoon/actions/workflows/auto_pick.yml) + +[![하루 방문자 수](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Ftony9402%2Fbaekjoon)](https://github.com/tony9402/baekjoon) +[![Discussions](https://img.shields.io/badge/discussions-바로가기-brightgreen)](https://github.com/tony9402/baekjoon/discussions) +[![오늘의 문제](https://img.shields.io/badge/오늘의%20문제%20%28BETA%29-바로가기-112051)](https://github.com/tony9402/baekjoon/blob/main/picked.md) +[![Contribute](https://img.shields.io/badge/집단%20지성%20프로젝트%20-바로가기-18D6A5)](https://github.com/tony9402/baekjoon/blob/main/guideline_for_contribute.md) +[![Email](https://img.shields.io/badge/문의하기-tony9402@naver.com-0182E0)](mailTo:tony9402@naver.com) + +❈ 코딩테스트을 준비하시는 분들을 위해 문제집을 만들어봤습니다. ❈ + +❗️ 주의 ❗️ + 알고리즘을 처음 공부하시는 분들은 [알고리즘 설명 링크 모음](./link_for_study.md) 등을 활용하여 알고리즘 먼저 공부하시기 바랍니다. + +이 레포는 꾸준히 업데이트를 할 예정이며 문제집 어느정도 완성 후 풀이를 Python, Java, C++ 3가지 언어를 올릴 예정입니다. +**(C++로 먼저 올릴 예정입니다.)** + diff --git a/markdown/list.md b/markdown/list.md new file mode 100644 index 0000000..c1d4ef5 --- /dev/null +++ b/markdown/list.md @@ -0,0 +1,23 @@ +data_structure,Data Structure,자료구조,Doing +data_structure2,Data Structure 2,자료구조 2,Doing +tree,Tree,트리,Doing +math,Math,수학,Doing +greedy,Greedy,탐욕법,Doing +dynamic_programming_1,Dynamic Programming 1,동적계획법 1,Doing +dynamic_programming_2,Dynamic Programming 2,동적계획법 2,Doing +two_pointer,Two Pointer,투 포인터,Doing +implementation,Implementation,구현,Doing +graph_traversal,Graph Traversal,그래프 탐색,Doing +brute_force,Brute Force,완전탐색,Doing +simulation,Simulation,시뮬레이션,Doing +binary_search,Binary Search,이분탐색,Doing +backtracking,Backtracking,백트래킹,Doing +divide_and_conquer,Divide and conquer,분할정복,Doing +prefix_sum,Prefix Sum,누적 합,Doing +string,String,문자열,Doing +shortest_path,Shortest Path,최단거리,Doing +topological_sorting,Topological Sorting,위상정렬,Doing +disjoint_set,Disjoint Set,분리 집합,Doing +minimum_spanning_tree,Minimum Spanning Tree(MST),최소 스패닝 트리,Doing +trie,Trie,트라이,Doing +dynamic_programming_on_trees,Dynamic Programming On Trees,트리디피,Doing diff --git a/markdown/tags.md b/markdown/tags.md new file mode 100644 index 0000000..e69de29 diff --git a/markdown/updatelog.md b/markdown/updatelog.md new file mode 100644 index 0000000..e923b8f --- /dev/null +++ b/markdown/updatelog.md @@ -0,0 +1,68 @@ +## 업데이트 로그 + +뽑아야 하는 문제가 많고 이를 보기 좋게 표로 정리하는 과정은 너무 노가다성이 많기 때문에 편하게 작업할 수 있도록 업데이트 하고 있습니다. + +
+ 자세히

+ + - 2021.04.28 + - [오늘의 문제](https://github.com/tony9402/baekjoon/blob/main/picked.md) 뽑히는 문제 난이도 변경 + - 이전 난이도 + - 1번 브론즈 5 ~ 실버 1 + - 2번 골드 5 ~ 골드 3 + - 3번 골드 5 ~ 골드 3 + - 4번 골드 2 ~ 골드 1 + - 변경된 난이도 + - 1번 브론즈 5 ~ 실버 3 + - 2번 실버 2 ~ 골드 4 + - 3번 실버 2 ~ 골드 4 + - 4번 골드 3 ~ 골드 1 + - 2021.04.22 ~ 2021.04.23 + - 코드 리팩토링 일부 완료 + - 나머지는 시간 날때마다 하나씩 할 예정 + - 문제 뽑는 방식 변경 + - 이전 방식에서 [새로운](https://raw.githubusercontent.com/tony9402/baekjoon/main/dynamic_programming_2/list.md) 방식으로 변경 + - 이전 방식 : [추천 문제 여부],[문제 이름],[문제 번호],[난이도],[솔루션 링크] + - 새로운 방식 : [추천 문제 여부],[문제 번호],[솔루션 링크] + - 매일 새벽에 자동으로 문제 뽑는 스크립트 제작 및 기능 추가 + - [Solved.ac](https://solved.ac/) 기준 브론즈 5 ~ 골드 1 사이인 문제가 4문제 일정 조건 안에서 랜덤하게 뽑음 + - [오늘 문제](https://github.com/tony9402/baekjoon/blob/main/picked.md) 형식으로 업데이트. + - [문제 뽑는 스크립트](https://github.com/tony9402/baekjoon/blob/main/scripts/pick_problem.cpp) + - [Contributors](https://github.com/tony9402/baekjoon#contributors) 정보 만드는 표 스크립트 제작 + - Contributor 정보만 [여기](https://github.com/tony9402/baekjoon/blob/main/markdown/contributor.json)에 넣으면 자동으로 표를 생성 + + - 2021.04.20 + - [tree](./tree) 태그 추가 + - 트리와 관련된 문제 뽑았습니다. + - [Contributors](https://github.com/tony9402/baekjoon#contributors) 디자인을 변경하였습니다. + - [문제집](https://www.acmicpc.net/workbook/by/tony9402) 전체를 업데이트 하였습니다. + - 각 문제집에 문제 번호를 볼 수 있도록 추가하였고 문제 번호로도 백준으로 이동할 수 있도록 업데이트 했습니다. + + - 2021.04.03 + - [discussions](https://github.com/tony9402/baekjoon/discussions) 추가 + + - 2021.04.02 + - [README.md](https://github.com/tony9402/baekjoon/blob/main/README.md) 자동 생성 스크립트 제작 + - 각 알고리즘 문제는 자동으로 추가되고 [status.md](https://github.com/tony9402/baekjoon/blob/main/status.md)에 자동으로 카운팅되지만 README.md에서는 안되는 현상 발견하여 해결 + - 알고리즘 문제 제목 틀린거 자동으로 찾아 수정 + - 일정 주기마다 알고리즘 난이도 갱신 + - 문제 정보를 담는 json을 만듦 + + - 2021.03.31 + - [Github Actions](https://github.com/tony9402/baekjoon/actions) 도입 + - [solved](http://solved.ac)의 난이도 변경을 일정 시간마다 체크하여 자동 업데이트 (백준 문제집은 X) + - 난이도 변경은 [로그](https://github.com/tony9402/baekjoon/blob/main/change_level.log)로 남겨놓음 + - 솔루션 파일만 폴더 형식에만 맞추면 알아서 README 업데이트(솔루션 링크 연결 등) + + - 2021.03.27 + - README.md 업데이트를 더더욱 자동화를 위해 README.md 위에 설명 부분을 header.md로 분리 + + - 2021.03.15 + - 추천 문제 [solution](https://github.com/tony9402/baekjoon/tree/main/solution) (C++ 기준) 완성도 정리하는 스크립트 생성 + + - 2021.01.15 + - 문제 [이렇게](https://raw.githubusercontent.com/tony9402/baekjoon/main/math/list.md) 뽑으면 자동으로 markdown 테이블을 만들어주는 스크립트 제작 + +

+ + diff --git a/markdown/workbook.md b/markdown/workbook.md new file mode 100644 index 0000000..9939b01 --- /dev/null +++ b/markdown/workbook.md @@ -0,0 +1,29 @@ +| 순번 | Tag | 태그 | 문제집 | 추천 문제 수 | 총 문제 수 | 상태 | +| :--: | :--------------------------: | :-----------------: | :------: | :---------: | :------: |:---------------:| +| 00 | Data Structure | 자료구조 | [바로가기](./data_structure) | 16 | 25 | ![status][Doing] | +| 01 | Data Structure 2 | 자료구조 2 | [바로가기](./data_structure2) | 11 | 21 | ![status][Doing] | +| 02 | Tree | 트리 | [바로가기](./tree) | 15 | 44 | ![status][Doing] | +| 03 | Math | 수학 | [바로가기](./math) | 18 | 29 | ![status][Doing] | +| 04 | Greedy | 탐욕법 | [바로가기](./greedy) | 27 | 62 | ![status][Doing] | +| 05 | Dynamic Programming 1 | 동적계획법 1 | [바로가기](./dynamic_programming_1) | 27 | 80 | ![status][Doing] | +| 06 | Dynamic Programming 2 | 동적계획법 2 | [바로가기](./dynamic_programming_2) | 28 | 81 | ![status][Doing] | +| 07 | Two Pointer | 투 포인터 | [바로가기](./two_pointer) | 13 | 36 | ![status][Doing] | +| 08 | Implementation | 구현 | [바로가기](./implementation) | 30 | 51 | ![status][Doing] | +| 09 | Graph Traversal | 그래프 탐색 | [바로가기](./graph_traversal) | 31 | 96 | ![status][Doing] | +| 10 | Brute Force | 완전탐색 | [바로가기](./brute_force) | 33 | 94 | ![status][Doing] | +| 11 | Simulation | 시뮬레이션 | [바로가기](./simulation) | 30 | 48 | ![status][Doing] | +| 12 | Binary Search | 이분탐색 | [바로가기](./binary_search) | 20 | 66 | ![status][Doing] | +| 13 | Backtracking | 백트래킹 | [바로가기](./backtracking) | 28 | 75 | ![status][Doing] | +| 14 | Divide and conquer | 분할정복 | [바로가기](./divide_and_conquer) | 08 | 18 | ![status][Doing] | +| 15 | Prefix Sum | 누적 합 | [바로가기](./prefix_sum) | 11 | 32 | ![status][Doing] | +| 16 | String | 문자열 | [바로가기](./string) | 19 | 64 | ![status][Doing] | +| 17 | Shortest Path | 최단거리 | [바로가기](./shortest_path) | 18 | 53 | ![status][Doing] | +| 18 | Topological Sorting | 위상정렬 | [바로가기](./topological_sorting) | 05 | 14 | ![status][Doing] | +| 19 | Disjoint Set | 분리 집합 | [바로가기](./disjoint_set) | 06 | 20 | ![status][Doing] | +| 20 | Minimum Spanning Tree(MST) | 최소 스패닝 트리 | [바로가기](./minimum_spanning_tree) | 08 | 24 | ![status][Doing] | +| 21 | Trie | 트라이 | [바로가기](./trie) | 05 | 09 | ![status][Doing] | +| 22 | Dynamic Programming On Trees | 트리디피 | [바로가기](./dynamic_programming_on_trees) | 04 | 08 | ![status][Doing] | + + + + \ No newline at end of file diff --git a/markdown/workbook_footer.md b/markdown/workbook_footer.md new file mode 100644 index 0000000..0dcddb3 --- /dev/null +++ b/markdown/workbook_footer.md @@ -0,0 +1,12 @@ + +[현재 진행정도](./status.md) + +

+## 모의 문제집 + +***이 문제는 알고리즘 분류와 관련 없이 문제를 뽑아놓은 문제입니다.*** + +**이 부분은 [오늘의 문제](https://github.com/tony9402/baekjoon/blob/main/picked.md)로 대체합니다** + + +

diff --git a/markdown/workbook_header.md b/markdown/workbook_header.md new file mode 100644 index 0000000..442bc25 --- /dev/null +++ b/markdown/workbook_header.md @@ -0,0 +1,15 @@ +## 각 알고리즘 문제집 + +**❗️❗️순번은 알고리즘 공부 순서와는 무관합니다.❗️❗️** + +여기에서는 각 알고리즘 개념을 설명하는 것이 없습니다. [알고리즘 설명 링크 모음](./link_for_study.md) + +문제 뽑은 기준 : 각 태그에 해당하는 문제(코딩 테스트에 나올 정도) 들을 최대한 많이 뽑고 반드시 풀고 넘어가면 좋은 문제를 체크해놨습니다. + +### **❈ 중요❗️❗️ ❈** + +이 레포는 **코딩테스트에 나올만한 유형**에 대한 문제를 모았습니다. +알고리즘 유형이 회사마다 다릅니다. 따라서 아래 알고리즘들을 꼭 다 안풀어도 됩니다. +지원하시는 회사에 나오는 **유형에 맞춰** 골라 푸시기 바랍니다. +(문제집에도 추천 문제도 골라 푸셔도 됩니다.) + diff --git a/math/README.md b/math/README.md new file mode 100644 index 0000000..25cb4ac --- /dev/null +++ b/math/README.md @@ -0,0 +1,46 @@ +# Math (수학) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +현재 단계는 기초 수학을 익히는 문제들로 뽑았습니다. + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +추천 문제 아닌 나머지는 나머지를 난이도 섞었습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/6781) +| 순번 | 추천 문제 | 문제 번호 | 문제 이름 | 난이도 | 풀이 링크 | +| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | +| 00 | :heavy_check_mark: | 5618 | 공약수 | | 바로가기 | +| 01 | :heavy_check_mark: | 22864 | 피로도 | | 바로가기 | +| 02 | :heavy_check_mark: | 2745 | 진법 변환 | | 바로가기 | +| 03 | :heavy_check_mark: | 1110 | 더하기 사이클 | | 바로가기 | +| 04 | :heavy_check_mark: | 2609 | 최대공약수와 최소공배수 | | 바로가기 | +| 05 | :heavy_check_mark: | 1934 | 최소공배수 | | 바로가기 | +| 06 | :heavy_check_mark: | 2581 | 소수 | | 바로가기 | +| 07 | :heavy_check_mark: | 11653 | 소인수분해 | | 바로가기 | +| 08 | :heavy_check_mark: | 1978 | 소수 찾기 | | 바로가기 | +| 09 | :heavy_check_mark: | 2960 | 에라토스테네스의 체 | | 바로가기 | +| 10 | :heavy_check_mark: | 5347 | LCM | | 바로가기 | +| 11 | :heavy_check_mark: | 4134 | 다음 소수 | | 바로가기 | +| 12 | :heavy_check_mark: | 21920 | 서로소 평균 | | 바로가기 | +| 13 | :heavy_check_mark: | 9613 | GCD 합 | | 바로가기 | +| 14 | :heavy_check_mark: | 21275 | 폰 호석만 | | 바로가기 | +| 15 | :heavy_check_mark: | 21919 | 소수 최소 공배수 | | 바로가기 | +| 16 | :heavy_check_mark: | 22943 | | | | +| 17 | :heavy_check_mark: | 1747 | 소수&팰린드롬 | | 바로가기 | +| 18 | | 21312 | 홀짝 칵테일 | | 바로가기 | +| 19 | | 2553 | 마지막 팩토리얼 수 | | | +| 20 | | 1456 | 거의 소수 | | | +| 21 | | 2168 | 타일 위의 대각선 | | | +| 22 | | 9421 | 소수상근수 | | | +| 23 | | 1669 | 멍멍이 쓰다듬기 | | | +| 24 | | 1990 | 소수인팰린드롬 | | 바로가기 | +| 25 | | 3343 | 장미 | | | +| 26 | | 2436 | 공약수 | | | +| 27 | | 1188 | 음식 평론가 | | | +| 28 | | 2824 | 최대공약수 | | | diff --git a/math/header.md b/math/header.md new file mode 100644 index 0000000..5fdfee7 --- /dev/null +++ b/math/header.md @@ -0,0 +1,15 @@ +# Math (수학) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +현재 단계는 기초 수학을 익히는 문제들로 뽑았습니다. + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +추천 문제 아닌 나머지는 나머지를 난이도 섞었습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/6781) diff --git a/math/list.md b/math/list.md new file mode 100644 index 0000000..523d210 --- /dev/null +++ b/math/list.md @@ -0,0 +1,29 @@ +1,1978,./../solution/math/1978 +1,2609,./../solution/math/2609 +1,1934,./../solution/math/1934 +1,2581,./../solution/math/2581 +1,11653,./../solution/math/11653 +1,2960,./../solution/math/2960 +1,9613,./../solution/math/9613 +1,5347,./../solution/math/5347 +1,4134,./../solution/math/4134 +1,1110,./../solution/math/1110 +1,5618,./../solution/math/5618 +1,2745,./../solution/math/2745 +1,21275,./../solution/math/21275 +,1456, +,2168, +,9421, +,1669, +,1990,./../solution/math/1990 +,3343, +1,1747,./../solution/math/1747 +,2436, +,1188, +,2824, +,2553, +,21312,./../solution/math/21312 +1,21920,./../solution/math/21920 +1,21919,./../solution/math/21919 +1,22864,./../solution/math/22864 +1,22943, diff --git a/minimum_spanning_tree/README.md b/minimum_spanning_tree/README.md new file mode 100644 index 0000000..2ab386e --- /dev/null +++ b/minimum_spanning_tree/README.md @@ -0,0 +1,39 @@ +# Minimum Spanning Tree (최소 스패닝 트리) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +최소 스패닝 트리 문제를 뽑아봤습니다. + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/7175) +| 순번 | 추천 문제 | 문제 번호 | 문제 이름 | 난이도 | 풀이 링크 | +| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | +| 00 | :heavy_check_mark: | 1197 | 최소 스패닝 트리 | | 바로가기 | +| 01 | :heavy_check_mark: | 1922 | 네트워크 연결 | | 바로가기 | +| 02 | :heavy_check_mark: | 1647 | 도시 분할 계획 | | 바로가기 | +| 03 | :heavy_check_mark: | 16398 | 행성 연결 | | 바로가기 | +| 04 | :heavy_check_mark: | 21924 | 도시 건설 | | 바로가기 | +| 05 | :heavy_check_mark: | 1774 | 우주신과의 교감 | | 바로가기 | +| 06 | :heavy_check_mark: | 14621 | 나만 안되는 연애 | | 바로가기 | +| 07 | :heavy_check_mark: | 1368 | 물대기 | | 바로가기 | +| 08 | | 4386 | 별자리 만들기 | | 바로가기 | +| 09 | | 6497 | 전력난 | | 바로가기 | +| 10 | | 13905 | 세부 | | | +| 11 | | 16202 | MST 게임 | | | +| 12 | | 18769 | 그리드 네트워크 | | | +| 13 | | 13418 | 학교 탐방하기 | | | +| 14 | | 14950 | 정복자 | | | +| 15 | | 2406 | 안정적인 네트워크 | | | +| 16 | | 17490 | 일감호에 다리 놓기 | | | +| 17 | | 17472 | 다리 만들기 2 | | | +| 18 | | 1944 | 복제 로봇 | | | +| 19 | | 10423 | 전기가 부족해 | | | +| 20 | | 20010 | 악덕 영주 혜유 | | 바로가기 | +| 21 | | 1414 | 불우이웃돕기 | | | +| 22 | | 2887 | 행성 터널 | | 바로가기 | +| 23 | | 1045 | 도로 | | | diff --git a/minimum_spanning_tree/header.md b/minimum_spanning_tree/header.md new file mode 100644 index 0000000..d1805fe --- /dev/null +++ b/minimum_spanning_tree/header.md @@ -0,0 +1,13 @@ +# Minimum Spanning Tree (최소 스패닝 트리) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +최소 스패닝 트리 문제를 뽑아봤습니다. + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/7175) diff --git a/minimum_spanning_tree/list.md b/minimum_spanning_tree/list.md new file mode 100644 index 0000000..4fd4d05 --- /dev/null +++ b/minimum_spanning_tree/list.md @@ -0,0 +1,24 @@ +1,1197,./../solution/minimum_spanning_tree/1197 +1,1922,./../solution/minimum_spanning_tree/1922 +1,1647,./../solution/minimum_spanning_tree/1647 +,4386,./../solution/minimum_spanning_tree/4386 +,6497,./../solution/minimum_spanning_tree/6497 +1,1774,./../solution/minimum_spanning_tree/1774 +1,16398,./../solution/minimum_spanning_tree/16398 +,13905, +,16202, +,18769, +,17472, +,13418, +1,14621,./../solution/minimum_spanning_tree/14621 +,14950, +,2406, +,17490, +,2887,./../solution/minimum_spanning_tree/2887 +,1944, +,10423, +1,1368,./../solution/minimum_spanning_tree/1368 +,20010,./../solution/minimum_spanning_tree/20010 +,1414, +,1045, +1,21924,./../solution/minimum_spanning_tree/21924 diff --git a/prefix_sum/README.md b/prefix_sum/README.md new file mode 100644 index 0000000..67e8173 --- /dev/null +++ b/prefix_sum/README.md @@ -0,0 +1,49 @@ +# Prefix Sum (누적 합) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +추천 문제 아닌 나머지는 나머지를 난이도 섞었습니다. + +누적합은 단순히 이 알고리즘만 사용하는 문제보다 누적합과 다른 알고리즘을 섞어 쓰는 경우가 많습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/7274) +| 순번 | 추천 문제 | 문제 번호 | 문제 이름 | 난이도 | 풀이 링크 | +| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | +| 00 | :heavy_check_mark: | 14929 | 귀찮아 (SIB) | | 바로가기 | +| 01 | :heavy_check_mark: | 2167 | 2차원 배열의 합 | | 바로가기 | +| 02 | :heavy_check_mark: | 20438 | 출석체크 | | 바로가기 | +| 03 | :heavy_check_mark: | 11660 | 구간 합 구하기 5 | | 바로가기 | +| 04 | :heavy_check_mark: | 21318 | 피아노 체조 | | 바로가기 | +| 05 | :heavy_check_mark: | 2015 | 수들의 합 4 | | 바로가기 | +| 06 | :heavy_check_mark: | 1749 | 점수따먹기 | | 바로가기 | +| 07 | :heavy_check_mark: | 20440 | 🎵니가 싫어 싫어 너무 싫어 싫어 오지 마 내게 찝쩍대지마🎵 - 1 | | 바로가기 | +| 08 | :heavy_check_mark: | 10986 | 나머지 합 | | 바로가기 | +| 09 | :heavy_check_mark: | 21757 | 나누기 | | 바로가기 | +| 10 | :heavy_check_mark: | 20543 | 폭탄 던지는 태영이 | | 바로가기 | +| 11 | | 20116 | 상자의 균형 | | | +| 12 | | 11659 | 구간 합 구하기 4 | | 바로가기 | +| 13 | | 11441 | 합 구하기 | | | +| 14 | | 17390 | 이건 꼭 풀어야 해! | | | +| 15 | | 16139 | 인간-컴퓨터 상호작용 | | | +| 16 | | 17123 | 배열 놀이 | | | +| 17 | | 16507 | 어두운 건 무서워 | | | +| 18 | | 19951 | 태상이의 훈련소 생활 | | | +| 19 | | 10427 | | | | +| 20 | | 10713 | 기차 여행 | | | +| 21 | | 20002 | 사과나무 | | | +| 22 | | 20159 | 동작 그만. 밑장 빼기냐? | | | +| 23 | | 18866 | 젊은 날의 생이여 | | | +| 24 | | 5549 | 행성 탐사 | | | +| 25 | | 2571 | 색종이 - 3 | | | +| 26 | | 3673 | 나눌 수 있는 부분 수열 | | | +| 27 | | 5875 | 오타 | | | +| 28 | | 16971 | 배열 B의 값 | | 바로가기 | +| 29 | | 14476 | 최대공약수 하나 빼기 | | | +| 30 | | 19566 | 수열의 구간 평균 | | | +| 31 | | 2900 | 프로그램 | | | diff --git a/prefix_sum/header.md b/prefix_sum/header.md new file mode 100644 index 0000000..345ce3f --- /dev/null +++ b/prefix_sum/header.md @@ -0,0 +1,15 @@ +# Prefix Sum (누적 합) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +추천 문제 아닌 나머지는 나머지를 난이도 섞었습니다. + +누적합은 단순히 이 알고리즘만 사용하는 문제보다 누적합과 다른 알고리즘을 섞어 쓰는 경우가 많습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/7274) diff --git a/prefix_sum/list.md b/prefix_sum/list.md new file mode 100644 index 0000000..6373399 --- /dev/null +++ b/prefix_sum/list.md @@ -0,0 +1,32 @@ +1,14929,./../solution/prefix_sum/14929 +1,2167,./../solution/prefix_sum/2167 +,20116, +,11659,./../solution/prefix_sum/11659 +,11441, +,17390, +,16139, +1,20438,./../solution/prefix_sum/20438 +,17123, +1,11660,./../solution/prefix_sum/11660 +,16507, +,19951, +,10427, +1,2015,./../solution/prefix_sum/2015 +,10713, +,20002, +,20159, +,18866, +1,10986,./../solution/prefix_sum/10986 +,5549, +,2571, +1,1749,./../solution/prefix_sum/1749 +1,20440,./../solution/prefix_sum/20440 +,3673, +,5875, +,14476, +,19566, +,16971,./../solution/prefix_sum/16971 +,2900, +1,20543,./../solution/prefix_sum/20543 +1,21318,./../solution/prefix_sum/21318 +1,21757,./../solution/prefix_sum/21757 diff --git a/scripts/API.py b/scripts/API.py new file mode 100644 index 0000000..8d85337 --- /dev/null +++ b/scripts/API.py @@ -0,0 +1,224 @@ +from urllib import request +import ssl +import json +import atexit +import time +import datetime +import pytz + +# ProblemId : [str] 문제 번호 +# ProblemName : [str] 문제 이름 +# ProblemTier : [int] 문제 난이도 (SolvedAC) +# lastupdate : [float] 업데이트 로그 (ex 1618947707.736831 [minute]) + +def changeLevel(level): + ALPHA = [ 'B', 'S', 'G', 'P', 'D', 'R' ] + level -= 1 + return f"{ALPHA[level // 5]}{5 - level % 5}" + + +# Database + request +class SolvedAPI: + def __init__(self, config): + assert type(config) == dict + self.ssl_context = ssl._create_unverified_context() + self.config = config + self.database = dict() + self.changeLevelLog = list() + + # Load Database + self.__load_database() + self.__all_update() + + # For saving Database + atexit.register(self.__save_database) + atexit.register(self.__save_change_log) + + def __all_update(self): + problemList = list() + problemIds = list(self.database.keys()) + L = 0 + R = 100 + N = len(problemIds) + + while L < N: + Ids = problemIds[L : R] + L += 100 + R += 100 + R = min(R, N) + + # 임시, 반드시 업데이트 해야함. + URL = f"https://solved.ac/api/v3/problem/lookup?problemIds={','.join(Ids)}" + req = request.Request(URL, headers = {'User-Agent': 'Mozilla/5.0'}) + response = request.urlopen(req, context=self.ssl_context) + try: + JSON = json.loads(response.read().decode(self.config.get('encoding'))) + except: + assert False, "[*** API Error] Failed" + + for INFO in JSON: + data = { + "problemId": str(INFO.get('problemId')), # int -> str + "problemLevel": INFO.get('level'), + "problemName": INFO.get('titleKo'), + "average_try": INFO.get('averageTries'), + "solvedtags": list() + } + + for tag in INFO.get('tags', [ ]): + solvedtags = dict() + for config_tags in self.config.get('solvedtags'): + solvedtags[ config_tags ] = tag[ config_tags ] + data['solvedtags'].append(solvedtags) + self.saveInformation(data) + + def __save_change_log(self): + + if len(self.changeLevelLog) == 0: + return + + self.changeLevelLog.append('##############################\n') + with open("./change_level.log", "a+") as f: + f.writelines(self.changeLevelLog) + f.close() + + def __load_database(self): + option = "database" + File = self.config.get(option) + + # Must Be str (string) + assert type(File) == str, f"[*** Config Error] Not Found {option}, Check config.json" + + with open(File, 'r') as f: + self.database = json.load(f) + f.close() + + def __save_database(self): + option = "database" + File = self.config.get(option) + + # Must Be str (string) + assert type(File) == str, f"[*** Config Error] Not Found {option}, Check config.json" + + with open(File, 'w') as f: + f.write(json.dumps(self.database, indent=4, ensure_ascii=False)) + f.close() + + # using SolvedAPI + def __request(self, problemId): + URL = f"{self.config['targeturl']}/{self.config['route']['problemid']}{problemId}" + req = request.Request(URL, headers={'User-Agent': 'Mozilla/5.0'}) + response = request.urlopen(req, context=self.ssl_context) + try: + JSON = json.loads(response.read().decode(self.config.get('encoding'))) + except: + assert False, "[*** API Error] Failed" + INFO = JSON + + data = { + "problemId": str(INFO.get('problemId')), # int -> str + "problemLevel": INFO.get('level'), + "problemName": INFO.get('titleKo'), + "average_try": INFO.get('averageTries'), + "solvedtags": list() + } + + for tag in INFO.get('tags', [ ]): + solvedtags = dict() + for config_tags in self.config.get('solvedtags'): + solvedtags[ config_tags ] = tag[ config_tags ] + data['solvedtags'].append(solvedtags) + + return data + + # lazy update + def request(self, problemId): + + if type(problemId) == int: + problemId = str(problemId) + + # Check problemId Type + assert type(problemId) == str, f"[*** Type Error] problemId type is {type(problemId)}.\n It must be string" + + # information : (in database) + exist, information = self.getProblemInformation(problemId) + if exist: + lastupdate = information.get('lastupdate', 0.0) + + assert type(lastupdate) == float, "[*** Type Error] lastupdate type is {type(lastupdate)}.\n It must be float" + + timestamp = datetime.datetime.now(pytz.timezone('Asia/Seoul')).timestamp() + if lastupdate + self.config.get('update') > timestamp: + return information + + # update + newData = self.__request(problemId) + self.saveInformation(newData) + return newData + + # update force + def requestForce(self, problemId): + + if type(problemId) == int: + problemId = str(problemId) + + # Check ProblemId Type + assert type(problemId) == str, f"[*** Type Error] problemId type is {type(ProblemId)}.\n It must be string" + # newData = self.__request(problemId) + newData = self.request(problemId) + + exist, information = self.getProblemInformation(problemId) + + update = False + updateLog = "" + if exist: + beforeLevel = information.get('problemLevel') + newLevel = newData.get('problemLevel') + if beforeLevel != newLevel: + updateLog = f"[{problemId}] {changeLevel(beforeLevel)} -> {changeLevel(newLevel)} https://www.acmicpc.net/problem/{problemId}" + update = True + else: + updateLog = f"[{problemId}] Not Exist -> {changeLevel(newLevel)} https://www.acmicpc.net/problem/{problemId}" + update = True + + if update: + self.changeLevelLog.append(f"{updateLog}\n") + + self.saveInformation(newData) + return newData + + def getProblemInformation(self, problemId): + + if type(problemId) == int: + problemId = str(problemId) + + # Check Database + assert type(problemId) == str, f"[*** Type Error] problemId type is {type(problemId)}.\n It must be string" + + if not problemId in self.database.keys(): + return False, dict() + + return True, self.database.get(problemId) + + def saveInformation(self, data): + + # Check data type + assert type(data) == dict, f"[*** Type Error] data type is {type(data)}.\n It must be dict" + + timestamp = datetime.datetime.now(pytz.timezone('Asia/Seoul')).timestamp() + data['lastupdate'] = timestamp + problemId = data.get('problemId') + + if problemId in self.database.keys(): + del self.database[problemId] + self.database.update({problemId: data}) + +# Example +if __name__=="__main__": + config = dict() + with open("config.json", "r") as f: + config = json.load(f) + f.close() + api = SolvedAPI(config.get("API")) + data = api.request('1001') + api.saveInformation(data) diff --git a/scripts/arrange.py b/scripts/arrange.py new file mode 100644 index 0000000..4888568 --- /dev/null +++ b/scripts/arrange.py @@ -0,0 +1,132 @@ +# python3 arrange.py > status.md +# 리팩토링 해야함 + +import subprocess as sp +import os +import time + +EXCEPT_FOLDER = [ 'solution', '.git', 'solutions', '.github', '__pycache__', 'markdown', 'scripts', 'assets'] + +def getProblem(Dir): + ret = list() + with open(f"{Dir}/list.md", 'r') as f: + ret = f.readlines() + f.close() + return ret + +def Assemble(*args): + problems = set() + for i in args: + for problem in i: + problemID = problem.split(',')[-2] + problems.add(problemID) + return problems + +def Status(tags, *args): # Problems, Folders + for idx, problems in enumerate(args): + print(f"| {idx:02d} | [{tags[idx]}](./../../tree/main/{tags[idx]}) | ", end='') + totalProblem = 0 # Only ✔️ + hasEditoral = 0 + for problem in problems: + info = problem.split(',') + + rec = info[0].strip() + link = info[-1].strip() + if not link == '' and not rec == '': + hasEditoral += 1 + if not rec == '': + totalProblem += 1 + + if totalProblem == 0: # Except 0 / 0 + totalProblem = 1 # Make 0 / 1 + + # https://img.shields.io/badge/-{1}-31AE0F + # DFFD26 0885CC + percent = hasEditoral / totalProblem * 100. + color = "DFFD26" + + if percent == 100.0: + color = "0885CC" + elif percent != 0.0: + color = "31AE0F" + + print(f"{totalProblem - hasEditoral} |", end='') + print(f"![status](https://img.shields.io/badge/-{percent:.2f}%25-{color}) | ") + +def getTier(Str): + if len(Str) == 2: # Ex p2, P2... + return Str.upper() + else: # Gold5... + return Str[0].upper() + Str[-1] + +def getRecommend(*args): + ret = list() # Not Set, Get Problem Info (ProblemID, Problem Name, Tier) + for i in args: + for problem in i: + info = problem.split(",") + rec = info[0].strip() + if not rec == '': + ret.append(info[-2]) + return ret + +# Clean Code 생각 X +# TODO +def calPercentageOfRec(*args): + total = 0 + hasSolution = 0 + + for i in args: + for problem in i: + info = problem.split(",") + rec = info[0].strip() + link = info[-1].strip() + if rec == '': + continue + total += 1 + + if not link == '': + hasSolution += 1 + + return total - hasSolution, float(hasSolution) / total * 100 + + +# Get Folders +Folders = sorted([ _ for _ in os.listdir('./') if os.path.isdir(_) and not _ in EXCEPT_FOLDER and not _.startswith('.') ]) +Problems = [ getProblem(_) for _ in Folders ] +TotalProblem = Assemble(*Problems) + +# getStatus(Folders, *Problems) +Recommend_List = getRecommend(*Problems) + +print("""# Status + +간단하게 파이썬으로 진행사항 및 문제 수를 알아보기 위해 만들어 보았습니다. + + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + + +""") + +print(f"총 문제 수 : {len(TotalProblem)} ") +print(f"총 추천 문제 수 : {len(Recommend_List)} ({len(Recommend_List) / len(TotalProblem) * 100. :.2f}%) ") +print(f"알고리즘 Tag 개수 : {len(Folders)} ") +print("\n") # lnln + +print("
") +_a, _b = calPercentageOfRec(*Problems) +print(f"각 알고리즘 Tag 진행 사항 (Tag는 사전순) {_b:.2f}%

\n") +print(f"남은 문제 수 {_a}/{len(Recommend_List)}\n") + +# Make Table (Markdown) + +print("| Index | Tag(Folder Name) | 남은 문제 수 | Solution 진행도 |") +print("| :--: | :--------------- | :----------: | :------------: |") +Status(Folders, *Problems) + +import datetime +import pytz + +timeformat = datetime.datetime.now(pytz.timezone('Asia/Seoul')) + +print(f"\n\n**실행한 날짜(log) : {timeformat.strftime('%Y/%m/%d %H:%M:%S %Z')}**") diff --git a/scripts/auto_update.py b/scripts/auto_update.py new file mode 100644 index 0000000..ca0cb70 --- /dev/null +++ b/scripts/auto_update.py @@ -0,0 +1,121 @@ +from API import SolvedAPI +from make_table import Table +import json +import argparse +import os + +config = dict() +solution_list = dict() +changeLevel_list = list() +api = None +table = None + +def getFolder(path, EXCEPT=list()): + return [ folder for folder in os.listdir(path) \ + if os.path.isdir(f"{path}/{folder}") and folder not in EXCEPT ] + +# New Problem Update +def updateProblems(): + print("update start") + table.run() + print("update end") + +# Solution Update +def updateSolution(): + rootFolder = "./solution" + tagFolder = getFolder(rootFolder) # in ./solution + for tag in tagFolder: + solution_list[tag] = set() + problemPath = f"{rootFolder}/{tag}" + problems = getFolder(problemPath) + for problem in problems: + solution_list[tag].add(problem) + +# List.md 정리 (Solution Link) +def updateList(): + solutionRPATH = "./../solution" + rootFolder = "./" + tagFolder = config.get('tags') + for tag in tagFolder: + currentPath = f"{rootFolder}/{tag}" + INFO = None + + with open(f"{currentPath}/list.md", 'r') as f: + INFO = f.readlines() + f.close() + + update = False + NEWINFO = list() + for line in INFO: + split_line = line.split(",") + problemId = split_line[-2] + + if tag in solution_list and problemId in solution_list[tag]: + split_line[-1] = f"{solutionRPATH}/{tag}/{problemId}\n" + update = True + + line = ",".join(split_line) + NEWINFO.append(line) + + if update: + with open(f"{currentPath}/list.md", 'w') as f: + f.writelines(NEWINFO) + f.close() + +def updateStatus(): + os.system('python3 ./scripts/arrange.py > status.md') + +def updateLevel(): + table.run(force = True) + +if __name__=="__main__": + + # Read Config + with open('./scripts/config.json', 'r') as f: + config = json.load(f) + f.close() + + api = SolvedAPI(config.get('API')) + table = Table(api, config) + + parser = argparse.ArgumentParser('Auto Update') + arg = parser.add_argument + + arg('--all', dest='updateAll', action='store_true') + parser.set_defaults(updateAll=False) + + arg('--solution', dest='updateSolution', action='store_true') + parser.set_defaults(updateSolution=False) + + arg('--level', dest='updateLevel', action='store_true') + parser.set_defaults(updateLevel=False) + + arg('--problem-update', dest='updateProblem', action='store_true') + parser.set_defaults(updateProblem=False) + + arg('--push', dest='pushEvent', action='store_true') + parser.set_defaults(pushEvent=False) + + + args = parser.parse_args() + + print("START") + + if args.pushEvent: + args.updateSolution = True + args.updateProblem = True + + if args.pushEvent or args.updateAll or args.updateSolution: + os.system('python3 ./scripts/make_main_readme.py') + + if args.updateAll or args.updateLevel: + updateLevel() + + if args.updateAll or args.updateSolution: + updateSolution() + updateList() + + if args.updateProblem: + updateProblems() + + updateStatus() diff --git a/scripts/check_pull_request.py b/scripts/check_pull_request.py new file mode 100644 index 0000000..8d08e8f --- /dev/null +++ b/scripts/check_pull_request.py @@ -0,0 +1,145 @@ +import os +import sys +import subprocess +import argparse +from bs4 import BeautifulSoup as bs +import requests + +EXTENSION = [("py", "python", "main"), ("cpp", "cpp", "main"), ("java", "java", "Main")] + +def run(command): + ret = subprocess.check_output(command, shell=True).decode('utf8') + return ret + +def load_arg(): + parser = argparse.ArgumentParser() + arg = parser.add_argument + arg('--pr_number', type=int, help="Pull Request Number") + arg('--check_solution', action='store_true') + parser.set_defaults(check_solution=False) + return parser.parse_args() + +def check_alreay_exist_solution(path): + if os.path.exists(path): + raise Exception("Alread Exists Solution") + + print("It is a new Solution!!") + +def get_pr_file(pr_number): + run(f"git fetch origin +refs/pull/{pr_number}/merge") + files = run(f"git --no-pager diff --name-only FETCH_HEAD $(git merge-base FETCH_HEAD main)") + files = [file.strip() for file in files.split() if file.strip() != ""] + + if len(files) != 1: + raise Exception("No 1 PR 1 Solution") + + return files[0] + +def get_solution_language(path): + filename, extension = path.split('/')[-1].split('.') + for info in EXTENSION: + if info[0] == extension: + if filename == info[2]: + print(f"Found {info[1]} Language") + return info[1] + else: + raise Exception(f"Wrong File name {filename}") + + raise Exception(f"No Found {extension} Language") + +def detect_tab(path): + with open(path, 'r') as f: + solution = f.readlines() + f.close() + + for line in solution: + if '\t' in line: + raise Exception("Detected Tab in this solution") + + print("No Detect Tab") + +def get_example(problem_id): + url = f"https://www.acmicpc.net/problem/{problem_id}" + req = requests.get(url) + html = bs(req.text, 'html.parser') + spj = True if html.find('span', 'problem-label-spj') else False + + if spj: + print("Found Special Judge") + + examples = [] + + try: + sample_id = 1 + while True: + sample_input = html.select(f'#sample-input-{sample_id}')[0].text + sample_output = html.select(f'#sample-output-{sample_id}')[0].text + examples.append((sample_input, sample_output)) + sample_id += 1 + except: + pass + return spj, examples + +def compile_test(path): + try: + extension = get_solution_language(path) + if extension == 'cpp': + run(f"g++ -std=c++17 {path} -o Main") + elif extension == 'java': + run(f"javac {path} -d .") + except: + raise RuntimeError("Compile Error") + + return extension + +def judge_test(path): + detect_tab(path) + problem = path.split('/')[-2] + spj, samples = get_example(problem) + + extension = compile_test(path) + + print(f"Found {len(samples)} examples in {problem} problem") + + for idx, (data_input, data_output) in enumerate(samples): + with open("example.in", 'w') as f: + f.write(data_input) + f.close() + + try: + if extension == 'cpp': + result = run(f"./Main < example.in") + elif extension == 'python': + result = run(f"python3 {path} < example.in") + elif extension == 'java': + result = run(f"java Main < example.in") + except: + raise Exception("Runtime Error") + + if spj: + continue + + result = [ line.strip() for line in result if line.strip() != ''] + data_output = [ line.strip() for line in data_output if line.strip() != '' ] + + if result != data_output: + raise Exception("Wrong Solution") + + print(f"Example {idx + 1} Correct !") + + print(f"{problem} Judge Success") + +if __name__ == "__main__": + args = load_arg() + + if args.check_solution: + file = get_pr_file(args.pr_number) + lang = get_solution_language(file) + with open("result", 'w') as f: + f.write(lang) + f.close() + else: + file = get_pr_file(args.pr_number) + check_alreay_exist_solution(file) + run(f"git checkout FETCH_HEAD") + judge_test(file) diff --git a/scripts/config.json b/scripts/config.json new file mode 100644 index 0000000..f04ffbf --- /dev/null +++ b/scripts/config.json @@ -0,0 +1,86 @@ +{ + "API": { + "database": "./scripts/database.json", + "targeturl": "https://solved.ac/api/v3", + "route": { + "problemid": "problem/show?problemId=" + }, + "encoding": "UTF-8", + "update": 86400, + "solvedtags": [ + "bojTagId", + "key" + ] + }, + "tags": [ + "backtracking", + "binary_search", + "brute_force", + "data_structure", + "data_structure2", + "disjoint_set", + "divide_and_conquer", + "dynamic_programming_1", + "dynamic_programming_2", + "dynamic_programming_on_trees", + "graph_traversal", + "greedy", + "implementation", + "math", + "minimum_spanning_tree", + "prefix_sum", + "shortest_path", + "simulation", + "string", + "topological_sorting", + "tree", + "trie", + "two_pointer" + ], + "ignore": { + "all": [ + "solution", + "scripts", + "markdown", + ".git", + ".gitigore", + "LICENSE", + "CodingTest.md", + "README.md", + "algorithm_list.md", + "arrange.py", + "assemble.py", + "change_level.log", + "database.json", + "link_for_study.md", + "make_table.py", + "minidatabase.py", + "status.md", + "assets", + "guideline_for_contribute.md" + ], + "folder": [ + "solution", + "scripts", + "markdown", + "assets", + ".git" + ], + "file": [ + ".gitigore", + "LICENSE", + "CodingTest.md", + "README.md", + "algorithm_list.md", + "arrange.py", + "assemble.py", + "change_level.log", + "database.json", + "link_for_study.md", + "make_table.py", + "minidatabase.py", + "status.md", + "guideline_for_contribute.md" + ] + } +} diff --git a/scripts/database.json b/scripts/database.json new file mode 100644 index 0000000..0be5333 --- /dev/null +++ b/scripts/database.json @@ -0,0 +1,18861 @@ +{ + "1864": { + "problemId": "1864", + "problemLevel": 3, + "problemName": "문어 숫자", + "average_try": 1.413, + "solvedtags": [ + { + "bojTagId": 121, + "key": "arithmetic" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720093.41491 + }, + "15649": { + "problemId": "15649", + "problemLevel": 8, + "problemName": "N과 M (1)", + "average_try": 1.6559, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + } + ], + "lastupdate": 1640720099.494081 + }, + "15650": { + "problemId": "15650", + "problemLevel": 8, + "problemName": "N과 M (2)", + "average_try": 1.3411, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + } + ], + "lastupdate": 1640720099.494132 + }, + "15651": { + "problemId": "15651", + "problemLevel": 8, + "problemName": "N과 M (3)", + "average_try": 1.5141, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + } + ], + "lastupdate": 1640720099.494161 + }, + "15652": { + "problemId": "15652", + "problemLevel": 8, + "problemName": "N과 M (4)", + "average_try": 1.2574, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + } + ], + "lastupdate": 1640720099.494188 + }, + "15654": { + "problemId": "15654", + "problemLevel": 8, + "problemName": "N과 M (5)", + "average_try": 1.3706, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + } + ], + "lastupdate": 1640720099.494213 + }, + "15655": { + "problemId": "15655", + "problemLevel": 8, + "problemName": "N과 M (6)", + "average_try": 1.1659, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + } + ], + "lastupdate": 1640720099.494239 + }, + "15656": { + "problemId": "15656", + "problemLevel": 8, + "problemName": "N과 M (7)", + "average_try": 1.2604, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + } + ], + "lastupdate": 1640720099.494264 + }, + "15657": { + "problemId": "15657", + "problemLevel": 8, + "problemName": "N과 M (8)", + "average_try": 1.1852, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + } + ], + "lastupdate": 1640720099.494288 + }, + "15663": { + "problemId": "15663", + "problemLevel": 9, + "problemName": "N과 M (9)", + "average_try": 2.0283, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + } + ], + "lastupdate": 1640720099.494313 + }, + "15664": { + "problemId": "15664", + "problemLevel": 9, + "problemName": "N과 M (10)", + "average_try": 1.2328, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + } + ], + "lastupdate": 1640720099.494337 + }, + "15665": { + "problemId": "15665", + "problemLevel": 9, + "problemName": "N과 M (11)", + "average_try": 1.3084, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + } + ], + "lastupdate": 1640720099.494362 + }, + "15666": { + "problemId": "15666", + "problemLevel": 9, + "problemName": "N과 M (12)", + "average_try": 1.2371, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + } + ], + "lastupdate": 1640720099.49439 + }, + "14889": { + "problemId": "14889", + "problemLevel": 8, + "problemName": "스타트와 링크", + "average_try": 2.115, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.494415 + }, + "10974": { + "problemId": "10974", + "problemLevel": 8, + "problemName": "모든 순열", + "average_try": 1.6406, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.494441 + }, + "15658": { + "problemId": "15658", + "problemLevel": 9, + "problemName": "연산자 끼워넣기 (2)", + "average_try": 1.8873, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.49447 + }, + "16922": { + "problemId": "16922", + "problemLevel": 8, + "problemName": "로마 숫자 만들기", + "average_try": 1.8108, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 6, + "key": "combinatorics" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.494501 + }, + "18429": { + "problemId": "18429", + "problemLevel": 8, + "problemName": "근손실", + "average_try": 1.6687, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.494527 + }, + "1553": { + "problemId": "1553", + "problemLevel": 10, + "problemName": "도미노 찾기", + "average_try": 1.875, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.494579 + }, + "20950": { + "problemId": "20950", + "problemLevel": 9, + "problemName": "미술가 미미", + "average_try": 2.2308, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.494603 + }, + "6603": { + "problemId": "6603", + "problemLevel": 9, + "problemName": "로또", + "average_try": 1.836, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 6, + "key": "combinatorics" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 62, + "key": "recursion" + } + ], + "lastupdate": 1640720099.494627 + }, + "1182": { + "problemId": "1182", + "problemLevel": 9, + "problemName": "부분수열의 합", + "average_try": 2.264, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.494652 + }, + "10819": { + "problemId": "10819", + "problemLevel": 9, + "problemName": "차이를 최대로", + "average_try": 1.5566, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.494677 + }, + "10971": { + "problemId": "10971", + "problemLevel": 9, + "problemName": "외판원 순회 2", + "average_try": 2.9265, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 138, + "key": "tsp" + } + ], + "lastupdate": 1640720099.494702 + }, + "2529": { + "problemId": "2529", + "problemLevel": 9, + "problemName": "부등호", + "average_try": 1.9826, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.494726 + }, + "6987": { + "problemId": "6987", + "problemLevel": 11, + "problemName": "월드컵", + "average_try": 3.1761, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.494753 + }, + "16987": { + "problemId": "16987", + "problemLevel": 10, + "problemName": "계란으로 계란치기", + "average_try": 1.8895, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.494777 + }, + "19699": { + "problemId": "19699", + "problemLevel": 9, + "problemName": "소-난다!", + "average_try": 2.3977, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + }, + { + "bojTagId": 9, + "key": "primality_test" + }, + { + "bojTagId": 67, + "key": "sieve" + } + ], + "lastupdate": 1640720099.494802 + }, + "14712": { + "problemId": "14712", + "problemLevel": 10, + "problemName": "넴모넴모 (Easy)", + "average_try": 1.5503, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + } + ], + "lastupdate": 1640720099.494827 + }, + "14888": { + "problemId": "14888", + "problemLevel": 10, + "problemName": "연산자 끼워넣기", + "average_try": 2.0327, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.494851 + }, + "16198": { + "problemId": "16198", + "problemLevel": 10, + "problemName": "에너지 모으기", + "average_try": 1.2901, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 62, + "key": "recursion" + } + ], + "lastupdate": 1640720099.494876 + }, + "10597": { + "problemId": "10597", + "problemLevel": 10, + "problemName": "순열장난", + "average_try": 3.168, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.494925 + }, + "1174": { + "problemId": "1174", + "problemLevel": 10, + "problemName": "줄어드는 수", + "average_try": 2.5201, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.49495 + }, + "1189": { + "problemId": "1189", + "problemLevel": 10, + "problemName": "컴백홈", + "average_try": 1.8577, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.494974 + }, + "19942": { + "problemId": "19942", + "problemLevel": 11, + "problemName": "다이어트", + "average_try": 3.7175, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.494998 + }, + "18290": { + "problemId": "18290", + "problemLevel": 10, + "problemName": "NM과 K (1)", + "average_try": 3.8428, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + } + ], + "lastupdate": 1640720099.495023 + }, + "1497": { + "problemId": "1497", + "problemLevel": 10, + "problemName": "기타콘서트", + "average_try": 4.5, + "solvedtags": [ + { + "bojTagId": 14, + "key": "bitmask" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 6, + "key": "combinatorics" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.495047 + }, + "18430": { + "problemId": "18430", + "problemLevel": 10, + "problemName": "무기 공학", + "average_try": 2.25, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + } + ], + "lastupdate": 1640720099.495072 + }, + "15566": { + "problemId": "15566", + "problemLevel": 10, + "problemName": "개구리 1", + "average_try": 3, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.495096 + }, + "9663": { + "problemId": "9663", + "problemLevel": 11, + "problemName": "N-Queen", + "average_try": 1.9819, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.49512 + }, + "1759": { + "problemId": "1759", + "problemLevel": 11, + "problemName": "암호 만들기", + "average_try": 2.2304, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 6, + "key": "combinatorics" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.495147 + }, + "15684": { + "problemId": "15684", + "problemLevel": 12, + "problemName": "사다리 조작", + "average_try": 4.6487, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.49517 + }, + "1038": { + "problemId": "1038", + "problemLevel": 11, + "problemName": "감소하는 수", + "average_try": 3.2528, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.495194 + }, + "2023": { + "problemId": "2023", + "problemLevel": 11, + "problemName": "신기한 소수", + "average_try": 2.1643, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + }, + { + "bojTagId": 9, + "key": "primality_test" + } + ], + "lastupdate": 1640720099.495217 + }, + "1405": { + "problemId": "1405", + "problemLevel": 11, + "problemName": "미친 로봇", + "average_try": 2.909, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.49524 + }, + "1342": { + "problemId": "1342", + "problemLevel": 10, + "problemName": "행운의 문자열", + "average_try": 2.4374, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.495267 + }, + "7490": { + "problemId": "7490", + "problemLevel": 11, + "problemName": "0 만들기", + "average_try": 2.2335, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.49529 + }, + "13908": { + "problemId": "13908", + "problemLevel": 11, + "problemName": "비밀번호", + "average_try": 2.1241, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 6, + "key": "combinatorics" + }, + { + "bojTagId": 38, + "key": "inclusion_and_exclusion" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.495313 + }, + "7682": { + "problemId": "7682", + "problemLevel": 11, + "problemName": "틱택토", + "average_try": 3.3069, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.495336 + }, + "20208": { + "problemId": "20208", + "problemLevel": 11, + "problemName": "진우의 민트초코우유", + "average_try": 2.09, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.495359 + }, + "1469": { + "problemId": "1469", + "problemLevel": 12, + "problemName": "숌 사이 수열", + "average_try": 3.7612, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.495383 + }, + "10421": { + "problemId": "10421", + "problemLevel": 11, + "problemName": "수식 완성하기", + "average_try": 4.3333, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.495406 + }, + "1987": { + "problemId": "1987", + "problemLevel": 12, + "problemName": "알파벳", + "average_try": 3.4474, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.49543 + }, + "2580": { + "problemId": "2580", + "problemLevel": 12, + "problemName": "스도쿠", + "average_try": 3.6085, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + } + ], + "lastupdate": 1640720099.495453 + }, + "1062": { + "problemId": "1062", + "problemLevel": 12, + "problemName": "가르침", + "average_try": 4.0026, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 14, + "key": "bitmask" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.495476 + }, + "2661": { + "problemId": "2661", + "problemLevel": 12, + "problemName": "좋은수열", + "average_try": 1.9493, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + } + ], + "lastupdate": 1640720099.495499 + }, + "2239": { + "problemId": "2239", + "problemLevel": 12, + "problemName": "스도쿠", + "average_try": 2.0744, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.495522 + }, + "3980": { + "problemId": "3980", + "problemLevel": 12, + "problemName": "선발 명단", + "average_try": 2.3934, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.495544 + }, + "16938": { + "problemId": "16938", + "problemLevel": 12, + "problemName": "캠프 준비", + "average_try": 1.5124, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 6, + "key": "combinatorics" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.495567 + }, + "2922": { + "problemId": "2922", + "problemLevel": 12, + "problemName": "즐거운 단어", + "average_try": 2.293, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.49559 + }, + "15918": { + "problemId": "15918", + "problemLevel": 12, + "problemName": "랭퍼든 수열쟁이야!!", + "average_try": 1.3, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + } + ], + "lastupdate": 1640720099.495613 + }, + "1941": { + "problemId": "1941", + "problemLevel": 13, + "problemName": "소문난 칠공주", + "average_try": 2.1001, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.495636 + }, + "1248": { + "problemId": "1248", + "problemLevel": 13, + "problemName": "맞춰봐", + "average_try": 2.7989, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + } + ], + "lastupdate": 1640720099.495659 + }, + "9944": { + "problemId": "9944", + "problemLevel": 13, + "problemName": "NxM 보드 완주하기", + "average_try": 3.3082, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.495682 + }, + "6443": { + "problemId": "6443", + "problemLevel": 11, + "problemName": "애너그램", + "average_try": 2.6466, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 6, + "key": "combinatorics" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.495705 + }, + "2026": { + "problemId": "2026", + "problemLevel": 13, + "problemName": "소풍", + "average_try": 4.3946, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + } + ], + "lastupdate": 1640720099.495727 + }, + "15659": { + "problemId": "15659", + "problemLevel": 13, + "problemName": "연산자 끼워넣기 (3)", + "average_try": 1.7482, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 71, + "key": "stack" + } + ], + "lastupdate": 1640720099.49575 + }, + "12908": { + "problemId": "12908", + "problemLevel": 13, + "problemName": "텔레포트 3", + "average_try": 2.2302, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + } + ], + "lastupdate": 1640720099.495773 + }, + "1729": { + "problemId": "1729", + "problemLevel": 15, + "problemName": "이차원 배열의 합", + "average_try": 2.4167, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.495796 + }, + "17136": { + "problemId": "17136", + "problemLevel": 14, + "problemName": "색종이 붙이기", + "average_try": 3.0191, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.495819 + }, + "1799": { + "problemId": "1799", + "problemLevel": 15, + "problemName": "비숍", + "average_try": 4.1828, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + } + ], + "lastupdate": 1640720099.495842 + }, + "16571": { + "problemId": "16571", + "problemLevel": 14, + "problemName": "알파 틱택토", + "average_try": 2.3217, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 140, + "key": "game_theory" + } + ], + "lastupdate": 1640720099.495866 + }, + "3165": { + "problemId": "3165", + "problemLevel": 14, + "problemName": "5", + "average_try": 3.1176, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 33, + "key": "greedy" + } + ], + "lastupdate": 1640720099.495889 + }, + "1789": { + "problemId": "1789", + "problemLevel": 6, + "problemName": "수들의 합", + "average_try": 2.3238, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.497082 + }, + "2417": { + "problemId": "2417", + "problemLevel": 6, + "problemName": "정수 제곱근", + "average_try": 2.3972, + "solvedtags": [ + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.497122 + }, + "17266": { + "problemId": "17266", + "problemLevel": 6, + "problemName": "어두운 굴다리", + "average_try": 2.4618, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 106, + "key": "sweeping" + } + ], + "lastupdate": 1640720099.497152 + }, + "1920": { + "problemId": "1920", + "problemLevel": 7, + "problemName": "수 찾기", + "average_try": 3.3166, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + } + ], + "lastupdate": 1640720099.497179 + }, + "10815": { + "problemId": "10815", + "problemLevel": 7, + "problemName": "숫자 카드", + "average_try": 2.0455, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.497224 + }, + "10816": { + "problemId": "10816", + "problemLevel": 7, + "problemName": "숫자 카드 2", + "average_try": 2.7999, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 136, + "key": "hash_set" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.49725 + }, + "20551": { + "problemId": "20551", + "problemLevel": 7, + "problemName": "Sort 마스터 배지훈의 후계자", + "average_try": 2.8257, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 74, + "key": "tree_set" + } + ], + "lastupdate": 1640720099.497276 + }, + "2805": { + "problemId": "2805", + "problemLevel": 8, + "problemName": "나무 자르기", + "average_try": 3.9024, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 170, + "key": "parametric_search" + } + ], + "lastupdate": 1640720099.497301 + }, + "1654": { + "problemId": "1654", + "problemLevel": 8, + "problemName": "랜선 자르기", + "average_try": 4.7816, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 170, + "key": "parametric_search" + } + ], + "lastupdate": 1640720099.497326 + }, + "2512": { + "problemId": "2512", + "problemLevel": 8, + "problemName": "예산", + "average_try": 3.1137, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 170, + "key": "parametric_search" + } + ], + "lastupdate": 1640720099.497453 + }, + "1072": { + "problemId": "1072", + "problemLevel": 8, + "problemName": "게임", + "average_try": 4.4679, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.497486 + }, + "6236": { + "problemId": "6236", + "problemLevel": 9, + "problemName": "용돈 관리", + "average_try": 3.3362, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 170, + "key": "parametric_search" + } + ], + "lastupdate": 1640720099.497534 + }, + "7795": { + "problemId": "7795", + "problemLevel": 8, + "problemName": "먹을 것인가 먹힐 것인가", + "average_try": 1.9143, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.497557 + }, + "2792": { + "problemId": "2792", + "problemLevel": 8, + "problemName": "보석 상자", + "average_try": 2.8315, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + } + ], + "lastupdate": 1640720099.497581 + }, + "16401": { + "problemId": "16401", + "problemLevel": 8, + "problemName": "과자 나눠주기", + "average_try": 2.4621, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 170, + "key": "parametric_search" + } + ], + "lastupdate": 1640720099.497603 + }, + "13702": { + "problemId": "13702", + "problemLevel": 8, + "problemName": "이상한 술집", + "average_try": 2.6692, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + } + ], + "lastupdate": 1640720099.497626 + }, + "11561": { + "problemId": "11561", + "problemLevel": 8, + "problemName": "징검다리", + "average_try": 3.4562, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.497648 + }, + "14627": { + "problemId": "14627", + "problemLevel": 8, + "problemName": "파닭파닭", + "average_try": 5.3064, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + } + ], + "lastupdate": 1640720099.497671 + }, + "1166": { + "problemId": "1166", + "problemLevel": 8, + "problemName": "선물", + "average_try": 6.0026, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + } + ], + "lastupdate": 1640720099.497693 + }, + "17451": { + "problemId": "17451", + "problemLevel": 8, + "problemName": "평행 우주", + "average_try": 2.6667, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.497714 + }, + "19637": { + "problemId": "19637", + "problemLevel": 8, + "problemName": "IF문 좀 대신 써줘", + "average_try": 2.7296, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + } + ], + "lastupdate": 1640720099.497735 + }, + "17393": { + "problemId": "17393", + "problemLevel": 8, + "problemName": "다이나믹 롤러", + "average_try": 2.4545, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + } + ], + "lastupdate": 1640720099.497757 + }, + "17124": { + "problemId": "17124", + "problemLevel": 8, + "problemName": "두 개의 배열", + "average_try": 2.7699, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.497778 + }, + "11663": { + "problemId": "11663", + "problemLevel": 8, + "problemName": "선분 위의 점", + "average_try": 2.5819, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.497799 + }, + "15810": { + "problemId": "15810", + "problemLevel": 9, + "problemName": "풍선 공장", + "average_try": 3.8711, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + } + ], + "lastupdate": 1640720099.497821 + }, + "17503": { + "problemId": "17503", + "problemLevel": 9, + "problemName": "맥주 축제", + "average_try": 3.1899, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 59, + "key": "priority_queue" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.497842 + }, + "18113": { + "problemId": "18113", + "problemLevel": 9, + "problemName": "그르다 김가놈", + "average_try": 3.4065, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + } + ], + "lastupdate": 1640720099.497862 + }, + "2121": { + "problemId": "2121", + "problemLevel": 8, + "problemName": "넷이 놀기", + "average_try": 2.2958, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 136, + "key": "hash_set" + } + ], + "lastupdate": 1640720099.497884 + }, + "2110": { + "problemId": "2110", + "problemLevel": 11, + "problemName": "공유기 설치", + "average_try": 2.5258, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 170, + "key": "parametric_search" + } + ], + "lastupdate": 1640720099.497905 + }, + "2343": { + "problemId": "2343", + "problemLevel": 10, + "problemName": "기타 레슨", + "average_try": 3.2937, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 170, + "key": "parametric_search" + } + ], + "lastupdate": 1640720099.497926 + }, + "3079": { + "problemId": "3079", + "problemLevel": 10, + "problemName": "입국심사", + "average_try": 3.7972, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + } + ], + "lastupdate": 1640720099.49796 + }, + "2022": { + "problemId": "2022", + "problemLevel": 10, + "problemName": "사다리", + "average_try": 1.8685, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 100, + "key": "geometry" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 60, + "key": "pythagoras" + } + ], + "lastupdate": 1640720099.497984 + }, + "16564": { + "problemId": "16564", + "problemLevel": 10, + "problemName": "히오스 프로게이머", + "average_try": 2.1355, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + } + ], + "lastupdate": 1640720099.498008 + }, + "11687": { + "problemId": "11687", + "problemLevel": 11, + "problemName": "팩토리얼 0의 개수", + "average_try": 2.2119, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.498032 + }, + "18114": { + "problemId": "18114", + "problemLevel": 10, + "problemName": "블랙 프라이데이", + "average_try": 3.7135, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.498056 + }, + "14575": { + "problemId": "14575", + "problemLevel": 10, + "problemName": "뒤풀이", + "average_try": 3.0543, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + } + ], + "lastupdate": 1640720099.498081 + }, + "17179": { + "problemId": "17179", + "problemLevel": 10, + "problemName": "케이크 자르기", + "average_try": 3.0377, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 33, + "key": "greedy" + } + ], + "lastupdate": 1640720099.498105 + }, + "16960": { + "problemId": "16960", + "problemLevel": 7, + "problemName": "스위치와 램프", + "average_try": 1.9184, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.498128 + }, + "20495": { + "problemId": "20495", + "problemLevel": 10, + "problemName": "수열과 헌팅", + "average_try": 1.9885, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + } + ], + "lastupdate": 1640720099.498151 + }, + "3020": { + "problemId": "3020", + "problemLevel": 11, + "problemName": "개똥벌레", + "average_try": 2.3688, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.498199 + }, + "1477": { + "problemId": "1477", + "problemLevel": 12, + "problemName": "휴게소 세우기", + "average_try": 3.0464, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 170, + "key": "parametric_search" + } + ], + "lastupdate": 1640720099.498246 + }, + "2866": { + "problemId": "2866", + "problemLevel": 11, + "problemName": "문자열 잘라내기", + "average_try": 3.1704, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.49827 + }, + "20444": { + "problemId": "20444", + "problemLevel": 11, + "problemName": "색종이와 가위", + "average_try": 2.617, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.498294 + }, + "1939": { + "problemId": "1939", + "problemLevel": 12, + "problemName": "중량제한", + "average_try": 4.0895, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 81, + "key": "disjoint_set" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.498341 + }, + "8983": { + "problemId": "8983", + "problemLevel": 12, + "problemName": "사냥꾼", + "average_try": 3.2187, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.498364 + }, + "13397": { + "problemId": "13397", + "problemLevel": 12, + "problemName": "구간 나누기 2", + "average_try": 1.5409, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 170, + "key": "parametric_search" + } + ], + "lastupdate": 1640720099.498411 + }, + "9007": { + "problemId": "9007", + "problemLevel": 13, + "problemName": "카누 선수", + "average_try": 4.0411, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.498434 + }, + "2412": { + "problemId": "2412", + "problemLevel": 13, + "problemName": "암벽 등반", + "average_try": 3.4551, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.498457 + }, + "17951": { + "problemId": "17951", + "problemLevel": 12, + "problemName": "흩날리는 시험지 속에서 내 평점이 느껴진거야", + "average_try": 2.125, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + } + ], + "lastupdate": 1640720099.498481 + }, + "12757": { + "problemId": "12757", + "problemLevel": 13, + "problemName": "전설의 JBNU", + "average_try": 3.093, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 136, + "key": "hash_set" + } + ], + "lastupdate": 1640720099.498504 + }, + "1300": { + "problemId": "1300", + "problemLevel": 14, + "problemName": "K번째 수", + "average_try": 2.6495, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + } + ], + "lastupdate": 1640720099.498528 + }, + "2143": { + "problemId": "2143", + "problemLevel": 13, + "problemName": "두 배열의 합", + "average_try": 3.3795, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.498551 + }, + "16434": { + "problemId": "16434", + "problemLevel": 13, + "problemName": "드래곤 앤 던전", + "average_try": 3.4695, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.498574 + }, + "15823": { + "problemId": "15823", + "problemLevel": 13, + "problemName": "카드 팩 구매하기", + "average_try": 3.14, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + } + ], + "lastupdate": 1640720099.498597 + }, + "2613": { + "problemId": "2613", + "problemLevel": 14, + "problemName": "숫자구슬", + "average_try": 3.6163, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 33, + "key": "greedy" + } + ], + "lastupdate": 1640720099.498644 + }, + "1561": { + "problemId": "1561", + "problemLevel": 14, + "problemName": "놀이 공원", + "average_try": 4.2391, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 170, + "key": "parametric_search" + } + ], + "lastupdate": 1640720099.498667 + }, + "15732": { + "problemId": "15732", + "problemLevel": 14, + "problemName": "도토리 숨기기", + "average_try": 3.5663, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + } + ], + "lastupdate": 1640720099.498691 + }, + "6209": { + "problemId": "6209", + "problemLevel": 14, + "problemName": "제자리 멀리뛰기", + "average_try": 2.6115, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 170, + "key": "parametric_search" + } + ], + "lastupdate": 1640720099.498714 + }, + "9094": { + "problemId": "9094", + "problemLevel": 3, + "problemName": "수학적 호기심", + "average_try": 1.533, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.499889 + }, + "4690": { + "problemId": "4690", + "problemLevel": 3, + "problemName": "완전 세제곱", + "average_try": 2.4991, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 172, + "key": "precomputation" + } + ], + "lastupdate": 1640720099.499928 + }, + "3040": { + "problemId": "3040", + "problemLevel": 4, + "problemName": "백설 공주와 일곱 난쟁이", + "average_try": 1.4202, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.499956 + }, + "10448": { + "problemId": "10448", + "problemLevel": 4, + "problemName": "유레카 이론", + "average_try": 1.701, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.499982 + }, + "2798": { + "problemId": "2798", + "problemLevel": 4, + "problemName": "블랙잭", + "average_try": 2.1929, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.500007 + }, + "2309": { + "problemId": "2309", + "problemLevel": 4, + "problemName": "일곱 난쟁이", + "average_try": 2.306, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.500033 + }, + "2231": { + "problemId": "2231", + "problemLevel": 4, + "problemName": "분해합", + "average_try": 2.1585, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.500057 + }, + "14697": { + "problemId": "14697", + "problemLevel": 4, + "problemName": "방 배정하기", + "average_try": 2.325, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.500082 + }, + "1668": { + "problemId": "1668", + "problemLevel": 4, + "problemName": "트로피 진열", + "average_try": 2.1285, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.500106 + }, + "13410": { + "problemId": "13410", + "problemLevel": 4, + "problemName": "거꾸로 구구단", + "average_try": 1.6377, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.500131 + }, + "19532": { + "problemId": "19532", + "problemLevel": 4, + "problemName": "수학은 비대면강의입니다", + "average_try": 2.0468, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.500156 + }, + "18312": { + "problemId": "18312", + "problemLevel": 4, + "problemName": "시각", + "average_try": 2.3905, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.500182 + }, + "1145": { + "problemId": "1145", + "problemLevel": 5, + "problemName": "적어도 대부분의 배수", + "average_try": 1.7209, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.500207 + }, + "2160": { + "problemId": "2160", + "problemLevel": 5, + "problemName": "그림 비교", + "average_try": 1.9515, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.50023 + }, + "18512": { + "problemId": "18512", + "problemLevel": 5, + "problemName": "점프 점프", + "average_try": 2.1489, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.500254 + }, + "18868": { + "problemId": "18868", + "problemLevel": 5, + "problemName": "멀티버스 Ⅰ", + "average_try": 1.6628, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.500277 + }, + "15721": { + "problemId": "15721", + "problemLevel": 5, + "problemName": "번데기", + "average_try": 2.1614, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.500301 + }, + "1969": { + "problemId": "1969", + "problemLevel": 6, + "problemName": "DNA", + "average_try": 1.7416, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.500326 + }, + "2503": { + "problemId": "2503", + "problemLevel": 7, + "problemName": "숫자 야구", + "average_try": 2.1645, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.50035 + }, + "1436": { + "problemId": "1436", + "problemLevel": 6, + "problemName": "영화감독 숌", + "average_try": 2.1955, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.500374 + }, + "1018": { + "problemId": "1018", + "problemLevel": 6, + "problemName": "체스판 다시 칠하기", + "average_try": 2.1564, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.500397 + }, + "7568": { + "problemId": "7568", + "problemLevel": 6, + "problemName": "덩치", + "average_try": 1.7499, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.500421 + }, + "2422": { + "problemId": "2422", + "problemLevel": 6, + "problemName": "한윤정이 이탈리아에 가서 아이스크림을 사먹는데", + "average_try": 2.4518, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.500446 + }, + "2435": { + "problemId": "2435", + "problemLevel": 6, + "problemName": "기상청 인턴 신현수", + "average_try": 2.1507, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.500469 + }, + "2635": { + "problemId": "2635", + "problemLevel": 6, + "problemName": "수 이어가기", + "average_try": 2.5969, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.500517 + }, + "1059": { + "problemId": "1059", + "problemLevel": 6, + "problemName": "좋은 구간", + "average_try": 3.8384, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.50054 + }, + "5568": { + "problemId": "5568", + "problemLevel": 6, + "problemName": "카드 놓기", + "average_try": 1.7498, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 136, + "key": "hash_set" + }, + { + "bojTagId": 62, + "key": "recursion" + } + ], + "lastupdate": 1640720099.500564 + }, + "11170": { + "problemId": "11170", + "problemLevel": 6, + "problemName": "0의 개수", + "average_try": 1.2613, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.500588 + }, + "1251": { + "problemId": "1251", + "problemLevel": 6, + "problemName": "단어 나누기", + "average_try": 2.2592, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.500611 + }, + "14912": { + "problemId": "14912", + "problemLevel": 6, + "problemName": "숫자 빈도수", + "average_try": 1.2598, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.500634 + }, + "19947": { + "problemId": "19947", + "problemLevel": 6, + "problemName": "투자의 귀재 배주형", + "average_try": 2.6602, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 62, + "key": "recursion" + } + ], + "lastupdate": 1640720099.500681 + }, + "1359": { + "problemId": "1359", + "problemLevel": 7, + "problemName": "복권", + "average_try": 3.0286, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 6, + "key": "combinatorics" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 177, + "key": "probability" + } + ], + "lastupdate": 1640720099.500704 + }, + "15779": { + "problemId": "15779", + "problemLevel": 6, + "problemName": "Zigzag", + "average_try": 2.4332, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.500728 + }, + "18511": { + "problemId": "18511", + "problemLevel": 6, + "problemName": "큰 수 구성하기", + "average_try": 3.5534, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 62, + "key": "recursion" + } + ], + "lastupdate": 1640720099.500751 + }, + "17484": { + "problemId": "17484", + "problemLevel": 7, + "problemName": "진우의 달 여행 (Small)", + "average_try": 1.6111, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.500776 + }, + "9079": { + "problemId": "9079", + "problemLevel": 7, + "problemName": "동전 게임", + "average_try": 1.4248, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.500799 + }, + "4096": { + "problemId": "4096", + "problemLevel": 5, + "problemName": "팰린드로미터", + "average_try": 1.9009, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.500822 + }, + "1065": { + "problemId": "1065", + "problemLevel": 7, + "problemName": "한수", + "average_try": 1.8923, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.500846 + }, + "1120": { + "problemId": "1120", + "problemLevel": 7, + "problemName": "문자열", + "average_try": 1.8757, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.500893 + }, + "3085": { + "problemId": "3085", + "problemLevel": 8, + "problemName": "사탕 게임", + "average_try": 3.175, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.500916 + }, + "1543": { + "problemId": "1543", + "problemLevel": 7, + "problemName": "문서 검색", + "average_try": 2.6031, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.500939 + }, + "15970": { + "problemId": "15970", + "problemLevel": 7, + "problemName": "화살표 그리기", + "average_try": 1.9223, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.500962 + }, + "5671": { + "problemId": "5671", + "problemLevel": 6, + "problemName": "호텔 방 번호", + "average_try": 1.5533, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.500986 + }, + "16937": { + "problemId": "16937", + "problemLevel": 7, + "problemName": "두 스티커", + "average_try": 2.6439, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.501009 + }, + "5883": { + "problemId": "5883", + "problemLevel": 7, + "problemName": "아이폰 9S", + "average_try": 2.3321, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.501032 + }, + "16951": { + "problemId": "16951", + "problemLevel": 7, + "problemName": "블록 놀이", + "average_try": 2.9281, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.501055 + }, + "1487": { + "problemId": "1487", + "problemLevel": 8, + "problemName": "물건 팔기", + "average_try": 2.8835, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.501077 + }, + "15270": { + "problemId": "15270", + "problemLevel": 8, + "problemName": "친구 팰린드롬", + "average_try": 3.3065, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 62, + "key": "recursion" + } + ], + "lastupdate": 1640720099.5011 + }, + "11502": { + "problemId": "11502", + "problemLevel": 7, + "problemName": "세 개의 소수 문제", + "average_try": 1.6713, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + }, + { + "bojTagId": 9, + "key": "primality_test" + }, + { + "bojTagId": 67, + "key": "sieve" + } + ], + "lastupdate": 1640720099.501146 + }, + "9996": { + "problemId": "9996", + "problemLevel": 8, + "problemName": "한국이 그리울 땐 서버에 접속하지", + "average_try": 3.5233, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 63, + "key": "regex" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.501169 + }, + "10472": { + "problemId": "10472", + "problemLevel": 9, + "problemName": "십자뒤집기", + "average_try": 2.4, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.501365 + }, + "1895": { + "problemId": "1895", + "problemLevel": 7, + "problemName": "필터", + "average_try": 1.2271, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.501394 + }, + "16439": { + "problemId": "16439", + "problemLevel": 7, + "problemName": "치킨치킨치킨", + "average_try": 1.3402, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.501418 + }, + "19949": { + "problemId": "19949", + "problemLevel": 8, + "problemName": "영재의 시험", + "average_try": 1.1893, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.501442 + }, + "15728": { + "problemId": "15728", + "problemLevel": 8, + "problemName": "에리 - 카드", + "average_try": 2.8421, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.501466 + }, + "16508": { + "problemId": "16508", + "problemLevel": 8, + "problemName": "전공책", + "average_try": 2.4888, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.501489 + }, + "1503": { + "problemId": "1503", + "problemLevel": 8, + "problemName": "세 수 고르기", + "average_try": 4.8692, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.501513 + }, + "14620": { + "problemId": "14620", + "problemLevel": 9, + "problemName": "꽃길", + "average_try": 1.9475, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.501537 + }, + "12919": { + "problemId": "12919", + "problemLevel": 10, + "problemName": "A와 B 2", + "average_try": 2.7134, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 62, + "key": "recursion" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.501561 + }, + "1421": { + "problemId": "1421", + "problemLevel": 9, + "problemName": "나무꾼 이다솜", + "average_try": 4.4224, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.501585 + }, + "1411": { + "problemId": "1411", + "problemLevel": 9, + "problemName": "비슷한 단어", + "average_try": 1.8535, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.501608 + }, + "1548": { + "problemId": "1548", + "problemLevel": 10, + "problemName": "부분 삼각 수열", + "average_try": 3.2419, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.501632 + }, + "1254": { + "problemId": "1254", + "problemLevel": 10, + "problemName": "팰린드롬 만들기", + "average_try": 2.3716, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.501655 + }, + "2961": { + "problemId": "2961", + "problemLevel": 10, + "problemName": "도영이가 만든 맛있는 음식", + "average_try": 2.2022, + "solvedtags": [ + { + "bojTagId": 14, + "key": "bitmask" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.501678 + }, + "15661": { + "problemId": "15661", + "problemLevel": 10, + "problemName": "링크와 스타트", + "average_try": 1.9578, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.501701 + }, + "1527": { + "problemId": "1527", + "problemLevel": 10, + "problemName": "금민수의 개수", + "average_try": 2.6503, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.501725 + }, + "17610": { + "problemId": "17610", + "problemLevel": 10, + "problemName": "양팔저울", + "average_try": 2.427, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.501748 + }, + "16943": { + "problemId": "16943", + "problemLevel": 10, + "problemName": "숫자 재배치", + "average_try": 2.3532, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 6, + "key": "combinatorics" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.501771 + }, + "1025": { + "problemId": "1025", + "problemLevel": 11, + "problemName": "제곱수 찾기", + "average_try": 3.4859, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.501794 + }, + "17085": { + "problemId": "17085", + "problemLevel": 10, + "problemName": "십자가 2개 놓기", + "average_try": 2.834, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.501818 + }, + "14500": { + "problemId": "14500", + "problemLevel": 11, + "problemName": "테트로미노", + "average_try": 2.8372, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.502079 + }, + "15686": { + "problemId": "15686", + "problemLevel": 11, + "problemName": "치킨 배달", + "average_try": 2.2758, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.502118 + }, + "1107": { + "problemId": "1107", + "problemLevel": 11, + "problemName": "리모컨", + "average_try": 4.4804, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.502144 + }, + "17471": { + "problemId": "17471", + "problemLevel": 12, + "problemName": "게리맨더링", + "average_try": 2.6405, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.502172 + }, + "14225": { + "problemId": "14225", + "problemLevel": 10, + "problemName": "부분수열의 합", + "average_try": 2.2452, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.502222 + }, + "1034": { + "problemId": "1034", + "problemLevel": 11, + "problemName": "램프", + "average_try": 2.8682, + "solvedtags": [ + { + "bojTagId": 109, + "key": "ad_hoc" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.502247 + }, + "16637": { + "problemId": "16637", + "problemLevel": 13, + "problemName": "괄호 추가하기", + "average_try": 2.6465, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.502272 + }, + "14391": { + "problemId": "14391", + "problemLevel": 13, + "problemName": "종이 조각", + "average_try": 1.7956, + "solvedtags": [ + { + "bojTagId": 14, + "key": "bitmask" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.502296 + }, + "16986": { + "problemId": "16986", + "problemLevel": 13, + "problemName": "인싸들의 가위바위보", + "average_try": 2.4339, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.502345 + }, + "1711": { + "problemId": "1711", + "problemLevel": 11, + "problemName": "직각삼각형", + "average_try": 2.7514, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 100, + "key": "geometry" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 60, + "key": "pythagoras" + } + ], + "lastupdate": 1640720099.502369 + }, + "1581": { + "problemId": "1581", + "problemLevel": 12, + "problemName": "락스타 락동호", + "average_try": 3.9225, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 137, + "key": "case_work" + } + ], + "lastupdate": 1640720099.502393 + }, + "21278": { + "problemId": "21278", + "problemLevel": 11, + "problemName": "호석이 두 마리 치킨", + "average_try": 1.9765, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 31, + "key": "floyd_warshall" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.502417 + }, + "21315": { + "problemId": "21315", + "problemLevel": 11, + "problemName": "카드 섞기", + "average_try": 2.299, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.502449 + }, + "2304": { + "problemId": "2304", + "problemLevel": 9, + "problemName": "창고 다각형", + "average_try": 2.3158, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 71, + "key": "stack" + } + ], + "lastupdate": 1640720099.502474 + }, + "21943": { + "problemId": "21943", + "problemLevel": 14, + "problemName": "연산 최대로", + "average_try": 1.88, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 33, + "key": "greedy" + } + ], + "lastupdate": 1640720099.502499 + }, + "22944": { + "problemId": "22944", + "problemLevel": 12, + "problemName": "죽음의 비", + "average_try": 6.7576, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.502552 + }, + "22947": { + "problemId": "22947", + "problemLevel": 14, + "problemName": "실행 시간", + "average_try": 1.9167, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 78, + "key": "topological_sorting" + } + ], + "lastupdate": 1640720099.502576 + }, + "10828": { + "problemId": "10828", + "problemLevel": 7, + "problemName": "스택", + "average_try": 2.6212, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 71, + "key": "stack" + } + ], + "lastupdate": 1640720099.503981 + }, + "9012": { + "problemId": "9012", + "problemLevel": 7, + "problemName": "괄호", + "average_try": 2.3038, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 71, + "key": "stack" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.50402 + }, + "1874": { + "problemId": "1874", + "problemLevel": 8, + "problemName": "스택 수열", + "average_try": 2.826, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 71, + "key": "stack" + } + ], + "lastupdate": 1640720099.504049 + }, + "1935": { + "problemId": "1935", + "problemLevel": 8, + "problemName": "후위 표기식2", + "average_try": 2.1002, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 71, + "key": "stack" + } + ], + "lastupdate": 1640720099.504075 + }, + "10799": { + "problemId": "10799", + "problemLevel": 8, + "problemName": "쇠막대기", + "average_try": 1.5901, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 71, + "key": "stack" + } + ], + "lastupdate": 1640720099.5041 + }, + "2504": { + "problemId": "2504", + "problemLevel": 9, + "problemName": "괄호의 값", + "average_try": 3.5968, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 62, + "key": "recursion" + }, + { + "bojTagId": 71, + "key": "stack" + } + ], + "lastupdate": 1640720099.504127 + }, + "2800": { + "problemId": "2800", + "problemLevel": 11, + "problemName": "괄호 제거", + "average_try": 2.932, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 62, + "key": "recursion" + }, + { + "bojTagId": 71, + "key": "stack" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.504153 + }, + "2493": { + "problemId": "2493", + "problemLevel": 11, + "problemName": "탑", + "average_try": 3.3433, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 71, + "key": "stack" + } + ], + "lastupdate": 1640720099.504179 + }, + "1918": { + "problemId": "1918", + "problemLevel": 13, + "problemName": "후위 표기식", + "average_try": 3.0956, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 71, + "key": "stack" + } + ], + "lastupdate": 1640720099.504203 + }, + "18258": { + "problemId": "18258", + "problemLevel": 7, + "problemName": "큐 2", + "average_try": 3.234, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 72, + "key": "queue" + } + ], + "lastupdate": 1640720099.504229 + }, + "1158": { + "problemId": "1158", + "problemLevel": 6, + "problemName": "요세푸스 문제", + "average_try": 2.078, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 72, + "key": "queue" + } + ], + "lastupdate": 1640720099.504254 + }, + "2164": { + "problemId": "2164", + "problemLevel": 7, + "problemName": "카드2", + "average_try": 1.8928, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 72, + "key": "queue" + } + ], + "lastupdate": 1640720099.504278 + }, + "1966": { + "problemId": "1966", + "problemLevel": 8, + "problemName": "프린터 큐", + "average_try": 1.7648, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 72, + "key": "queue" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.504302 + }, + "10866": { + "problemId": "10866", + "problemLevel": 7, + "problemName": "덱", + "average_try": 1.7752, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 73, + "key": "deque" + } + ], + "lastupdate": 1640720099.504326 + }, + "2346": { + "problemId": "2346", + "problemLevel": 8, + "problemName": "풍선 터뜨리기", + "average_try": 2.4297, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 73, + "key": "deque" + } + ], + "lastupdate": 1640720099.50435 + }, + "10845": { + "problemId": "10845", + "problemLevel": 7, + "problemName": "큐", + "average_try": 2.04, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 72, + "key": "queue" + } + ], + "lastupdate": 1640720099.504374 + }, + "4949": { + "problemId": "4949", + "problemLevel": 7, + "problemName": "균형잡힌 세상", + "average_try": 3.0809, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 71, + "key": "stack" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.504398 + }, + "3986": { + "problemId": "3986", + "problemLevel": 7, + "problemName": "좋은 단어", + "average_try": 1.9959, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 71, + "key": "stack" + } + ], + "lastupdate": 1640720099.504422 + }, + "1021": { + "problemId": "1021", + "problemLevel": 7, + "problemName": "회전하는 큐", + "average_try": 1.7896, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 73, + "key": "deque" + } + ], + "lastupdate": 1640720099.504446 + }, + "5397": { + "problemId": "5397", + "problemLevel": 8, + "problemName": "키로거", + "average_try": 4.0437, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 154, + "key": "linked_list" + }, + { + "bojTagId": 71, + "key": "stack" + } + ], + "lastupdate": 1640720099.504472 + }, + "18115": { + "problemId": "18115", + "problemLevel": 8, + "problemName": "카드 놓기", + "average_try": 1.7733, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 73, + "key": "deque" + } + ], + "lastupdate": 1640720099.504496 + }, + "5430": { + "problemId": "5430", + "problemLevel": 11, + "problemName": "AC", + "average_try": 4.9465, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 73, + "key": "deque" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 96, + "key": "parsing" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.50452 + }, + "1863": { + "problemId": "1863", + "problemLevel": 11, + "problemName": "스카이라인 쉬운거", + "average_try": 2.5492, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 71, + "key": "stack" + } + ], + "lastupdate": 1640720099.504544 + }, + "22866": { + "problemId": "22866", + "problemLevel": 12, + "problemName": "탑 보기", + "average_try": 3.1111, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 71, + "key": "stack" + } + ], + "lastupdate": 1640720099.504568 + }, + "22942": { + "problemId": "22942", + "problemLevel": 11, + "problemName": "데이터 체커", + "average_try": 2.931, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 100, + "key": "geometry" + }, + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 71, + "key": "stack" + }, + { + "bojTagId": 106, + "key": "sweeping" + } + ], + "lastupdate": 1640720099.504592 + }, + "11279": { + "problemId": "11279", + "problemLevel": 9, + "problemName": "최대 힙", + "average_try": 2.2112, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 59, + "key": "priority_queue" + } + ], + "lastupdate": 1640720099.505239 + }, + "11286": { + "problemId": "11286", + "problemLevel": 10, + "problemName": "절댓값 힙", + "average_try": 1.7503, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 59, + "key": "priority_queue" + } + ], + "lastupdate": 1640720099.505262 + }, + "7662": { + "problemId": "7662", + "problemLevel": 11, + "problemName": "이중 우선순위 큐", + "average_try": 4.3426, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 59, + "key": "priority_queue" + }, + { + "bojTagId": 74, + "key": "tree_set" + } + ], + "lastupdate": 1640720099.505337 + }, + "2075": { + "problemId": "2075", + "problemLevel": 11, + "problemName": "N번째 큰 수", + "average_try": 2.5159, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 59, + "key": "priority_queue" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.505362 + }, + "2696": { + "problemId": "2696", + "problemLevel": 14, + "problemName": "중앙값 구하기", + "average_try": 1.8983, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 59, + "key": "priority_queue" + } + ], + "lastupdate": 1640720099.505408 + }, + "9375": { + "problemId": "9375", + "problemLevel": 8, + "problemName": "패션왕 신해빈", + "average_try": 1.8311, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 136, + "key": "hash_set" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.505431 + }, + "1927": { + "problemId": "1927", + "problemLevel": 10, + "problemName": "최소 힙", + "average_try": 2.0532, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 59, + "key": "priority_queue" + } + ], + "lastupdate": 1640720099.505453 + }, + "12764": { + "problemId": "12764", + "problemLevel": 13, + "problemName": "싸지방에 간 준하", + "average_try": 3.5273, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 59, + "key": "priority_queue" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.505518 + }, + "1655": { + "problemId": "1655", + "problemLevel": 14, + "problemName": "가운데를 말해요", + "average_try": 3.1947, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 59, + "key": "priority_queue" + } + ], + "lastupdate": 1640720099.505539 + }, + "2776": { + "problemId": "2776", + "problemLevel": 7, + "problemName": "암기왕", + "average_try": 3.4112, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 136, + "key": "hash_set" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.505574 + }, + "1269": { + "problemId": "1269", + "problemLevel": 8, + "problemName": "대칭 차집합", + "average_try": 1.8288, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 136, + "key": "hash_set" + }, + { + "bojTagId": 74, + "key": "tree_set" + } + ], + "lastupdate": 1640720099.505598 + }, + "10546": { + "problemId": "10546", + "problemLevel": 7, + "problemName": "배부른 마라토너", + "average_try": 2.2018, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 136, + "key": "hash_set" + } + ], + "lastupdate": 1640720099.505622 + }, + "1302": { + "problemId": "1302", + "problemLevel": 7, + "problemName": "베스트셀러", + "average_try": 2.1368, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 136, + "key": "hash_set" + }, + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.505647 + }, + "21939": { + "problemId": "21939", + "problemLevel": 12, + "problemName": "문제 추천 시스템 Version 1", + "average_try": 3.0738, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 59, + "key": "priority_queue" + }, + { + "bojTagId": 74, + "key": "tree_set" + } + ], + "lastupdate": 1640720099.505671 + }, + "21942": { + "problemId": "21942", + "problemLevel": 14, + "problemName": "부품 대여장", + "average_try": 4, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 136, + "key": "hash_set" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 96, + "key": "parsing" + }, + { + "bojTagId": 158, + "key": "string" + }, + { + "bojTagId": 74, + "key": "tree_set" + } + ], + "lastupdate": 1640720099.505695 + }, + "21944": { + "problemId": "21944", + "problemLevel": 13, + "problemName": "문제 추천 시스템 Version 2", + "average_try": 4.5686, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 74, + "key": "tree_set" + } + ], + "lastupdate": 1640720099.50572 + }, + "1717": { + "problemId": "1717", + "problemLevel": 12, + "problemName": "집합의 표현", + "average_try": 3.5231, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 81, + "key": "disjoint_set" + } + ], + "lastupdate": 1640720099.506155 + }, + "1976": { + "problemId": "1976", + "problemLevel": 12, + "problemName": "여행 가자", + "average_try": 2.6397, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 81, + "key": "disjoint_set" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.506188 + }, + "16562": { + "problemId": "16562", + "problemLevel": 13, + "problemName": "친구비", + "average_try": 2.3051, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 81, + "key": "disjoint_set" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.506216 + }, + "4195": { + "problemId": "4195", + "problemLevel": 14, + "problemName": "친구 네트워크", + "average_try": 4.0153, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 81, + "key": "disjoint_set" + }, + { + "bojTagId": 136, + "key": "hash_set" + } + ], + "lastupdate": 1640720099.506242 + }, + "10775": { + "problemId": "10775", + "problemLevel": 14, + "problemName": "공항", + "average_try": 2.7261, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 81, + "key": "disjoint_set" + }, + { + "bojTagId": 33, + "key": "greedy" + } + ], + "lastupdate": 1640720099.506266 + }, + "20040": { + "problemId": "20040", + "problemLevel": 12, + "problemName": "사이클 게임", + "average_try": 1.8708, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 81, + "key": "disjoint_set" + } + ], + "lastupdate": 1640720099.506291 + }, + "11085": { + "problemId": "11085", + "problemLevel": 13, + "problemName": "군사 이동", + "average_try": 1.5749, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 81, + "key": "disjoint_set" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.506315 + }, + "17398": { + "problemId": "17398", + "problemLevel": 15, + "problemName": "통신망 분할", + "average_try": 2.8235, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 81, + "key": "disjoint_set" + } + ], + "lastupdate": 1640720099.506339 + }, + "17352": { + "problemId": "17352", + "problemLevel": 11, + "problemName": "여러분의 다리가 되어 드리겠습니다!", + "average_try": 1.9608, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 81, + "key": "disjoint_set" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.506363 + }, + "12893": { + "problemId": "12893", + "problemLevel": 12, + "problemName": "적의 적", + "average_try": 2.8782, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 81, + "key": "disjoint_set" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.506387 + }, + "1043": { + "problemId": "1043", + "problemLevel": 12, + "problemName": "거짓말", + "average_try": 2.4401, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 81, + "key": "disjoint_set" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.506411 + }, + "16168": { + "problemId": "16168", + "problemLevel": 12, + "problemName": "퍼레이드", + "average_try": 3.0754, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 81, + "key": "disjoint_set" + }, + { + "bojTagId": 93, + "key": "eulerian_path" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.506435 + }, + "7511": { + "problemId": "7511", + "problemLevel": 11, + "problemName": "소셜 네트워킹 어플리케이션", + "average_try": 2.2722, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 81, + "key": "disjoint_set" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.506458 + }, + "3108": { + "problemId": "3108", + "problemLevel": 13, + "problemName": "로고", + "average_try": 3.4698, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 81, + "key": "disjoint_set" + }, + { + "bojTagId": 100, + "key": "geometry" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.506504 + }, + "15789": { + "problemId": "15789", + "problemLevel": 13, + "problemName": "CTP 왕국은 한솔 왕국을 이길 수 있을까?", + "average_try": 2.3024, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 81, + "key": "disjoint_set" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.506528 + }, + "18116": { + "problemId": "18116", + "problemLevel": 13, + "problemName": "로봇 조립", + "average_try": 3.4872, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 81, + "key": "disjoint_set" + } + ], + "lastupdate": 1640720099.506552 + }, + "17090": { + "problemId": "17090", + "problemLevel": 14, + "problemName": "미로 탈출하기", + "average_try": 3.0621, + "solvedtags": [ + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.506576 + }, + "16724": { + "problemId": "16724", + "problemLevel": 14, + "problemName": "피리 부는 사나이", + "average_try": 2.4238, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 81, + "key": "disjoint_set" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.506599 + }, + "14595": { + "problemId": "14595", + "problemLevel": 14, + "problemName": "동방 프로젝트 (Large)", + "average_try": 2.5337, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 81, + "key": "disjoint_set" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.506622 + }, + "2630": { + "problemId": "2630", + "problemLevel": 8, + "problemName": "색종이 만들기", + "average_try": 1.4354, + "solvedtags": [ + { + "bojTagId": 24, + "key": "divide_and_conquer" + }, + { + "bojTagId": 62, + "key": "recursion" + } + ], + "lastupdate": 1640720099.507026 + }, + "4779": { + "problemId": "4779", + "problemLevel": 8, + "problemName": "칸토어 집합", + "average_try": 2.1753, + "solvedtags": [ + { + "bojTagId": 24, + "key": "divide_and_conquer" + }, + { + "bojTagId": 62, + "key": "recursion" + } + ], + "lastupdate": 1640720099.507059 + }, + "1780": { + "problemId": "1780", + "problemLevel": 9, + "problemName": "종이의 개수", + "average_try": 1.7019, + "solvedtags": [ + { + "bojTagId": 24, + "key": "divide_and_conquer" + }, + { + "bojTagId": 62, + "key": "recursion" + } + ], + "lastupdate": 1640720099.507086 + }, + "17829": { + "problemId": "17829", + "problemLevel": 9, + "problemName": "222-풀링", + "average_try": 1.3642, + "solvedtags": [ + { + "bojTagId": 24, + "key": "divide_and_conquer" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.507112 + }, + "18222": { + "problemId": "18222", + "problemLevel": 9, + "problemName": "투에-모스 문자열", + "average_try": 2.453, + "solvedtags": [ + { + "bojTagId": 24, + "key": "divide_and_conquer" + }, + { + "bojTagId": 62, + "key": "recursion" + } + ], + "lastupdate": 1640720099.507137 + }, + "1802": { + "problemId": "1802", + "problemLevel": 9, + "problemName": "종이 접기", + "average_try": 3.1152, + "solvedtags": [ + { + "bojTagId": 24, + "key": "divide_and_conquer" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.507162 + }, + "2447": { + "problemId": "2447", + "problemLevel": 10, + "problemName": "별 찍기 - 10", + "average_try": 1.921, + "solvedtags": [ + { + "bojTagId": 24, + "key": "divide_and_conquer" + }, + { + "bojTagId": 62, + "key": "recursion" + } + ], + "lastupdate": 1640720099.507186 + }, + "1992": { + "problemId": "1992", + "problemLevel": 10, + "problemName": "쿼드트리", + "average_try": 1.6538, + "solvedtags": [ + { + "bojTagId": 24, + "key": "divide_and_conquer" + }, + { + "bojTagId": 62, + "key": "recursion" + } + ], + "lastupdate": 1640720099.50721 + }, + "1074": { + "problemId": "1074", + "problemLevel": 10, + "problemName": "Z", + "average_try": 2.7126, + "solvedtags": [ + { + "bojTagId": 24, + "key": "divide_and_conquer" + }, + { + "bojTagId": 62, + "key": "recursion" + } + ], + "lastupdate": 1640720099.507234 + }, + "5904": { + "problemId": "5904", + "problemLevel": 10, + "problemName": "Moo 게임", + "average_try": 2.7539, + "solvedtags": [ + { + "bojTagId": 24, + "key": "divide_and_conquer" + }, + { + "bojTagId": 62, + "key": "recursion" + } + ], + "lastupdate": 1640720099.507258 + }, + "1493": { + "problemId": "1493", + "problemLevel": 12, + "problemName": "박스 채우기", + "average_try": 3.8116, + "solvedtags": [ + { + "bojTagId": 24, + "key": "divide_and_conquer" + }, + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.507282 + }, + "2374": { + "problemId": "2374", + "problemLevel": 12, + "problemName": "같은 수로 만들기", + "average_try": 2.6579, + "solvedtags": [ + { + "bojTagId": 24, + "key": "divide_and_conquer" + }, + { + "bojTagId": 33, + "key": "greedy" + } + ], + "lastupdate": 1640720099.507306 + }, + "14600": { + "problemId": "14600", + "problemLevel": 11, + "problemName": "샤워실 바닥 깔기 (Small)", + "average_try": 1.3915, + "solvedtags": [ + { + "bojTagId": 24, + "key": "divide_and_conquer" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.507353 + }, + "1030": { + "problemId": "1030", + "problemLevel": 13, + "problemName": "프렉탈 평면", + "average_try": 2.3232, + "solvedtags": [ + { + "bojTagId": 24, + "key": "divide_and_conquer" + }, + { + "bojTagId": 62, + "key": "recursion" + } + ], + "lastupdate": 1640720099.507376 + }, + "16438": { + "problemId": "16438", + "problemLevel": 13, + "problemName": "원숭이 스포츠", + "average_try": 2.019, + "solvedtags": [ + { + "bojTagId": 24, + "key": "divide_and_conquer" + } + ], + "lastupdate": 1640720099.507399 + }, + "14601": { + "problemId": "14601", + "problemLevel": 15, + "problemName": "샤워실 바닥 깔기 (Large)", + "average_try": 1.7368, + "solvedtags": [ + { + "bojTagId": 24, + "key": "divide_and_conquer" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 62, + "key": "recursion" + } + ], + "lastupdate": 1640720099.507423 + }, + "2448": { + "problemId": "2448", + "problemLevel": 12, + "problemName": "별 찍기 - 11", + "average_try": 2.6101, + "solvedtags": [ + { + "bojTagId": 24, + "key": "divide_and_conquer" + }, + { + "bojTagId": 62, + "key": "recursion" + } + ], + "lastupdate": 1640720099.507446 + }, + "10870": { + "problemId": "10870", + "problemLevel": 4, + "problemName": "피보나치 수 5", + "average_try": 1.5862, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.507835 + }, + "2839": { + "problemId": "2839", + "problemLevel": 5, + "problemName": "설탕 배달", + "average_try": 2.9255, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.507867 + }, + "2748": { + "problemId": "2748", + "problemLevel": 5, + "problemName": "피보나치 수 2", + "average_try": 2.5318, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.507894 + }, + "1010": { + "problemId": "1010", + "problemLevel": 6, + "problemName": "다리 놓기", + "average_try": 2.0772, + "solvedtags": [ + { + "bojTagId": 6, + "key": "combinatorics" + }, + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.507921 + }, + "9655": { + "problemId": "9655", + "problemLevel": 6, + "problemName": "돌 게임", + "average_try": 1.5008, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 140, + "key": "game_theory" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.507946 + }, + "17626": { + "problemId": "17626", + "problemLevel": 7, + "problemName": "Four Squares", + "average_try": 2.0324, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.50797 + }, + "15489": { + "problemId": "15489", + "problemLevel": 6, + "problemName": "파스칼 삼각형", + "average_try": 1.6642, + "solvedtags": [ + { + "bojTagId": 6, + "key": "combinatorics" + }, + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.507994 + }, + "14501": { + "problemId": "14501", + "problemLevel": 8, + "problemName": "퇴사", + "average_try": 2.0688, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508019 + }, + "2670": { + "problemId": "2670", + "problemLevel": 7, + "problemName": "연속부분최대곱", + "average_try": 2.7562, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508043 + }, + "13699": { + "problemId": "13699", + "problemLevel": 7, + "problemName": "점화식", + "average_try": 1.3344, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508067 + }, + "1463": { + "problemId": "1463", + "problemLevel": 8, + "problemName": "1로 만들기", + "average_try": 3.1362, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508091 + }, + "9095": { + "problemId": "9095", + "problemLevel": 8, + "problemName": "1, 2, 3 더하기", + "average_try": 1.5915, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508115 + }, + "1003": { + "problemId": "1003", + "problemLevel": 8, + "problemName": "피보나치 함수", + "average_try": 3.2522, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508138 + }, + "11726": { + "problemId": "11726", + "problemLevel": 8, + "problemName": "2×n 타일링", + "average_try": 2.8227, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508162 + }, + "2579": { + "problemId": "2579", + "problemLevel": 8, + "problemName": "계단 오르기", + "average_try": 2.8937, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508185 + }, + "2193": { + "problemId": "2193", + "problemLevel": 8, + "problemName": "이친수", + "average_try": 2.5608, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508208 + }, + "11727": { + "problemId": "11727", + "problemLevel": 8, + "problemName": "2×n 타일링 2", + "average_try": 1.6871, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508231 + }, + "9461": { + "problemId": "9461", + "problemLevel": 8, + "problemName": "파도반 수열", + "average_try": 2.4155, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.508254 + }, + "1699": { + "problemId": "1699", + "problemLevel": 8, + "problemName": "제곱수의 합", + "average_try": 2.5496, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.508277 + }, + "15990": { + "problemId": "15990", + "problemLevel": 9, + "problemName": "1, 2, 3 더하기 5", + "average_try": 3.1867, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.5083 + }, + "10211": { + "problemId": "10211", + "problemLevel": 8, + "problemName": "Maximum Subarray", + "average_try": 2.3679, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.508323 + }, + "17175": { + "problemId": "17175", + "problemLevel": 8, + "problemName": "피보나치는 지겨웡~", + "average_try": 2.2972, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508346 + }, + "15624": { + "problemId": "15624", + "problemLevel": 7, + "problemName": "피보나치 수 7", + "average_try": 1.7916, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.508369 + }, + "17212": { + "problemId": "17212", + "problemLevel": 8, + "problemName": "달나라 토끼를 위한 구매대금 지불 도우미", + "average_try": 2.0115, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508392 + }, + "2876": { + "problemId": "2876", + "problemLevel": 9, + "problemName": "그래픽스 퀴즈", + "average_try": 2.1126, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508415 + }, + "20152": { + "problemId": "20152", + "problemLevel": 8, + "problemName": "Game Addiction", + "average_try": 2.1944, + "solvedtags": [ + { + "bojTagId": 6, + "key": "combinatorics" + }, + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.508438 + }, + "11053": { + "problemId": "11053", + "problemLevel": 9, + "problemName": "가장 긴 증가하는 부분 수열", + "average_try": 2.6922, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.50846 + }, + "1912": { + "problemId": "1912", + "problemLevel": 9, + "problemName": "연속합", + "average_try": 3.1007, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508483 + }, + "9465": { + "problemId": "9465", + "problemLevel": 10, + "problemName": "스티커", + "average_try": 2.1173, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508506 + }, + "11055": { + "problemId": "11055", + "problemLevel": 9, + "problemName": "가장 큰 증가 부분 수열", + "average_try": 2.2097, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.50853 + }, + "11722": { + "problemId": "11722", + "problemLevel": 9, + "problemName": "가장 긴 감소하는 부분 수열", + "average_try": 1.5509, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508553 + }, + "1890": { + "problemId": "1890", + "problemLevel": 9, + "problemName": "점프", + "average_try": 3.4713, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508576 + }, + "1965": { + "problemId": "1965", + "problemLevel": 9, + "problemName": "상자넣기", + "average_try": 2.0555, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508599 + }, + "2407": { + "problemId": "2407", + "problemLevel": 8, + "problemName": "조합", + "average_try": 2.6335, + "solvedtags": [ + { + "bojTagId": 117, + "key": "arbitrary_precision" + }, + { + "bojTagId": 6, + "key": "combinatorics" + }, + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.508622 + }, + "11060": { + "problemId": "11060", + "problemLevel": 9, + "problemName": "점프 점프", + "average_try": 2.8746, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.508645 + }, + "15988": { + "problemId": "15988", + "problemLevel": 9, + "problemName": "1, 2, 3 더하기 3", + "average_try": 2.8389, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508668 + }, + "2491": { + "problemId": "2491", + "problemLevel": 8, + "problemName": "수열", + "average_try": 3.1957, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.50869 + }, + "15486": { + "problemId": "15486", + "problemLevel": 10, + "problemName": "퇴사 2", + "average_try": 2.6157, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508713 + }, + "1660": { + "problemId": "1660", + "problemLevel": 9, + "problemName": "캡틴 이다솜", + "average_try": 3.0009, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508736 + }, + "14852": { + "problemId": "14852", + "problemLevel": 11, + "problemName": "타일 채우기 3", + "average_try": 4.0056, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508758 + }, + "14430": { + "problemId": "14430", + "problemLevel": 9, + "problemName": "자원 캐기", + "average_try": 1.848, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508781 + }, + "1633": { + "problemId": "1633", + "problemLevel": 10, + "problemName": "최고의 팀 만들기", + "average_try": 2.3171, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508805 + }, + "18353": { + "problemId": "18353", + "problemLevel": 9, + "problemName": "병사 배치하기", + "average_try": 2.4133, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 43, + "key": "lis" + } + ], + "lastupdate": 1640720099.508828 + }, + "1106": { + "problemId": "1106", + "problemLevel": 10, + "problemName": "호텔", + "average_try": 3.4405, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 148, + "key": "knapsack" + } + ], + "lastupdate": 1640720099.508851 + }, + "17291": { + "problemId": "17291", + "problemLevel": 9, + "problemName": "새끼치기", + "average_try": 2.2111, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.508874 + }, + "4097": { + "problemId": "4097", + "problemLevel": 9, + "problemName": "수익", + "average_try": 1.9882, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508896 + }, + "20162": { + "problemId": "20162", + "problemLevel": 9, + "problemName": "간식 파티", + "average_try": 1.8014, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508918 + }, + "1149": { + "problemId": "1149", + "problemLevel": 10, + "problemName": "RGB거리", + "average_try": 2.029, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508941 + }, + "1932": { + "problemId": "1932", + "problemLevel": 10, + "problemName": "정수 삼각형", + "average_try": 1.707, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508963 + }, + "2156": { + "problemId": "2156", + "problemLevel": 10, + "problemName": "포도주 시식", + "average_try": 3.0448, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.508986 + }, + "10844": { + "problemId": "10844", + "problemLevel": 10, + "problemName": "쉬운 계단 수", + "average_try": 3.4485, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.509008 + }, + "11052": { + "problemId": "11052", + "problemLevel": 10, + "problemName": "카드 구매하기", + "average_try": 1.6489, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.509035 + }, + "11057": { + "problemId": "11057", + "problemLevel": 10, + "problemName": "오르막 수", + "average_try": 2.1164, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.509058 + }, + "2293": { + "problemId": "2293", + "problemLevel": 11, + "problemName": "동전 1", + "average_try": 2.2401, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.509081 + }, + "11051": { + "problemId": "11051", + "problemLevel": 10, + "problemName": "이항 계수 2", + "average_try": 2.6061, + "solvedtags": [ + { + "bojTagId": 6, + "key": "combinatorics" + }, + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.509103 + }, + "11048": { + "problemId": "11048", + "problemLevel": 10, + "problemName": "이동하기", + "average_try": 1.7322, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.509126 + }, + "2294": { + "problemId": "2294", + "problemLevel": 10, + "problemName": "동전 2", + "average_try": 3.5122, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.509149 + }, + "1309": { + "problemId": "1309", + "problemLevel": 10, + "problemName": "동물원", + "average_try": 2.0686, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.509172 + }, + "2565": { + "problemId": "2565", + "problemLevel": 11, + "problemName": "전깃줄", + "average_try": 2.1398, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.509238 + }, + "2011": { + "problemId": "2011", + "problemLevel": 10, + "problemName": "암호코드", + "average_try": 5.0847, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.509264 + }, + "10164": { + "problemId": "10164", + "problemLevel": 10, + "problemName": "격자상의 경로", + "average_try": 2.913, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.509311 + }, + "16194": { + "problemId": "16194", + "problemLevel": 10, + "problemName": "카드 구매하기 2", + "average_try": 1.3186, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.509335 + }, + "19622": { + "problemId": "19622", + "problemLevel": 9, + "problemName": "회의실 배정 3", + "average_try": 2.1908, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.509358 + }, + "15989": { + "problemId": "15989", + "problemLevel": 10, + "problemName": "1, 2, 3 더하기 4", + "average_try": 1.5299, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.509384 + }, + "12101": { + "problemId": "12101", + "problemLevel": 10, + "problemName": "1, 2, 3 더하기 2", + "average_try": 1.5682, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + } + ], + "lastupdate": 1640720099.509408 + }, + "15992": { + "problemId": "15992", + "problemLevel": 10, + "problemName": "1, 2, 3 더하기 7", + "average_try": 1.8158, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.509432 + }, + "15991": { + "problemId": "15991", + "problemLevel": 10, + "problemName": "1, 2, 3 더하기 6", + "average_try": 2.101, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.509455 + }, + "16195": { + "problemId": "16195", + "problemLevel": 10, + "problemName": "1, 2, 3 더하기 9", + "average_try": 1.8348, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.509479 + }, + "15993": { + "problemId": "15993", + "problemLevel": 10, + "problemName": "1, 2, 3 더하기 8", + "average_try": 1.7422, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.509502 + }, + "1495": { + "problemId": "1495", + "problemLevel": 10, + "problemName": "기타리스트", + "average_try": 2.9056, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.509525 + }, + "2302": { + "problemId": "2302", + "problemLevel": 10, + "problemName": "극장 좌석", + "average_try": 2.328, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.509548 + }, + "11568": { + "problemId": "11568", + "problemLevel": 10, + "problemName": "민균이의 계략", + "average_try": 1.7211, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 43, + "key": "lis" + } + ], + "lastupdate": 1640720099.509571 + }, + "12026": { + "problemId": "12026", + "problemLevel": 10, + "problemName": "BOJ 거리", + "average_try": 1.6398, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.509593 + }, + "14722": { + "problemId": "14722", + "problemLevel": 12, + "problemName": "우유 도시", + "average_try": 3.0714, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.509616 + }, + "13910": { + "problemId": "13910", + "problemLevel": 10, + "problemName": "개업", + "average_try": 2.8222, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.50964 + }, + "21317": { + "problemId": "21317", + "problemLevel": 10, + "problemName": "징검다리 건너기", + "average_try": 2.8608, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.509663 + }, + "22857": { + "problemId": "22857", + "problemLevel": 8, + "problemName": "가장 긴 짝수 연속한 부분 수열 (small)", + "average_try": 1.7463, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.509686 + }, + "22869": { + "problemId": "22869", + "problemLevel": 10, + "problemName": "징검다리 건너기 (small)", + "average_try": 1.9574, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.509712 + }, + "22871": { + "problemId": "22871", + "problemLevel": 10, + "problemName": "징검다리 건너기 (large)", + "average_try": 2.8205, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.509738 + }, + "1535": { + "problemId": "1535", + "problemLevel": 9, + "problemName": "안녕", + "average_try": 1.9894, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 148, + "key": "knapsack" + } + ], + "lastupdate": 1640720099.511126 + }, + "9084": { + "problemId": "9084", + "problemLevel": 11, + "problemName": "동전", + "average_try": 1.5491, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 148, + "key": "knapsack" + } + ], + "lastupdate": 1640720099.511158 + }, + "3067": { + "problemId": "3067", + "problemLevel": 11, + "problemName": "Coins", + "average_try": 1.3772, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 148, + "key": "knapsack" + } + ], + "lastupdate": 1640720099.511183 + }, + "12865": { + "problemId": "12865", + "problemLevel": 11, + "problemName": "평범한 배낭", + "average_try": 2.8057, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 148, + "key": "knapsack" + } + ], + "lastupdate": 1640720099.511206 + }, + "14728": { + "problemId": "14728", + "problemLevel": 11, + "problemName": "벼락치기", + "average_try": 2.1585, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 148, + "key": "knapsack" + } + ], + "lastupdate": 1640720099.511228 + }, + "17845": { + "problemId": "17845", + "problemLevel": 11, + "problemName": "수강 과목", + "average_try": 1.7305, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 148, + "key": "knapsack" + } + ], + "lastupdate": 1640720099.51125 + }, + "17208": { + "problemId": "17208", + "problemLevel": 12, + "problemName": "카우버거 알바생", + "average_try": 2.5721, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 148, + "key": "knapsack" + } + ], + "lastupdate": 1640720099.511272 + }, + "18427": { + "problemId": "18427", + "problemLevel": 12, + "problemName": "함께 블록 쌓기", + "average_try": 2.736, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 148, + "key": "knapsack" + } + ], + "lastupdate": 1640720099.511293 + }, + "7579": { + "problemId": "7579", + "problemLevel": 13, + "problemName": "앱", + "average_try": 2.6871, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 148, + "key": "knapsack" + } + ], + "lastupdate": 1640720099.511314 + }, + "2629": { + "problemId": "2629", + "problemLevel": 14, + "problemName": "양팔저울", + "average_try": 3.3912, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 148, + "key": "knapsack" + } + ], + "lastupdate": 1640720099.511336 + }, + "19645": { + "problemId": "19645", + "problemLevel": 15, + "problemName": "햄최몇?", + "average_try": 2.2609, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 148, + "key": "knapsack" + } + ], + "lastupdate": 1640720099.511357 + }, + "20667": { + "problemId": "20667", + "problemLevel": 15, + "problemName": "크롬", + "average_try": 4.918, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 148, + "key": "knapsack" + } + ], + "lastupdate": 1640720099.511378 + }, + "9251": { + "problemId": "9251", + "problemLevel": 11, + "problemName": "LCS", + "average_try": 2.4679, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.511399 + }, + "2225": { + "problemId": "2225", + "problemLevel": 11, + "problemName": "합분해", + "average_try": 2.3969, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.51142 + }, + "1915": { + "problemId": "1915", + "problemLevel": 12, + "problemName": "가장 큰 정사각형", + "average_try": 3.4216, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.511441 + }, + "17070": { + "problemId": "17070", + "problemLevel": 11, + "problemName": "파이프 옮기기 1", + "average_try": 2.1032, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.511462 + }, + "5557": { + "problemId": "5557", + "problemLevel": 11, + "problemName": "1학년", + "average_try": 2.5352, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.511483 + }, + "2631": { + "problemId": "2631", + "problemLevel": 11, + "problemName": "줄세우기", + "average_try": 1.5599, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.511504 + }, + "14226": { + "problemId": "14226", + "problemLevel": 11, + "problemName": "이모티콘", + "average_try": 2.9192, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.511524 + }, + "5582": { + "problemId": "5582", + "problemLevel": 11, + "problemName": "공통 부분 문자열", + "average_try": 2.3149, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.511555 + }, + "13398": { + "problemId": "13398", + "problemLevel": 11, + "problemName": "연속합 2", + "average_try": 3.4444, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.511579 + }, + "4811": { + "problemId": "4811", + "problemLevel": 11, + "problemName": "알약", + "average_try": 1.5657, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.511601 + }, + "2688": { + "problemId": "2688", + "problemLevel": 11, + "problemName": "줄어들지 않아", + "average_try": 1.947, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.511624 + }, + "2624": { + "problemId": "2624", + "problemLevel": 11, + "problemName": "동전 바꿔주기", + "average_try": 2.0484, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.511647 + }, + "13302": { + "problemId": "13302", + "problemLevel": 11, + "problemName": "리조트", + "average_try": 2.2368, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.511671 + }, + "2228": { + "problemId": "2228", + "problemLevel": 11, + "problemName": "구간 나누기", + "average_try": 3.4135, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.511694 + }, + "17069": { + "problemId": "17069", + "problemLevel": 11, + "problemName": "파이프 옮기기 2", + "average_try": 1.7797, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.511718 + }, + "2229": { + "problemId": "2229", + "problemLevel": 11, + "problemName": "조 짜기", + "average_try": 1.6526, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.511741 + }, + "5569": { + "problemId": "5569", + "problemLevel": 11, + "problemName": "출근 경로", + "average_try": 2.1364, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.511765 + }, + "5624": { + "problemId": "5624", + "problemLevel": 12, + "problemName": "좋은 수", + "average_try": 3.1357, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.511787 + }, + "14925": { + "problemId": "14925", + "problemLevel": 12, + "problemName": "목장 건설하기", + "average_try": 2.475, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.51181 + }, + "14699": { + "problemId": "14699", + "problemLevel": 11, + "problemName": "관악산 등산", + "average_try": 2.0607, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.511833 + }, + "17265": { + "problemId": "17265", + "problemLevel": 11, + "problemName": "나의 인생에는 수학과 함께", + "average_try": 1.9597, + "solvedtags": [ + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.511881 + }, + "1757": { + "problemId": "1757", + "problemLevel": 11, + "problemName": "달려달려", + "average_try": 2.606, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.511904 + }, + "4095": { + "problemId": "4095", + "problemLevel": 11, + "problemName": "최대 정사각형", + "average_try": 2.4066, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.511928 + }, + "2758": { + "problemId": "2758", + "problemLevel": 12, + "problemName": "로또", + "average_try": 4.2602, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.511951 + }, + "10653": { + "problemId": "10653", + "problemLevel": 12, + "problemName": "마라톤 2", + "average_try": 2.5934, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.511975 + }, + "16400": { + "problemId": "16400", + "problemLevel": 11, + "problemName": "소수 화폐", + "average_try": 2.0293, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + }, + { + "bojTagId": 9, + "key": "primality_test" + }, + { + "bojTagId": 67, + "key": "sieve" + } + ], + "lastupdate": 1640720099.512003 + }, + "17216": { + "problemId": "17216", + "problemLevel": 10, + "problemName": "가장 큰 감소 부분 수열", + "average_try": 1.7572, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.512026 + }, + "11985": { + "problemId": "11985", + "problemLevel": 11, + "problemName": "오렌지 출하", + "average_try": 1.9096, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.512049 + }, + "17485": { + "problemId": "17485", + "problemLevel": 11, + "problemName": "진우의 달 여행 (Large)", + "average_try": 2.3419, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.512073 + }, + "15724": { + "problemId": "15724", + "problemLevel": 10, + "problemName": "주지수", + "average_try": 2.4159, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.512097 + }, + "17255": { + "problemId": "17255", + "problemLevel": 12, + "problemName": "N으로 만들기", + "average_try": 2.2597, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 74, + "key": "tree_set" + } + ], + "lastupdate": 1640720099.512143 + }, + "2073": { + "problemId": "2073", + "problemLevel": 11, + "problemName": "수도배관공사", + "average_try": 2.8069, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 148, + "key": "knapsack" + } + ], + "lastupdate": 1640720099.512166 + }, + "1520": { + "problemId": "1520", + "problemLevel": 12, + "problemName": "내리막 길", + "average_try": 3.5444, + "solvedtags": [ + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.51219 + }, + "2602": { + "problemId": "2602", + "problemLevel": 12, + "problemName": "돌다리 건너기", + "average_try": 2.0767, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.512238 + }, + "2616": { + "problemId": "2616", + "problemLevel": 12, + "problemName": "소형기관차", + "average_try": 2.356, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.512261 + }, + "17404": { + "problemId": "17404", + "problemLevel": 12, + "problemName": "RGB거리 2", + "average_try": 1.8366, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.512284 + }, + "1695": { + "problemId": "1695", + "problemLevel": 12, + "problemName": "팰린드롬 만들기", + "average_try": 2.7136, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.512307 + }, + "2157": { + "problemId": "2157", + "problemLevel": 12, + "problemName": "여행", + "average_try": 4.854, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.51233 + }, + "14863": { + "problemId": "14863", + "problemLevel": 12, + "problemName": "서울에서 경산까지", + "average_try": 3.3814, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.512353 + }, + "1577": { + "problemId": "1577", + "problemLevel": 12, + "problemName": "도로의 개수", + "average_try": 3.6485, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.512376 + }, + "2411": { + "problemId": "2411", + "problemLevel": 12, + "problemName": "아이템 먹기", + "average_try": 2.4323, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.512424 + }, + "1301": { + "problemId": "1301", + "problemLevel": 12, + "problemName": "비즈 공예", + "average_try": 3.3447, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.512448 + }, + "2253": { + "problemId": "2253", + "problemLevel": 12, + "problemName": "점프", + "average_try": 3.9073, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.512471 + }, + "13902": { + "problemId": "13902", + "problemLevel": 12, + "problemName": "개업 2", + "average_try": 4.4493, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.512494 + }, + "13707": { + "problemId": "13707", + "problemLevel": 12, + "problemName": "합분해 2", + "average_try": 2.1144, + "solvedtags": [ + { + "bojTagId": 6, + "key": "combinatorics" + }, + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.512517 + }, + "14945": { + "problemId": "14945", + "problemLevel": 12, + "problemName": "불장난", + "average_try": 1.6975, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.51254 + }, + "1943": { + "problemId": "1943", + "problemLevel": 13, + "problemName": "동전 분배", + "average_try": 5.2134, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 148, + "key": "knapsack" + } + ], + "lastupdate": 1640720099.512563 + }, + "20542": { + "problemId": "20542", + "problemLevel": 12, + "problemName": "받아쓰기", + "average_try": 2.2243, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.512586 + }, + "11054": { + "problemId": "11054", + "problemLevel": 13, + "problemName": "가장 긴 바이토닉 부분 수열", + "average_try": 1.9595, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.51261 + }, + "1937": { + "problemId": "1937", + "problemLevel": 13, + "problemName": "욕심쟁이 판다", + "average_try": 3.3575, + "solvedtags": [ + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.512657 + }, + "11066": { + "problemId": "11066", + "problemLevel": 13, + "problemName": "파일 합치기", + "average_try": 1.9678, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.51268 + }, + "11049": { + "problemId": "11049", + "problemLevel": 13, + "problemName": "행렬 곱셈 순서", + "average_try": 2.271, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.512703 + }, + "1958": { + "problemId": "1958", + "problemLevel": 13, + "problemName": "LCS 3", + "average_try": 1.9742, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.51275 + }, + "1727": { + "problemId": "1727", + "problemLevel": 13, + "problemName": "커플 만들기", + "average_try": 3.4155, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.512773 + }, + "1823": { + "problemId": "1823", + "problemLevel": 13, + "problemName": "수확", + "average_try": 2.211, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.512796 + }, + "10942": { + "problemId": "10942", + "problemLevel": 13, + "problemName": "팰린드롬?", + "average_try": 3.4356, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.512819 + }, + "3687": { + "problemId": "3687", + "problemLevel": 14, + "problemName": "성냥개비", + "average_try": 2.8823, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 33, + "key": "greedy" + } + ], + "lastupdate": 1640720099.512866 + }, + "12015": { + "problemId": "12015", + "problemLevel": 14, + "problemName": "가장 긴 증가하는 부분 수열 2", + "average_try": 2.3129, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 43, + "key": "lis" + } + ], + "lastupdate": 1640720099.51289 + }, + "11909": { + "problemId": "11909", + "problemLevel": 11, + "problemName": "배열 탈출", + "average_try": 2.1739, + "solvedtags": [ + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.512913 + }, + "21923": { + "problemId": "21923", + "problemLevel": 12, + "problemName": "곡예 비행", + "average_try": 2.1786, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + } + ], + "lastupdate": 1640720099.51296 + }, + "21941": { + "problemId": "21941", + "problemLevel": 11, + "problemName": "문자열 제거", + "average_try": 3.1915, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.512983 + }, + "17831": { + "problemId": "17831", + "problemLevel": 16, + "problemName": "대기업 승범이네", + "average_try": 2.2121, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 92, + "key": "dp_tree" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.514178 + }, + "1135": { + "problemId": "1135", + "problemLevel": 15, + "problemName": "뉴스 전하기", + "average_try": 2.4693, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 92, + "key": "dp_tree" + }, + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.514202 + }, + "1260": { + "problemId": "1260", + "problemLevel": 9, + "problemName": "DFS와 BFS", + "average_try": 2.903, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.514526 + }, + "2606": { + "problemId": "2606", + "problemLevel": 8, + "problemName": "바이러스", + "average_try": 2.1993, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.51456 + }, + "1012": { + "problemId": "1012", + "problemLevel": 9, + "problemName": "유기농 배추", + "average_try": 2.7389, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.514587 + }, + "11724": { + "problemId": "11724", + "problemLevel": 9, + "problemName": "연결 요소의 개수", + "average_try": 2.2817, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.514612 + }, + "4963": { + "problemId": "4963", + "problemLevel": 9, + "problemName": "섬의 개수", + "average_try": 2.0345, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.514637 + }, + "7562": { + "problemId": "7562", + "problemLevel": 9, + "problemName": "나이트의 이동", + "average_try": 2.0855, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.514662 + }, + "2644": { + "problemId": "2644", + "problemLevel": 9, + "problemName": "촌수계산", + "average_try": 2.1518, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.514686 + }, + "1325": { + "problemId": "1325", + "problemLevel": 10, + "problemName": "효율적인 해킹", + "average_try": 5.0424, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.514734 + }, + "3184": { + "problemId": "3184", + "problemLevel": 9, + "problemName": "양", + "average_try": 1.5878, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.514877 + }, + "16928": { + "problemId": "16928", + "problemLevel": 10, + "problemName": "뱀과 사다리 게임", + "average_try": 2.8658, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.514959 + }, + "13565": { + "problemId": "13565", + "problemLevel": 9, + "problemName": "침투", + "average_try": 2.2504, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.514982 + }, + "12761": { + "problemId": "12761", + "problemLevel": 9, + "problemName": "돌다리", + "average_try": 1.9236, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515005 + }, + "3187": { + "problemId": "3187", + "problemLevel": 9, + "problemName": "양치기 꿍", + "average_try": 1.5165, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515027 + }, + "18232": { + "problemId": "18232", + "problemLevel": 9, + "problemName": "텔레포트 정거장", + "average_try": 2.8712, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515049 + }, + "14248": { + "problemId": "14248", + "problemLevel": 9, + "problemName": "점프 점프", + "average_try": 1.5647, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.51507 + }, + "2178": { + "problemId": "2178", + "problemLevel": 10, + "problemName": "미로 탐색", + "average_try": 2.5182, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515092 + }, + "2667": { + "problemId": "2667", + "problemLevel": 10, + "problemName": "단지번호붙이기", + "average_try": 2.5076, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515114 + }, + "7576": { + "problemId": "7576", + "problemLevel": 10, + "problemName": "토마토", + "average_try": 2.9217, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515135 + }, + "1697": { + "problemId": "1697", + "problemLevel": 10, + "problemName": "숨바꼭질", + "average_try": 3.9995, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515156 + }, + "2583": { + "problemId": "2583", + "problemLevel": 10, + "problemName": "영역 구하기", + "average_try": 1.7733, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515177 + }, + "7569": { + "problemId": "7569", + "problemLevel": 10, + "problemName": "토마토", + "average_try": 2.4488, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515198 + }, + "5567": { + "problemId": "5567", + "problemLevel": 9, + "problemName": "결혼식", + "average_try": 2.3669, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.51522 + }, + "1926": { + "problemId": "1926", + "problemLevel": 10, + "problemName": "그림", + "average_try": 2.3338, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515255 + }, + "1743": { + "problemId": "1743", + "problemLevel": 10, + "problemName": "음식물 피하기", + "average_try": 2.1134, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515283 + }, + "6118": { + "problemId": "6118", + "problemLevel": 10, + "problemName": "숨바꼭질", + "average_try": 1.9794, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515309 + }, + "16948": { + "problemId": "16948", + "problemLevel": 10, + "problemName": "데스 나이트", + "average_try": 1.4321, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515364 + }, + "16918": { + "problemId": "16918", + "problemLevel": 10, + "problemName": "봄버맨", + "average_try": 2.3685, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.515399 + }, + "18405": { + "problemId": "18405", + "problemLevel": 10, + "problemName": "경쟁적 전염", + "average_try": 3.5003, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.515423 + }, + "15558": { + "problemId": "15558", + "problemLevel": 10, + "problemName": "점프 게임", + "average_try": 3.1347, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515446 + }, + "1303": { + "problemId": "1303", + "problemLevel": 10, + "problemName": "전쟁 - 전투", + "average_try": 2.6451, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515469 + }, + "17086": { + "problemId": "17086", + "problemLevel": 9, + "problemName": "아기 상어 2", + "average_try": 1.9872, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515492 + }, + "14496": { + "problemId": "14496", + "problemLevel": 10, + "problemName": "그대, 그머가 되어", + "average_try": 2.1998, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515516 + }, + "11123": { + "problemId": "11123", + "problemLevel": 10, + "problemName": "양 한마리... 양 두마리...", + "average_try": 1.4895, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515539 + }, + "18404": { + "problemId": "18404", + "problemLevel": 10, + "problemName": "현명한 나이트", + "average_try": 1.872, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515562 + }, + "5547": { + "problemId": "5547", + "problemLevel": 10, + "problemName": "일루미네이션", + "average_try": 1.6316, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515585 + }, + "14502": { + "problemId": "14502", + "problemLevel": 11, + "problemName": "연구소", + "average_try": 1.8121, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515608 + }, + "10026": { + "problemId": "10026", + "problemLevel": 11, + "problemName": "적록색약", + "average_try": 1.7424, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515631 + }, + "3055": { + "problemId": "3055", + "problemLevel": 12, + "problemName": "탈출", + "average_try": 3.1866, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515654 + }, + "5014": { + "problemId": "5014", + "problemLevel": 11, + "problemName": "스타트링크", + "average_try": 2.974, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.5157 + }, + "2589": { + "problemId": "2589", + "problemLevel": 11, + "problemName": "보물섬", + "average_try": 2.6603, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515723 + }, + "9019": { + "problemId": "9019", + "problemLevel": 11, + "problemName": "DSLR", + "average_try": 4.6282, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515746 + }, + "2636": { + "problemId": "2636", + "problemLevel": 11, + "problemName": "치즈", + "average_try": 1.9309, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.51577 + }, + "11559": { + "problemId": "11559", + "problemLevel": 12, + "problemName": "Puyo Puyo", + "average_try": 2.7239, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.515816 + }, + "1600": { + "problemId": "1600", + "problemLevel": 12, + "problemName": "말이 되고픈 원숭이", + "average_try": 5.5003, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515839 + }, + "12851": { + "problemId": "12851", + "problemLevel": 11, + "problemName": "숨바꼭질 2", + "average_try": 3.863, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515861 + }, + "17141": { + "problemId": "17141", + "problemLevel": 12, + "problemName": "연구소 2", + "average_try": 2.2151, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515884 + }, + "16954": { + "problemId": "16954", + "problemLevel": 12, + "problemName": "움직이는 미로 탈출", + "average_try": 3.7391, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515906 + }, + "14716": { + "problemId": "14716", + "problemLevel": 10, + "problemName": "현수막", + "average_try": 1.6539, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515929 + }, + "17836": { + "problemId": "17836", + "problemLevel": 11, + "problemName": "공주님을 구해라!", + "average_try": 4.303, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.515954 + }, + "16973": { + "problemId": "16973", + "problemLevel": 12, + "problemName": "직사각형 탈출", + "average_try": 3.9937, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.515977 + }, + "17129": { + "problemId": "17129", + "problemLevel": 11, + "problemName": "윌리암슨수액빨이딱따구리가 정보섬에 올라온 이유", + "average_try": 2.8184, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.516 + }, + "16174": { + "problemId": "16174", + "problemLevel": 10, + "problemName": "점프왕 쩰리 (Large)", + "average_try": 2.174, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.516023 + }, + "14940": { + "problemId": "14940", + "problemLevel": 11, + "problemName": "쉬운 최단거리", + "average_try": 2.4051, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.516046 + }, + "2194": { + "problemId": "2194", + "problemLevel": 11, + "problemName": "유닛 이동시키기", + "average_try": 3.6157, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.51607 + }, + "18513": { + "problemId": "18513", + "problemLevel": 11, + "problemName": "샘터", + "average_try": 5.1181, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.516094 + }, + "2206": { + "problemId": "2206", + "problemLevel": 12, + "problemName": "벽 부수고 이동하기", + "average_try": 4.3937, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.516117 + }, + "1707": { + "problemId": "1707", + "problemLevel": 12, + "problemName": "이분 그래프", + "average_try": 4.3013, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.51614 + }, + "2573": { + "problemId": "2573", + "problemLevel": 12, + "problemName": "빙산", + "average_try": 3.8873, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.516163 + }, + "17142": { + "problemId": "17142", + "problemLevel": 12, + "problemName": "연구소 3", + "average_try": 3.9228, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.516187 + }, + "5427": { + "problemId": "5427", + "problemLevel": 12, + "problemName": "불", + "average_try": 4.3228, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.51621 + }, + "13913": { + "problemId": "13913", + "problemLevel": 12, + "problemName": "숨바꼭질 4", + "average_try": 3.0767, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.516234 + }, + "2638": { + "problemId": "2638", + "problemLevel": 12, + "problemName": "치즈", + "average_try": 2.2092, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.516256 + }, + "2665": { + "problemId": "2665", + "problemLevel": 12, + "problemName": "미로만들기", + "average_try": 1.8615, + "solvedtags": [ + { + "bojTagId": 176, + "key": "0_1_bfs" + }, + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.516279 + }, + "1726": { + "problemId": "1726", + "problemLevel": 13, + "problemName": "로봇", + "average_try": 4.0143, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.516301 + }, + "4179": { + "problemId": "4179", + "problemLevel": 12, + "problemName": "불!", + "average_try": 4.522, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.516324 + }, + "2234": { + "problemId": "2234", + "problemLevel": 12, + "problemName": "성곽", + "average_try": 2.2551, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 14, + "key": "bitmask" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.516347 + }, + "6087": { + "problemId": "6087", + "problemLevel": 12, + "problemName": "레이저 통신", + "average_try": 3.123, + "solvedtags": [ + { + "bojTagId": 176, + "key": "0_1_bfs" + }, + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.51637 + }, + "2151": { + "problemId": "2151", + "problemLevel": 12, + "problemName": "거울 설치", + "average_try": 4.1294, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.516393 + }, + "14923": { + "problemId": "14923", + "problemLevel": 12, + "problemName": "미로 탈출", + "average_try": 2.7203, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.516416 + }, + "16932": { + "problemId": "16932", + "problemLevel": 12, + "problemName": "모양 만들기", + "average_try": 3, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.516439 + }, + "2146": { + "problemId": "2146", + "problemLevel": 13, + "problemName": "다리 만들기", + "average_try": 3.0394, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.516463 + }, + "14442": { + "problemId": "14442", + "problemLevel": 13, + "problemName": "벽 부수고 이동하기 2", + "average_try": 3.0756, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.516486 + }, + "10711": { + "problemId": "10711", + "problemLevel": 13, + "problemName": "모래성", + "average_try": 3.4829, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.516509 + }, + "16947": { + "problemId": "16947", + "problemLevel": 13, + "problemName": "서울 지하철 2호선", + "average_try": 2.081, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.516531 + }, + "16988": { + "problemId": "16988", + "problemLevel": 13, + "problemName": "Baaaaaaaaaduk2 (Easy)", + "average_try": 2.0387, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.516554 + }, + "16985": { + "problemId": "16985", + "problemLevel": 13, + "problemName": "Maaaaaaaaaze", + "average_try": 1.769, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.516576 + }, + "16956": { + "problemId": "16956", + "problemLevel": 8, + "problemName": "늑대와 양", + "average_try": 2.2069, + "solvedtags": [ + { + "bojTagId": 109, + "key": "ad_hoc" + }, + { + "bojTagId": 128, + "key": "constructive" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.516598 + }, + "2668": { + "problemId": "2668", + "problemLevel": 11, + "problemName": "숫자고르기", + "average_try": 2.2311, + "solvedtags": [ + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.516668 + }, + "13023": { + "problemId": "13023", + "problemLevel": 11, + "problemName": "ABCDE", + "average_try": 3.4197, + "solvedtags": [ + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.516691 + }, + "16432": { + "problemId": "16432", + "problemLevel": 11, + "problemName": "떡장수와 호랑이", + "average_try": 3.4377, + "solvedtags": [ + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.516714 + }, + "9466": { + "problemId": "9466", + "problemLevel": 13, + "problemName": "텀 프로젝트", + "average_try": 4.0851, + "solvedtags": [ + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.516738 + }, + "17616": { + "problemId": "17616", + "problemLevel": 13, + "problemName": "등수 찾기", + "average_try": 2.2425, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.516784 + }, + "21937": { + "problemId": "21937", + "problemLevel": 10, + "problemName": "작업", + "average_try": 1.9048, + "solvedtags": [ + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.516807 + }, + "21938": { + "problemId": "21938", + "problemLevel": 9, + "problemName": "영상처리", + "average_try": 2.6577, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.516838 + }, + "22868": { + "problemId": "22868", + "problemLevel": 13, + "problemName": "산책 (small)", + "average_try": 3.1538, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.516861 + }, + "22946": { + "problemId": "22946", + "problemLevel": 14, + "problemName": "원 이동하기 1", + "average_try": 4.5, + "solvedtags": [ + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 100, + "key": "geometry" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.516886 + }, + "22948": { + "problemId": "22948", + "problemLevel": 14, + "problemName": "원 이동하기 2", + "average_try": 1.25, + "solvedtags": [ + { + "bojTagId": 100, + "key": "geometry" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 106, + "key": "sweeping" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.516909 + }, + "22949": { + "problemId": "22949", + "problemLevel": 15, + "problemName": "회전 미로 탐색", + "average_try": 2.8571, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.516931 + }, + "11000": { + "problemId": "11000", + "problemLevel": 11, + "problemName": "강의실 배정", + "average_try": 3.4022, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 59, + "key": "priority_queue" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.518156 + }, + "13164": { + "problemId": "13164", + "problemLevel": 11, + "problemName": "행복 유치원", + "average_try": 1.7792, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.518192 + }, + "1931": { + "problemId": "1931", + "problemLevel": 9, + "problemName": "회의실 배정", + "average_try": 3.4331, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.51822 + }, + "14916": { + "problemId": "14916", + "problemLevel": 6, + "problemName": "거스름돈", + "average_try": 1.9737, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.518246 + }, + "1439": { + "problemId": "1439", + "problemLevel": 6, + "problemName": "뒤집기", + "average_try": 1.9258, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.518272 + }, + "17521": { + "problemId": "17521", + "problemLevel": 6, + "problemName": "Byte Coin", + "average_try": 2.5358, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + } + ], + "lastupdate": 1640720099.518296 + }, + "19939": { + "problemId": "19939", + "problemLevel": 6, + "problemName": "박 터뜨리기", + "average_try": 2.6221, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.51832 + }, + "12782": { + "problemId": "12782", + "problemLevel": 7, + "problemName": "비트 우정지수", + "average_try": 1.4948, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.518344 + }, + "16208": { + "problemId": "16208", + "problemLevel": 6, + "problemName": "귀찮음", + "average_try": 2.0209, + "solvedtags": [ + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.518368 + }, + "11256": { + "problemId": "11256", + "problemLevel": 6, + "problemName": "사탕", + "average_try": 1.4025, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.518393 + }, + "13019": { + "problemId": "13019", + "problemLevel": 9, + "problemName": "A를 B로", + "average_try": 2.3947, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + } + ], + "lastupdate": 1640720099.518416 + }, + "2217": { + "problemId": "2217", + "problemLevel": 7, + "problemName": "로프", + "average_try": 2.3522, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 116, + "key": "physics" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.51844 + }, + "13305": { + "problemId": "13305", + "problemLevel": 7, + "problemName": "주유소", + "average_try": 2.6795, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + } + ], + "lastupdate": 1640720099.518465 + }, + "2847": { + "problemId": "2847", + "problemLevel": 7, + "problemName": "게임을 만든 동준이", + "average_try": 2.1054, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + } + ], + "lastupdate": 1640720099.518489 + }, + "1343": { + "problemId": "1343", + "problemLevel": 6, + "problemName": "폴리오미노", + "average_try": 1.9487, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + } + ], + "lastupdate": 1640720099.518513 + }, + "13413": { + "problemId": "13413", + "problemLevel": 7, + "problemName": "오셀로 재배치", + "average_try": 1.7776, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.518537 + }, + "1758": { + "problemId": "1758", + "problemLevel": 7, + "problemName": "알바생 강호", + "average_try": 2.5655, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.51856 + }, + "16162": { + "problemId": "16162", + "problemLevel": 7, + "problemName": "가희와 3단 고음", + "average_try": 1.7692, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + } + ], + "lastupdate": 1640720099.518583 + }, + "16435": { + "problemId": "16435", + "problemLevel": 6, + "problemName": "스네이크버드", + "average_try": 1.4304, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.518607 + }, + "11399": { + "problemId": "11399", + "problemLevel": 8, + "problemName": "ATM", + "average_try": 1.5037, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.51863 + }, + "1449": { + "problemId": "1449", + "problemLevel": 8, + "problemName": "수리공 항승", + "average_try": 2.4566, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.518653 + }, + "11508": { + "problemId": "11508", + "problemLevel": 7, + "problemName": "2+1 세일", + "average_try": 1.6761, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.518677 + }, + "1817": { + "problemId": "1817", + "problemLevel": 6, + "problemName": "짐 챙기는 숌", + "average_try": 3.4235, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.518701 + }, + "20115": { + "problemId": "20115", + "problemLevel": 8, + "problemName": "에너지 드링크", + "average_try": 1.3608, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + } + ], + "lastupdate": 1640720099.518724 + }, + "20300": { + "problemId": "20300", + "problemLevel": 8, + "problemName": "서강근육맨", + "average_try": 2.6188, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.518748 + }, + "14247": { + "problemId": "14247", + "problemLevel": 8, + "problemName": "나무 자르기", + "average_try": 2.3743, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.518771 + }, + "1541": { + "problemId": "1541", + "problemLevel": 9, + "problemName": "잃어버린 괄호", + "average_try": 2.0831, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 96, + "key": "parsing" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.518796 + }, + "1080": { + "problemId": "1080", + "problemLevel": 9, + "problemName": "행렬", + "average_try": 2.5294, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + } + ], + "lastupdate": 1640720099.518819 + }, + "2138": { + "problemId": "2138", + "problemLevel": 10, + "problemName": "전구와 스위치", + "average_try": 2.6128, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + } + ], + "lastupdate": 1640720099.518842 + }, + "20365": { + "problemId": "20365", + "problemLevel": 9, + "problemName": "블로그2", + "average_try": 2.1031, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.518865 + }, + "14400": { + "problemId": "14400", + "problemLevel": 9, + "problemName": "편의점 2", + "average_try": 1.9076, + "solvedtags": [ + { + "bojTagId": 100, + "key": "geometry" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.518888 + }, + "11047": { + "problemId": "11047", + "problemLevel": 9, + "problemName": "동전 0", + "average_try": 1.907, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + } + ], + "lastupdate": 1640720099.518911 + }, + "1946": { + "problemId": "1946", + "problemLevel": 10, + "problemName": "신입 사원", + "average_try": 3.1587, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.518933 + }, + "16953": { + "problemId": "16953", + "problemLevel": 10, + "problemName": "A → B", + "average_try": 2.4533, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 33, + "key": "greedy" + } + ], + "lastupdate": 1640720099.518956 + }, + "11509": { + "problemId": "11509", + "problemLevel": 10, + "problemName": "풍선 맞추기", + "average_try": 2.5455, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + } + ], + "lastupdate": 1640720099.518979 + }, + "17615": { + "problemId": "17615", + "problemLevel": 10, + "problemName": "볼 모으기", + "average_try": 2.5022, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + } + ], + "lastupdate": 1640720099.519002 + }, + "19539": { + "problemId": "19539", + "problemLevel": 10, + "problemName": "사과나무", + "average_try": 2.1504, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.519024 + }, + "1474": { + "problemId": "1474", + "problemLevel": 10, + "problemName": "밑 줄", + "average_try": 2.85, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.519047 + }, + "1455": { + "problemId": "1455", + "problemLevel": 9, + "problemName": "뒤집기 II", + "average_try": 1.4436, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + } + ], + "lastupdate": 1640720099.51907 + }, + "16206": { + "problemId": "16206", + "problemLevel": 10, + "problemName": "롤케이크", + "average_try": 3.5768, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + } + ], + "lastupdate": 1640720099.519092 + }, + "2141": { + "problemId": "2141", + "problemLevel": 12, + "problemName": "우체국", + "average_try": 3.9546, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.519116 + }, + "19598": { + "problemId": "19598", + "problemLevel": 11, + "problemName": "최소 회의실 개수", + "average_try": 2.6415, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 59, + "key": "priority_queue" + }, + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 106, + "key": "sweeping" + } + ], + "lastupdate": 1640720099.519139 + }, + "20117": { + "problemId": "20117", + "problemLevel": 10, + "problemName": "호반우 상인의 이상한 품질 계산법", + "average_try": 1.5257, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.519162 + }, + "2812": { + "problemId": "2812", + "problemLevel": 12, + "problemName": "크게 만들기", + "average_try": 4.1354, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 71, + "key": "stack" + } + ], + "lastupdate": 1640720099.519185 + }, + "2212": { + "problemId": "2212", + "problemLevel": 11, + "problemName": "센서", + "average_try": 2.2344, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.519208 + }, + "1092": { + "problemId": "1092", + "problemLevel": 11, + "problemName": "배", + "average_try": 4.1048, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.519231 + }, + "1374": { + "problemId": "1374", + "problemLevel": 11, + "problemName": "강의실", + "average_try": 2.4351, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 59, + "key": "priority_queue" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.519254 + }, + "13975": { + "problemId": "13975", + "problemLevel": 12, + "problemName": "파일 합치기 3", + "average_try": 2.0277, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 59, + "key": "priority_queue" + } + ], + "lastupdate": 1640720099.519277 + }, + "6068": { + "problemId": "6068", + "problemLevel": 11, + "problemName": "시간 관리하기", + "average_try": 1.9579, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.519299 + }, + "1744": { + "problemId": "1744", + "problemLevel": 12, + "problemName": "수 묶기", + "average_try": 3.7031, + "solvedtags": [ + { + "bojTagId": 137, + "key": "case_work" + }, + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.519322 + }, + "1715": { + "problemId": "1715", + "problemLevel": 12, + "problemName": "카드 정렬하기", + "average_try": 2.8487, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 59, + "key": "priority_queue" + } + ], + "lastupdate": 1640720099.519345 + }, + "8980": { + "problemId": "8980", + "problemLevel": 13, + "problemName": "택배", + "average_try": 2.6122, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.519368 + }, + "2457": { + "problemId": "2457", + "problemLevel": 12, + "problemName": "공주님의 정원", + "average_try": 4.0825, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + } + ], + "lastupdate": 1640720099.519391 + }, + "2109": { + "problemId": "2109", + "problemLevel": 13, + "problemName": "순회강연", + "average_try": 2.7815, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 59, + "key": "priority_queue" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.519414 + }, + "1082": { + "problemId": "1082", + "problemLevel": 12, + "problemName": "방 번호", + "average_try": 3.6114, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 33, + "key": "greedy" + } + ], + "lastupdate": 1640720099.519437 + }, + "12931": { + "problemId": "12931", + "problemLevel": 12, + "problemName": "두 배 더하기", + "average_try": 1.6118, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + } + ], + "lastupdate": 1640720099.51946 + }, + "18234": { + "problemId": "18234", + "problemLevel": 12, + "problemName": "당근 훔쳐 먹기", + "average_try": 2.3963, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.519483 + }, + "2285": { + "problemId": "2285", + "problemLevel": 12, + "problemName": "우체국", + "average_try": 3.2841, + "solvedtags": [ + { + "bojTagId": 117, + "key": "arbitrary_precision" + }, + { + "bojTagId": 33, + "key": "greedy" + } + ], + "lastupdate": 1640720099.519506 + }, + "21313": { + "problemId": "21313", + "problemLevel": 4, + "problemName": "문어", + "average_try": 1.3308, + "solvedtags": [ + { + "bojTagId": 109, + "key": "ad_hoc" + } + ], + "lastupdate": 1640720099.519528 + }, + "21314": { + "problemId": "21314", + "problemLevel": 10, + "problemName": "민겸 수", + "average_try": 2.7711, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.519551 + }, + "21758": { + "problemId": "21758", + "problemLevel": 10, + "problemName": "꿀 따기", + "average_try": 2.8877, + "solvedtags": [ + { + "bojTagId": 137, + "key": "case_work" + }, + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.519574 + }, + "21925": { + "problemId": "21925", + "problemLevel": 13, + "problemName": "짝수 팰린드롬", + "average_try": 2.5333, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 33, + "key": "greedy" + } + ], + "lastupdate": 1640720099.519597 + }, + "1212": { + "problemId": "1212", + "problemLevel": 3, + "problemName": "8진수 2진수", + "average_try": 2.926, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.520418 + }, + "2753": { + "problemId": "2753", + "problemLevel": 2, + "problemName": "윤년", + "average_try": 1.8713, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.520453 + }, + "20053": { + "problemId": "20053", + "problemLevel": 3, + "problemName": "최소, 최대 2", + "average_try": 1.6098, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.52048 + }, + "5597": { + "problemId": "5597", + "problemLevel": 4, + "problemName": "과제 안 내신 분..?", + "average_try": 1.4916, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.520506 + }, + "20546": { + "problemId": "20546", + "problemLevel": 5, + "problemName": "🐜 기적의 매매법 🐜", + "average_try": 2.0933, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.52053 + }, + "1913": { + "problemId": "1913", + "problemLevel": 7, + "problemName": "달팽이", + "average_try": 2.0157, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.520581 + }, + "14467": { + "problemId": "14467", + "problemLevel": 6, + "problemName": "소가 길을 건너간 이유 1", + "average_try": 1.6522, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.520605 + }, + "2578": { + "problemId": "2578", + "problemLevel": 6, + "problemName": "빙고", + "average_try": 2.1533, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.520653 + }, + "18311": { + "problemId": "18311", + "problemLevel": 6, + "problemName": "왕복", + "average_try": 2.9366, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.520701 + }, + "1244": { + "problemId": "1244", + "problemLevel": 7, + "problemName": "스위치 켜고 끄기", + "average_try": 5.068, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.520725 + }, + "10994": { + "problemId": "10994", + "problemLevel": 7, + "problemName": "별 찍기 - 19", + "average_try": 1.4908, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 62, + "key": "recursion" + } + ], + "lastupdate": 1640720099.520748 + }, + "5766": { + "problemId": "5766", + "problemLevel": 7, + "problemName": "할아버지는 유명해!", + "average_try": 1.6725, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.520771 + }, + "2615": { + "problemId": "2615", + "problemLevel": 8, + "problemName": "오목", + "average_try": 4.9116, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.520867 + }, + "2729": { + "problemId": "2729", + "problemLevel": 7, + "problemName": "이진수 덧셈", + "average_try": 2.5706, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.520891 + }, + "17276": { + "problemId": "17276", + "problemLevel": 10, + "problemName": "배열 돌리기", + "average_try": 1.624, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.520914 + }, + "16926": { + "problemId": "16926", + "problemLevel": 9, + "problemName": "배열 돌리기 1", + "average_try": 2.0301, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.520937 + }, + "16927": { + "problemId": "16927", + "problemLevel": 11, + "problemName": "배열 돌리기 2", + "average_try": 2.8278, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.520961 + }, + "16935": { + "problemId": "16935", + "problemLevel": 10, + "problemName": "배열 돌리기 3", + "average_try": 1.9952, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.520984 + }, + "17406": { + "problemId": "17406", + "problemLevel": 12, + "problemName": "배열 돌리기 4", + "average_try": 2.5306, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.521007 + }, + "17470": { + "problemId": "17470", + "problemLevel": 16, + "problemName": "배열 돌리기 5", + "average_try": 5.8857, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.52103 + }, + "20327": { + "problemId": "20327", + "problemLevel": 13, + "problemName": "배열 돌리기 6", + "average_try": 1.869, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.521052 + }, + "17128": { + "problemId": "17128", + "problemLevel": 9, + "problemName": "소가 정보섬에 올라온 이유", + "average_try": 2.0517, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.521075 + }, + "1283": { + "problemId": "1283", + "problemLevel": 9, + "problemName": "단축키 지정", + "average_try": 2.9828, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.521098 + }, + "10703": { + "problemId": "10703", + "problemLevel": 8, + "problemName": "유성", + "average_try": 4.2679, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.52112 + }, + "2469": { + "problemId": "2469", + "problemLevel": 10, + "problemName": "사다리 타기", + "average_try": 2.646, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.521167 + }, + "2877": { + "problemId": "2877", + "problemLevel": 10, + "problemName": "4와 7", + "average_try": 1.6517, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.52119 + }, + "15787": { + "problemId": "15787", + "problemLevel": 9, + "problemName": "기차가 어둠을 헤치고 은하수를", + "average_try": 3.5804, + "solvedtags": [ + { + "bojTagId": 14, + "key": "bitmask" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.521238 + }, + "20164": { + "problemId": "20164", + "problemLevel": 11, + "problemName": "홀수 홀릭 호석", + "average_try": 1.4277, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 62, + "key": "recursion" + } + ], + "lastupdate": 1640720099.521262 + }, + "20207": { + "problemId": "20207", + "problemLevel": 10, + "problemName": "달력", + "average_try": 2.2053, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.521285 + }, + "14719": { + "problemId": "14719", + "problemLevel": 11, + "problemName": "빗물", + "average_try": 1.8432, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.521308 + }, + "15886": { + "problemId": "15886", + "problemLevel": 9, + "problemName": "내 선물을 받아줘 2", + "average_try": 1.475, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.521332 + }, + "16719": { + "problemId": "16719", + "problemLevel": 11, + "problemName": "ZOAC", + "average_try": 1.929, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.521355 + }, + "1022": { + "problemId": "1022", + "problemLevel": 12, + "problemName": "소용돌이 예쁘게 출력하기", + "average_try": 3.5253, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.521378 + }, + "9081": { + "problemId": "9081", + "problemLevel": 10, + "problemName": "단어 맞추기", + "average_try": 1.934, + "solvedtags": [ + { + "bojTagId": 6, + "key": "combinatorics" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.521401 + }, + "15806": { + "problemId": "15806", + "problemLevel": 15, + "problemName": "영우의 기숙사 청소", + "average_try": 5, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 137, + "key": "case_work" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.521424 + }, + "21277": { + "problemId": "21277", + "problemLevel": 13, + "problemName": "짠돌이 호석", + "average_try": 4.64, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.521447 + }, + "21611": { + "problemId": "21611", + "problemLevel": 15, + "problemName": "마법사 상어와 블리자드", + "average_try": 3.9919, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.521471 + }, + "21608": { + "problemId": "21608", + "problemLevel": 10, + "problemName": "상어 초등학교", + "average_try": 2.511, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.521494 + }, + "21756": { + "problemId": "21756", + "problemLevel": 4, + "problemName": "지우개", + "average_try": 1.6709, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.521517 + }, + "21918": { + "problemId": "21918", + "problemLevel": 4, + "problemName": "전구", + "average_try": 1.5385, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.52154 + }, + "22860": { + "problemId": "22860", + "problemLevel": 13, + "problemName": "폴더 정리 (small)", + "average_try": 2.8966, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 136, + "key": "hash_set" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 96, + "key": "parsing" + }, + { + "bojTagId": 62, + "key": "recursion" + }, + { + "bojTagId": 141, + "key": "simulation" + }, + { + "bojTagId": 158, + "key": "string" + }, + { + "bojTagId": 74, + "key": "tree_set" + } + ], + "lastupdate": 1640720099.521563 + }, + "22859": { + "problemId": "22859", + "problemLevel": 13, + "problemName": "HTML 파싱", + "average_try": 5.8, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 96, + "key": "parsing" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.521586 + }, + "22856": { + "problemId": "22856", + "problemLevel": 12, + "problemName": "트리 순회", + "average_try": 3.2093, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.521609 + }, + "22858": { + "problemId": "22858", + "problemLevel": 8, + "problemName": "원상 복구 (small)", + "average_try": 1.5588, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.521632 + }, + "1978": { + "problemId": "1978", + "problemLevel": 7, + "problemName": "소수 찾기", + "average_try": 2.0959, + "solvedtags": [ + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + }, + { + "bojTagId": 9, + "key": "primality_test" + }, + { + "bojTagId": 67, + "key": "sieve" + } + ], + "lastupdate": 1640720099.528825 + }, + "2609": { + "problemId": "2609", + "problemLevel": 6, + "problemName": "최대공약수와 최소공배수", + "average_try": 1.6485, + "solvedtags": [ + { + "bojTagId": 26, + "key": "euclidean" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + } + ], + "lastupdate": 1640720099.528863 + }, + "1934": { + "problemId": "1934", + "problemLevel": 6, + "problemName": "최소공배수", + "average_try": 1.6868, + "solvedtags": [ + { + "bojTagId": 26, + "key": "euclidean" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + } + ], + "lastupdate": 1640720099.528892 + }, + "2581": { + "problemId": "2581", + "problemLevel": 6, + "problemName": "소수", + "average_try": 2.5779, + "solvedtags": [ + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + }, + { + "bojTagId": 9, + "key": "primality_test" + } + ], + "lastupdate": 1640720099.528977 + }, + "11653": { + "problemId": "11653", + "problemLevel": 6, + "problemName": "소인수분해", + "average_try": 1.8958, + "solvedtags": [ + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + }, + { + "bojTagId": 9, + "key": "primality_test" + } + ], + "lastupdate": 1640720099.529005 + }, + "2960": { + "problemId": "2960", + "problemLevel": 7, + "problemName": "에라토스테네스의 체", + "average_try": 1.8826, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + }, + { + "bojTagId": 9, + "key": "primality_test" + }, + { + "bojTagId": 67, + "key": "sieve" + } + ], + "lastupdate": 1640720099.52903 + }, + "9613": { + "problemId": "9613", + "problemLevel": 8, + "problemName": "GCD 합", + "average_try": 2.5668, + "solvedtags": [ + { + "bojTagId": 26, + "key": "euclidean" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + } + ], + "lastupdate": 1640720099.529055 + }, + "5347": { + "problemId": "5347", + "problemLevel": 7, + "problemName": "LCM", + "average_try": 1.8851, + "solvedtags": [ + { + "bojTagId": 26, + "key": "euclidean" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + } + ], + "lastupdate": 1640720099.52908 + }, + "4134": { + "problemId": "4134", + "problemLevel": 7, + "problemName": "다음 소수", + "average_try": 3.5659, + "solvedtags": [ + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + }, + { + "bojTagId": 9, + "key": "primality_test" + } + ], + "lastupdate": 1640720099.529105 + }, + "1110": { + "problemId": "1110", + "problemLevel": 5, + "problemName": "더하기 사이클", + "average_try": 2.134, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.529129 + }, + "5618": { + "problemId": "5618", + "problemLevel": 3, + "problemName": "공약수", + "average_try": 1.8394, + "solvedtags": [ + { + "bojTagId": 26, + "key": "euclidean" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + } + ], + "lastupdate": 1640720099.529153 + }, + "2745": { + "problemId": "2745", + "problemLevel": 4, + "problemName": "진법 변환", + "average_try": 1.7624, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.529177 + }, + "21275": { + "problemId": "21275", + "problemLevel": 8, + "problemName": "폰 호석만", + "average_try": 2.7714, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.529217 + }, + "1456": { + "problemId": "1456", + "problemLevel": 10, + "problemName": "거의 소수", + "average_try": 4.544, + "solvedtags": [ + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + }, + { + "bojTagId": 9, + "key": "primality_test" + }, + { + "bojTagId": 67, + "key": "sieve" + } + ], + "lastupdate": 1640720099.529243 + }, + "2168": { + "problemId": "2168", + "problemLevel": 10, + "problemName": "타일 위의 대각선", + "average_try": 1.8179, + "solvedtags": [ + { + "bojTagId": 26, + "key": "euclidean" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + } + ], + "lastupdate": 1640720099.529267 + }, + "9421": { + "problemId": "9421", + "problemLevel": 10, + "problemName": "소수상근수", + "average_try": 1.9024, + "solvedtags": [ + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + }, + { + "bojTagId": 9, + "key": "primality_test" + }, + { + "bojTagId": 67, + "key": "sieve" + } + ], + "lastupdate": 1640720099.52929 + }, + "1669": { + "problemId": "1669", + "problemLevel": 10, + "problemName": "멍멍이 쓰다듬기", + "average_try": 2.6623, + "solvedtags": [ + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.529314 + }, + "1990": { + "problemId": "1990", + "problemLevel": 11, + "problemName": "소수인팰린드롬", + "average_try": 4.0801, + "solvedtags": [ + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + }, + { + "bojTagId": 9, + "key": "primality_test" + }, + { + "bojTagId": 67, + "key": "sieve" + } + ], + "lastupdate": 1640720099.529337 + }, + "3343": { + "problemId": "3343", + "problemLevel": 11, + "problemName": "장미", + "average_try": 5.9067, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + } + ], + "lastupdate": 1640720099.52936 + }, + "1747": { + "problemId": "1747", + "problemLevel": 11, + "problemName": "소수&팰린드롬", + "average_try": 3.4452, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + }, + { + "bojTagId": 9, + "key": "primality_test" + }, + { + "bojTagId": 67, + "key": "sieve" + } + ], + "lastupdate": 1640720099.529383 + }, + "2436": { + "problemId": "2436", + "problemLevel": 11, + "problemName": "공약수", + "average_try": 3.6695, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 26, + "key": "euclidean" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + } + ], + "lastupdate": 1640720099.529407 + }, + "1188": { + "problemId": "1188", + "problemLevel": 11, + "problemName": "음식 평론가", + "average_try": 2.1398, + "solvedtags": [ + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + } + ], + "lastupdate": 1640720099.529429 + }, + "2824": { + "problemId": "2824", + "problemLevel": 11, + "problemName": "최대공약수", + "average_try": 4.3121, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + }, + { + "bojTagId": 9, + "key": "primality_test" + } + ], + "lastupdate": 1640720099.529452 + }, + "2553": { + "problemId": "2553", + "problemLevel": 9, + "problemName": "마지막 팩토리얼 수", + "average_try": 3.14, + "solvedtags": [ + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + } + ], + "lastupdate": 1640720099.529475 + }, + "21312": { + "problemId": "21312", + "problemLevel": 3, + "problemName": "홀짝 칵테일", + "average_try": 1.5767, + "solvedtags": [ + { + "bojTagId": 121, + "key": "arithmetic" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 124, + "key": "math" + } + ], + "lastupdate": 1640720099.529498 + }, + "21920": { + "problemId": "21920", + "problemLevel": 7, + "problemName": "서로소 평균", + "average_try": 1.9561, + "solvedtags": [ + { + "bojTagId": 26, + "key": "euclidean" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + } + ], + "lastupdate": 1640720099.529522 + }, + "21919": { + "problemId": "21919", + "problemLevel": 8, + "problemName": "소수 최소 공배수", + "average_try": 3.986, + "solvedtags": [ + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + }, + { + "bojTagId": 9, + "key": "primality_test" + }, + { + "bojTagId": 67, + "key": "sieve" + } + ], + "lastupdate": 1640720099.529546 + }, + "22864": { + "problemId": "22864", + "problemLevel": 3, + "problemName": "피로도", + "average_try": 1.9455, + "solvedtags": [ + { + "bojTagId": 121, + "key": "arithmetic" + }, + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.529569 + }, + "22943": { + "problemId": "22943", + "problemLevel": 10, + "problemName": "수", + "average_try": 4.3333, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + }, + { + "bojTagId": 9, + "key": "primality_test" + }, + { + "bojTagId": 67, + "key": "sieve" + } + ], + "lastupdate": 1640720099.529593 + }, + "1197": { + "problemId": "1197", + "problemLevel": 12, + "problemName": "최소 스패닝 트리", + "average_try": 2.4955, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 49, + "key": "mst" + } + ], + "lastupdate": 1640720099.530117 + }, + "1922": { + "problemId": "1922", + "problemLevel": 12, + "problemName": "네트워크 연결", + "average_try": 1.6719, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 49, + "key": "mst" + } + ], + "lastupdate": 1640720099.530152 + }, + "1647": { + "problemId": "1647", + "problemLevel": 12, + "problemName": "도시 분할 계획", + "average_try": 2.0411, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 49, + "key": "mst" + } + ], + "lastupdate": 1640720099.53018 + }, + "4386": { + "problemId": "4386", + "problemLevel": 12, + "problemName": "별자리 만들기", + "average_try": 1.7936, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 49, + "key": "mst" + } + ], + "lastupdate": 1640720099.530206 + }, + "6497": { + "problemId": "6497", + "problemLevel": 12, + "problemName": "전력난", + "average_try": 3.0671, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 49, + "key": "mst" + } + ], + "lastupdate": 1640720099.53023 + }, + "1774": { + "problemId": "1774", + "problemLevel": 13, + "problemName": "우주신과의 교감", + "average_try": 3.2925, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 49, + "key": "mst" + } + ], + "lastupdate": 1640720099.530254 + }, + "16398": { + "problemId": "16398", + "problemLevel": 12, + "problemName": "행성 연결", + "average_try": 2.4638, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 49, + "key": "mst" + } + ], + "lastupdate": 1640720099.530278 + }, + "13905": { + "problemId": "13905", + "problemLevel": 12, + "problemName": "세부", + "average_try": 2.9808, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 81, + "key": "disjoint_set" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 49, + "key": "mst" + } + ], + "lastupdate": 1640720099.530302 + }, + "16202": { + "problemId": "16202", + "problemLevel": 12, + "problemName": "MST 게임", + "average_try": 1.7209, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 81, + "key": "disjoint_set" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 49, + "key": "mst" + } + ], + "lastupdate": 1640720099.530326 + }, + "18769": { + "problemId": "18769", + "problemLevel": 12, + "problemName": "그리드 네트워크", + "average_try": 2.2326, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 49, + "key": "mst" + } + ], + "lastupdate": 1640720099.53035 + }, + "17472": { + "problemId": "17472", + "problemLevel": 14, + "problemName": "다리 만들기 2", + "average_try": 3.2388, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 49, + "key": "mst" + } + ], + "lastupdate": 1640720099.530373 + }, + "13418": { + "problemId": "13418", + "problemLevel": 13, + "problemName": "학교 탐방하기", + "average_try": 2.8338, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 49, + "key": "mst" + } + ], + "lastupdate": 1640720099.530396 + }, + "14621": { + "problemId": "14621", + "problemLevel": 13, + "problemName": "나만 안되는 연애", + "average_try": 2.0859, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 49, + "key": "mst" + } + ], + "lastupdate": 1640720099.530419 + }, + "14950": { + "problemId": "14950", + "problemLevel": 13, + "problemName": "정복자", + "average_try": 1.7762, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 49, + "key": "mst" + } + ], + "lastupdate": 1640720099.530442 + }, + "2406": { + "problemId": "2406", + "problemLevel": 13, + "problemName": "안정적인 네트워크", + "average_try": 2.7984, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 49, + "key": "mst" + } + ], + "lastupdate": 1640720099.530466 + }, + "17490": { + "problemId": "17490", + "problemLevel": 13, + "problemName": "일감호에 다리 놓기", + "average_try": 4.8963, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 81, + "key": "disjoint_set" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 49, + "key": "mst" + } + ], + "lastupdate": 1640720099.530489 + }, + "2887": { + "problemId": "2887", + "problemLevel": 15, + "problemName": "행성 터널", + "average_try": 2.8079, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 49, + "key": "mst" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.530512 + }, + "1944": { + "problemId": "1944", + "problemLevel": 14, + "problemName": "복제 로봇", + "average_try": 3.9255, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 49, + "key": "mst" + } + ], + "lastupdate": 1640720099.530535 + }, + "10423": { + "problemId": "10423", + "problemLevel": 14, + "problemName": "전기가 부족해", + "average_try": 1.4198, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 49, + "key": "mst" + } + ], + "lastupdate": 1640720099.530558 + }, + "1368": { + "problemId": "1368", + "problemLevel": 14, + "problemName": "물대기", + "average_try": 2.5356, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 49, + "key": "mst" + } + ], + "lastupdate": 1640720099.530581 + }, + "20010": { + "problemId": "20010", + "problemLevel": 14, + "problemName": "악덕 영주 혜유", + "average_try": 1.7083, + "solvedtags": [ + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 49, + "key": "mst" + } + ], + "lastupdate": 1640720099.530605 + }, + "1414": { + "problemId": "1414", + "problemLevel": 14, + "problemName": "불우이웃돕기", + "average_try": 3.3349, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 49, + "key": "mst" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.530628 + }, + "1045": { + "problemId": "1045", + "problemLevel": 15, + "problemName": "도로", + "average_try": 4.6744, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 49, + "key": "mst" + } + ], + "lastupdate": 1640720099.530808 + }, + "21924": { + "problemId": "21924", + "problemLevel": 12, + "problemName": "도시 건설", + "average_try": 2.3109, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 49, + "key": "mst" + } + ], + "lastupdate": 1640720099.530842 + }, + "14929": { + "problemId": "14929", + "problemLevel": 5, + "problemName": "귀찮아 (SIB)", + "average_try": 2.359, + "solvedtags": [ + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.531344 + }, + "2167": { + "problemId": "2167", + "problemLevel": 5, + "problemName": "2차원 배열의 합", + "average_try": 1.7028, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.531379 + }, + "20116": { + "problemId": "20116", + "problemLevel": 8, + "problemName": "상자의 균형", + "average_try": 2.9048, + "solvedtags": [ + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 116, + "key": "physics" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.531407 + }, + "11659": { + "problemId": "11659", + "problemLevel": 8, + "problemName": "구간 합 구하기 4", + "average_try": 2.1068, + "solvedtags": [ + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.531433 + }, + "11441": { + "problemId": "11441", + "problemLevel": 8, + "problemName": "합 구하기", + "average_try": 1.9689, + "solvedtags": [ + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.531459 + }, + "17390": { + "problemId": "17390", + "problemLevel": 8, + "problemName": "이건 꼭 풀어야 해!", + "average_try": 2.2179, + "solvedtags": [ + { + "bojTagId": 139, + "key": "prefix_sum" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.531484 + }, + "16139": { + "problemId": "16139", + "problemLevel": 9, + "problemName": "인간-컴퓨터 상호작용", + "average_try": 2.3556, + "solvedtags": [ + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.531508 + }, + "20438": { + "problemId": "20438", + "problemLevel": 9, + "problemName": "출석체크", + "average_try": 3.3734, + "solvedtags": [ + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.531533 + }, + "17123": { + "problemId": "17123", + "problemLevel": 9, + "problemName": "배열 놀이", + "average_try": 1.7907, + "solvedtags": [ + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.531557 + }, + "11660": { + "problemId": "11660", + "problemLevel": 10, + "problemName": "구간 합 구하기 5", + "average_try": 1.9927, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.531581 + }, + "16507": { + "problemId": "16507", + "problemLevel": 10, + "problemName": "어두운 건 무서워", + "average_try": 1.5158, + "solvedtags": [ + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.531606 + }, + "19951": { + "problemId": "19951", + "problemLevel": 10, + "problemName": "태상이의 훈련소 생활", + "average_try": 1.5366, + "solvedtags": [ + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.531676 + }, + "10427": { + "problemId": "10427", + "problemLevel": 11, + "problemName": "빚", + "average_try": 1.7213, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.531714 + }, + "2015": { + "problemId": "2015", + "problemLevel": 11, + "problemName": "수들의 합 4", + "average_try": 2.9776, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + }, + { + "bojTagId": 74, + "key": "tree_set" + } + ], + "lastupdate": 1640720099.53174 + }, + "10713": { + "problemId": "10713", + "problemLevel": 11, + "problemName": "기차 여행", + "average_try": 2.4061, + "solvedtags": [ + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.531765 + }, + "20002": { + "problemId": "20002", + "problemLevel": 11, + "problemName": "사과나무", + "average_try": 2.0112, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.531789 + }, + "20159": { + "problemId": "20159", + "problemLevel": 11, + "problemName": "동작 그만. 밑장 빼기냐?", + "average_try": 4.3333, + "solvedtags": [ + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.531845 + }, + "18866": { + "problemId": "18866", + "problemLevel": 11, + "problemName": "젊은 날의 생이여", + "average_try": 3.9649, + "solvedtags": [ + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.531876 + }, + "10986": { + "problemId": "10986", + "problemLevel": 13, + "problemName": "나머지 합", + "average_try": 3.0388, + "solvedtags": [ + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.531902 + }, + "5549": { + "problemId": "5549", + "problemLevel": 12, + "problemName": "행성 탐사", + "average_try": 2.2506, + "solvedtags": [ + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.531927 + }, + "2571": { + "problemId": "2571", + "problemLevel": 13, + "problemName": "색종이 - 3", + "average_try": 1.9475, + "solvedtags": [ + { + "bojTagId": 24, + "key": "divide_and_conquer" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.531952 + }, + "1749": { + "problemId": "1749", + "problemLevel": 12, + "problemName": "점수따먹기", + "average_try": 3.2454, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.531976 + }, + "20440": { + "problemId": "20440", + "problemLevel": 12, + "problemName": "🎵니가 싫어 싫어 너무 싫어 싫어 오지 마 내게 찝쩍대지마🎵 - 1", + "average_try": 2.8963, + "solvedtags": [ + { + "bojTagId": 161, + "key": "coordinate_compression" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.532001 + }, + "3673": { + "problemId": "3673", + "problemLevel": 13, + "problemName": "나눌 수 있는 부분 수열", + "average_try": 2.478, + "solvedtags": [ + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.532026 + }, + "5875": { + "problemId": "5875", + "problemLevel": 13, + "problemName": "오타", + "average_try": 2.5364, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.53205 + }, + "14476": { + "problemId": "14476", + "problemLevel": 14, + "problemName": "최대공약수 하나 빼기", + "average_try": 1.9245, + "solvedtags": [ + { + "bojTagId": 26, + "key": "euclidean" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.532075 + }, + "19566": { + "problemId": "19566", + "problemLevel": 14, + "problemName": "수열의 구간 평균", + "average_try": 1.7886, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + }, + { + "bojTagId": 74, + "key": "tree_set" + } + ], + "lastupdate": 1640720099.532098 + }, + "16971": { + "problemId": "16971", + "problemLevel": 13, + "problemName": "배열 B의 값", + "average_try": 3.0238, + "solvedtags": [ + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.532122 + }, + "2900": { + "problemId": "2900", + "problemLevel": 14, + "problemName": "프로그램", + "average_try": 3.2963, + "solvedtags": [ + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.532146 + }, + "20543": { + "problemId": "20543", + "problemLevel": 14, + "problemName": "폭탄 던지는 태영이", + "average_try": 3.4674, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.53217 + }, + "21318": { + "problemId": "21318", + "problemLevel": 10, + "problemName": "피아노 체조", + "average_try": 2.1587, + "solvedtags": [ + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.532194 + }, + "21757": { + "problemId": "21757", + "problemLevel": 13, + "problemName": "나누기", + "average_try": 4.9114, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.532218 + }, + "18352": { + "problemId": "18352", + "problemLevel": 9, + "problemName": "특정 거리의 도시 찾기", + "average_try": 3.5355, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.532886 + }, + "1753": { + "problemId": "1753", + "problemLevel": 11, + "problemName": "최단경로", + "average_try": 4.1937, + "solvedtags": [ + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.532921 + }, + "1916": { + "problemId": "1916", + "problemLevel": 11, + "problemName": "최소비용 구하기", + "average_try": 3.1533, + "solvedtags": [ + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.532949 + }, + "13549": { + "problemId": "13549", + "problemLevel": 11, + "problemName": "숨바꼭질 3", + "average_try": 3.8502, + "solvedtags": [ + { + "bojTagId": 176, + "key": "0_1_bfs" + }, + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.532975 + }, + "1446": { + "problemId": "1446", + "problemLevel": 10, + "problemName": "지름길", + "average_try": 2.3458, + "solvedtags": [ + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.533051 + }, + "13424": { + "problemId": "13424", + "problemLevel": 12, + "problemName": "비밀 모임", + "average_try": 1.9759, + "solvedtags": [ + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 31, + "key": "floyd_warshall" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.533079 + }, + "17396": { + "problemId": "17396", + "problemLevel": 11, + "problemName": "백도어", + "average_try": 3.9811, + "solvedtags": [ + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.533105 + }, + "5972": { + "problemId": "5972", + "problemLevel": 11, + "problemName": "택배 배송", + "average_try": 1.5815, + "solvedtags": [ + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.533131 + }, + "14284": { + "problemId": "14284", + "problemLevel": 11, + "problemName": "간선 이어가기 2", + "average_try": 1.7168, + "solvedtags": [ + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.533155 + }, + "20168": { + "problemId": "20168", + "problemLevel": 11, + "problemName": "골목 대장 호석 - 기능성", + "average_try": 2.8228, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.53318 + }, + "20182": { + "problemId": "20182", + "problemLevel": 14, + "problemName": "골목 대장 호석 - 효율성 1", + "average_try": 1.9063, + "solvedtags": [ + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.533227 + }, + "20183": { + "problemId": "20183", + "problemLevel": 15, + "problemName": "골목 대장 호석 - 효율성 2", + "average_try": 4.5047, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.533251 + }, + "1261": { + "problemId": "1261", + "problemLevel": 12, + "problemName": "알고스팟", + "average_try": 2.4315, + "solvedtags": [ + { + "bojTagId": 176, + "key": "0_1_bfs" + }, + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.533275 + }, + "1504": { + "problemId": "1504", + "problemLevel": 12, + "problemName": "특정한 최단 경로", + "average_try": 4.0567, + "solvedtags": [ + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.533299 + }, + "4485": { + "problemId": "4485", + "problemLevel": 12, + "problemName": "녹색 옷 입은 애가 젤다지?", + "average_try": 1.9595, + "solvedtags": [ + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.533323 + }, + "10282": { + "problemId": "10282", + "problemLevel": 12, + "problemName": "해킹", + "average_try": 2.6129, + "solvedtags": [ + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.533348 + }, + "14938": { + "problemId": "14938", + "problemLevel": 12, + "problemName": "서강그라운드", + "average_try": 2.0091, + "solvedtags": [ + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 31, + "key": "floyd_warshall" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.533373 + }, + "1719": { + "problemId": "1719", + "problemLevel": 12, + "problemName": "택배", + "average_try": 1.7719, + "solvedtags": [ + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 31, + "key": "floyd_warshall" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.533397 + }, + "18223": { + "problemId": "18223", + "problemLevel": 12, + "problemName": "민준이와 마산 그리고 건우", + "average_try": 2.2274, + "solvedtags": [ + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.53342 + }, + "20007": { + "problemId": "20007", + "problemLevel": 12, + "problemName": "떡 돌리기", + "average_try": 3.0792, + "solvedtags": [ + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.533444 + }, + "1277": { + "problemId": "1277", + "problemLevel": 12, + "problemName": "발전소 설치", + "average_try": 3.9167, + "solvedtags": [ + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.533467 + }, + "1238": { + "problemId": "1238", + "problemLevel": 13, + "problemName": "파티", + "average_try": 2.1539, + "solvedtags": [ + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.53349 + }, + "11779": { + "problemId": "11779", + "problemLevel": 13, + "problemName": "최소비용 구하기 2", + "average_try": 2.6259, + "solvedtags": [ + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.533513 + }, + "13911": { + "problemId": "13911", + "problemLevel": 14, + "problemName": "집 구하기", + "average_try": 3.846, + "solvedtags": [ + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.533537 + }, + "2982": { + "problemId": "2982", + "problemLevel": 14, + "problemName": "국왕의 방문", + "average_try": 2.5096, + "solvedtags": [ + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.53356 + }, + "9370": { + "problemId": "9370", + "problemLevel": 14, + "problemName": "미확인 도착지", + "average_try": 3.9276, + "solvedtags": [ + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.533584 + }, + "2211": { + "problemId": "2211", + "problemLevel": 14, + "problemName": "네트워크 복구", + "average_try": 2.1238, + "solvedtags": [ + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.533607 + }, + "16118": { + "problemId": "16118", + "problemLevel": 15, + "problemName": "달빛 여우", + "average_try": 5.3242, + "solvedtags": [ + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.533631 + }, + "1445": { + "problemId": "1445", + "problemLevel": 14, + "problemName": "일요일 아침의 데이트", + "average_try": 4.3698, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 59, + "key": "priority_queue" + } + ], + "lastupdate": 1640720099.533716 + }, + "2307": { + "problemId": "2307", + "problemLevel": 14, + "problemName": "도로검문", + "average_try": 2.7765, + "solvedtags": [ + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.533753 + }, + "18243": { + "problemId": "18243", + "problemLevel": 9, + "problemName": "Small World Network", + "average_try": 2.2629, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 31, + "key": "floyd_warshall" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.533779 + }, + "11403": { + "problemId": "11403", + "problemLevel": 10, + "problemName": "경로 찾기", + "average_try": 1.7916, + "solvedtags": [ + { + "bojTagId": 31, + "key": "floyd_warshall" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.533804 + }, + "1389": { + "problemId": "1389", + "problemLevel": 10, + "problemName": "케빈 베이컨의 6단계 법칙", + "average_try": 1.8052, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 31, + "key": "floyd_warshall" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.533829 + }, + "9205": { + "problemId": "9205", + "problemLevel": 10, + "problemName": "맥주 마시면서 걸어가기", + "average_try": 2.6703, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 31, + "key": "floyd_warshall" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.533853 + }, + "1058": { + "problemId": "1058", + "problemLevel": 9, + "problemName": "친구", + "average_try": 2.6346, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 31, + "key": "floyd_warshall" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.533877 + }, + "2224": { + "problemId": "2224", + "problemLevel": 11, + "problemName": "명제 증명", + "average_try": 3.3065, + "solvedtags": [ + { + "bojTagId": 31, + "key": "floyd_warshall" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.533901 + }, + "11265": { + "problemId": "11265", + "problemLevel": 10, + "problemName": "끝나지 않는 파티", + "average_try": 1.843, + "solvedtags": [ + { + "bojTagId": 31, + "key": "floyd_warshall" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.533925 + }, + "2660": { + "problemId": "2660", + "problemLevel": 11, + "problemName": "회장뽑기", + "average_try": 1.8404, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 31, + "key": "floyd_warshall" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.53395 + }, + "15723": { + "problemId": "15723", + "problemLevel": 11, + "problemName": "n단 논법", + "average_try": 1.7164, + "solvedtags": [ + { + "bojTagId": 31, + "key": "floyd_warshall" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.533974 + }, + "11404": { + "problemId": "11404", + "problemLevel": 12, + "problemName": "플로이드", + "average_try": 2.4064, + "solvedtags": [ + { + "bojTagId": 31, + "key": "floyd_warshall" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.533998 + }, + "2458": { + "problemId": "2458", + "problemLevel": 12, + "problemName": "키 순서", + "average_try": 1.9042, + "solvedtags": [ + { + "bojTagId": 31, + "key": "floyd_warshall" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.534021 + }, + "1956": { + "problemId": "1956", + "problemLevel": 12, + "problemName": "운동", + "average_try": 2.191, + "solvedtags": [ + { + "bojTagId": 31, + "key": "floyd_warshall" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.534045 + }, + "11562": { + "problemId": "11562", + "problemLevel": 12, + "problemName": "백양로 브레이크", + "average_try": 1.9691, + "solvedtags": [ + { + "bojTagId": 31, + "key": "floyd_warshall" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.534069 + }, + "10159": { + "problemId": "10159", + "problemLevel": 13, + "problemName": "저울", + "average_try": 1.5539, + "solvedtags": [ + { + "bojTagId": 31, + "key": "floyd_warshall" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.534092 + }, + "1507": { + "problemId": "1507", + "problemLevel": 13, + "problemName": "궁금한 민호", + "average_try": 2.0556, + "solvedtags": [ + { + "bojTagId": 31, + "key": "floyd_warshall" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.534116 + }, + "1613": { + "problemId": "1613", + "problemLevel": 13, + "problemName": "역사", + "average_try": 2.9321, + "solvedtags": [ + { + "bojTagId": 31, + "key": "floyd_warshall" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.534139 + }, + "11780": { + "problemId": "11780", + "problemLevel": 14, + "problemName": "플로이드 2", + "average_try": 2.1064, + "solvedtags": [ + { + "bojTagId": 31, + "key": "floyd_warshall" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.534162 + }, + "11657": { + "problemId": "11657", + "problemLevel": 12, + "problemName": "타임머신", + "average_try": 4.8594, + "solvedtags": [ + { + "bojTagId": 10, + "key": "bellman_ford" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.534186 + }, + "1865": { + "problemId": "1865", + "problemLevel": 13, + "problemName": "웜홀", + "average_try": 4.4795, + "solvedtags": [ + { + "bojTagId": 10, + "key": "bellman_ford" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.534209 + }, + "1219": { + "problemId": "1219", + "problemLevel": 15, + "problemName": "오민식의 고민", + "average_try": 6.3837, + "solvedtags": [ + { + "bojTagId": 10, + "key": "bellman_ford" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.534232 + }, + "21940": { + "problemId": "21940", + "problemLevel": 12, + "problemName": "가운데에서 만나기", + "average_try": 2.1719, + "solvedtags": [ + { + "bojTagId": 31, + "key": "floyd_warshall" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.534256 + }, + "22865": { + "problemId": "22865", + "problemLevel": 12, + "problemName": "가장 먼 곳", + "average_try": 3.2121, + "solvedtags": [ + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + } + ], + "lastupdate": 1640720099.534316 + }, + "22870": { + "problemId": "22870", + "problemLevel": 16, + "problemName": "산책 (large)", + "average_try": 5.913, + "solvedtags": [ + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 22, + "key": "dijkstra" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + } + ], + "lastupdate": 1640720099.534341 + }, + "20436": { + "problemId": "20436", + "problemLevel": 7, + "problemName": "ZOAC 3", + "average_try": 1.9407, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 172, + "key": "precomputation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535101 + }, + "14594": { + "problemId": "14594", + "problemLevel": 8, + "problemName": "동방 프로젝트 (Small)", + "average_try": 1.6359, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535135 + }, + "5212": { + "problemId": "5212", + "problemLevel": 9, + "problemName": "지구 온난화", + "average_try": 1.8079, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535163 + }, + "14891": { + "problemId": "14891", + "problemLevel": 11, + "problemName": "톱니바퀴", + "average_try": 1.8752, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535189 + }, + "1713": { + "problemId": "1713", + "problemLevel": 9, + "problemName": "후보 추천하기", + "average_try": 3.1917, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535214 + }, + "20055": { + "problemId": "20055", + "problemLevel": 10, + "problemName": "컨베이어 벨트 위의 로봇", + "average_try": 1.8128, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535238 + }, + "20665": { + "problemId": "20665", + "problemLevel": 11, + "problemName": "독서실 거리두기", + "average_try": 4.3438, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535262 + }, + "14503": { + "problemId": "14503", + "problemLevel": 11, + "problemName": "로봇 청소기", + "average_try": 1.8832, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535286 + }, + "3190": { + "problemId": "3190", + "problemLevel": 11, + "problemName": "뱀", + "average_try": 2.5985, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 73, + "key": "deque" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 72, + "key": "queue" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.53531 + }, + "14499": { + "problemId": "14499", + "problemLevel": 12, + "problemName": "주사위 굴리기", + "average_try": 2.3437, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535334 + }, + "15683": { + "problemId": "15683", + "problemLevel": 11, + "problemName": "감시", + "average_try": 2.3554, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535358 + }, + "16234": { + "problemId": "16234", + "problemLevel": 11, + "problemName": "인구 이동", + "average_try": 2.8012, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535382 + }, + "17144": { + "problemId": "17144", + "problemLevel": 12, + "problemName": "미세먼지 안녕!", + "average_try": 1.848, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535406 + }, + "20056": { + "problemId": "20056", + "problemLevel": 12, + "problemName": "마법사 상어와 파이어볼", + "average_try": 2.9785, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535429 + }, + "20165": { + "problemId": "20165", + "problemLevel": 11, + "problemName": "인내의 도미노 장인 호석", + "average_try": 2.4464, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535452 + }, + "16236": { + "problemId": "16236", + "problemLevel": 12, + "problemName": "아기 상어", + "average_try": 2.4602, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535475 + }, + "15685": { + "problemId": "15685", + "problemLevel": 12, + "problemName": "드래곤 커브", + "average_try": 1.859, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535498 + }, + "16235": { + "problemId": "16235", + "problemLevel": 12, + "problemName": "나무 재테크", + "average_try": 4.6314, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535521 + }, + "17135": { + "problemId": "17135", + "problemLevel": 12, + "problemName": "캐슬 디펜스", + "average_try": 3.2571, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535544 + }, + "17140": { + "problemId": "17140", + "problemLevel": 12, + "problemName": "이차원 배열과 연산", + "average_try": 2.3225, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.535567 + }, + "17779": { + "problemId": "17779", + "problemLevel": 12, + "problemName": "게리맨더링 2", + "average_try": 1.7801, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535591 + }, + "19238": { + "problemId": "19238", + "problemLevel": 12, + "problemName": "스타트 택시", + "average_try": 5.1444, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535614 + }, + "20057": { + "problemId": "20057", + "problemLevel": 12, + "problemName": "마법사 상어와 토네이도", + "average_try": 1.4025, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535691 + }, + "20058": { + "problemId": "20058", + "problemLevel": 12, + "problemName": "마법사 상어와 파이어스톰", + "average_try": 2.55, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.53572 + }, + "8972": { + "problemId": "8972", + "problemLevel": 13, + "problemName": "미친 아두이노", + "average_try": 3.7312, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535746 + }, + "17822": { + "problemId": "17822", + "problemLevel": 13, + "problemName": "원판 돌리기", + "average_try": 3.2036, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535771 + }, + "19236": { + "problemId": "19236", + "problemLevel": 14, + "problemName": "청소년 상어", + "average_try": 1.5782, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535796 + }, + "13459": { + "problemId": "13459", + "problemLevel": 13, + "problemName": "구슬 탈출", + "average_try": 3.0272, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.535821 + }, + "2933": { + "problemId": "2933", + "problemLevel": 14, + "problemName": "미네랄", + "average_try": 4.0671, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535845 + }, + "19237": { + "problemId": "19237", + "problemLevel": 13, + "problemName": "어른 상어", + "average_try": 2.6078, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535869 + }, + "18808": { + "problemId": "18808", + "problemLevel": 13, + "problemName": "스티커 붙이기", + "average_try": 1.579, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535892 + }, + "18500": { + "problemId": "18500", + "problemLevel": 14, + "problemName": "미네랄 2", + "average_try": 2.8846, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535916 + }, + "17143": { + "problemId": "17143", + "problemLevel": 14, + "problemName": "낚시왕", + "average_try": 4.0947, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535939 + }, + "17837": { + "problemId": "17837", + "problemLevel": 14, + "problemName": "새로운 게임 2", + "average_try": 2.1975, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535963 + }, + "15653": { + "problemId": "15653", + "problemLevel": 15, + "problemName": "구슬 탈출 4", + "average_try": 2.337, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.535986 + }, + "17780": { + "problemId": "17780", + "problemLevel": 14, + "problemName": "새로운 게임", + "average_try": 2.2305, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.53601 + }, + "20061": { + "problemId": "20061", + "problemLevel": 14, + "problemName": "모노미노도미노 2", + "average_try": 2.8092, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.536033 + }, + "5373": { + "problemId": "5373", + "problemLevel": 16, + "problemName": "큐빙", + "average_try": 2.6716, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.536058 + }, + "18809": { + "problemId": "18809", + "problemLevel": 15, + "problemName": "Gaaaaaaaaaarden", + "average_try": 2.4077, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.536082 + }, + "16939": { + "problemId": "16939", + "problemLevel": 14, + "problemName": "2×2×2 큐브", + "average_try": 2.2571, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.536106 + }, + "19235": { + "problemId": "19235", + "problemLevel": 16, + "problemName": "모노미노도미노", + "average_try": 5.1732, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.536129 + }, + "3025": { + "problemId": "3025", + "problemLevel": 16, + "problemName": "돌 던지기", + "average_try": 6.3312, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.536152 + }, + "13460": { + "problemId": "13460", + "problemLevel": 15, + "problemName": "구슬 탈출 2", + "average_try": 3.7969, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.536175 + }, + "15644": { + "problemId": "15644", + "problemLevel": 15, + "problemName": "구슬 탈출 3", + "average_try": 1.8198, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.536198 + }, + "21609": { + "problemId": "21609", + "problemLevel": 14, + "problemName": "상어 중학교", + "average_try": 3.1166, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.536221 + }, + "21610": { + "problemId": "21610", + "problemLevel": 11, + "problemName": "마법사 상어와 비바라기", + "average_try": 1.929, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.536244 + }, + "21922": { + "problemId": "21922", + "problemLevel": 11, + "problemName": "학부 연구생 민상", + "average_try": 4.5208, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 141, + "key": "simulation" + } + ], + "lastupdate": 1640720099.536268 + }, + "22861": { + "problemId": "22861", + "problemLevel": 14, + "problemName": "폴더 정리 (large)", + "average_try": 4.3333, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 136, + "key": "hash_set" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 96, + "key": "parsing" + }, + { + "bojTagId": 62, + "key": "recursion" + }, + { + "bojTagId": 141, + "key": "simulation" + }, + { + "bojTagId": 158, + "key": "string" + }, + { + "bojTagId": 120, + "key": "trees" + }, + { + "bojTagId": 74, + "key": "tree_set" + } + ], + "lastupdate": 1640720099.536291 + }, + "3029": { + "problemId": "3029", + "problemLevel": 3, + "problemName": "경고", + "average_try": 2.6035, + "solvedtags": [ + { + "bojTagId": 121, + "key": "arithmetic" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 96, + "key": "parsing" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537001 + }, + "1942": { + "problemId": "1942", + "problemLevel": 4, + "problemName": "디지털시계", + "average_try": 1.9404, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 96, + "key": "parsing" + }, + { + "bojTagId": 141, + "key": "simulation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537035 + }, + "20944": { + "problemId": "20944", + "problemLevel": 3, + "problemName": "팰린드롬 척화비", + "average_try": 1.2757, + "solvedtags": [ + { + "bojTagId": 109, + "key": "ad_hoc" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537063 + }, + "11720": { + "problemId": "11720", + "problemLevel": 4, + "problemName": "숫자의 합", + "average_try": 1.8608, + "solvedtags": [ + { + "bojTagId": 121, + "key": "arithmetic" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537088 + }, + "1152": { + "problemId": "1152", + "problemLevel": 4, + "problemName": "단어의 개수", + "average_try": 3.3453, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537114 + }, + "10809": { + "problemId": "10809", + "problemLevel": 4, + "problemName": "알파벳 찾기", + "average_try": 1.8748, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537139 + }, + "10808": { + "problemId": "10808", + "problemLevel": 4, + "problemName": "알파벳 개수", + "average_try": 1.4309, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537219 + }, + "11365": { + "problemId": "11365", + "problemLevel": 4, + "problemName": "!밀비 급일", + "average_try": 1.5668, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537255 + }, + "1159": { + "problemId": "1159", + "problemLevel": 4, + "problemName": "농구 경기", + "average_try": 1.9485, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537282 + }, + "2744": { + "problemId": "2744", + "problemLevel": 4, + "problemName": "대소문자 바꾸기", + "average_try": 1.2584, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537308 + }, + "1718": { + "problemId": "1718", + "problemLevel": 4, + "problemName": "암호", + "average_try": 1.9102, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537333 + }, + "9046": { + "problemId": "9046", + "problemLevel": 5, + "problemName": "복호화", + "average_try": 2.0373, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537357 + }, + "1032": { + "problemId": "1032", + "problemLevel": 5, + "problemName": "명령 프롬프트", + "average_try": 1.9365, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537382 + }, + "10798": { + "problemId": "10798", + "problemLevel": 5, + "problemName": "세로읽기", + "average_try": 1.7534, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537405 + }, + "10988": { + "problemId": "10988", + "problemLevel": 5, + "problemName": "팰린드롬인지 확인하기", + "average_try": 1.4608, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537429 + }, + "11655": { + "problemId": "11655", + "problemLevel": 5, + "problemName": "ROT13", + "average_try": 1.5935, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537453 + }, + "1259": { + "problemId": "1259", + "problemLevel": 5, + "problemName": "팰린드롬수", + "average_try": 1.6662, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537477 + }, + "9933": { + "problemId": "9933", + "problemLevel": 5, + "problemName": "민균이의 비밀번호", + "average_try": 2.8179, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.5375 + }, + "6996": { + "problemId": "6996", + "problemLevel": 5, + "problemName": "애너그램", + "average_try": 1.9577, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537524 + }, + "20154": { + "problemId": "20154", + "problemLevel": 5, + "problemName": "이 구역의 승자는 누구야?!", + "average_try": 1.5166, + "solvedtags": [ + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537548 + }, + "1316": { + "problemId": "1316", + "problemLevel": 6, + "problemName": "그룹 단어 체커", + "average_try": 1.9163, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537572 + }, + "2941": { + "problemId": "2941", + "problemLevel": 6, + "problemName": "크로아티아 알파벳", + "average_try": 2.222, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537596 + }, + "1181": { + "problemId": "1181", + "problemLevel": 6, + "problemName": "단어 정렬", + "average_try": 2.4801, + "solvedtags": [ + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.53762 + }, + "3613": { + "problemId": "3613", + "problemLevel": 7, + "problemName": "Java vs C++", + "average_try": 5.1057, + "solvedtags": [ + { + "bojTagId": 137, + "key": "case_work" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 96, + "key": "parsing" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537644 + }, + "9536": { + "problemId": "9536", + "problemLevel": 7, + "problemName": "여우는 어떻게 울지?", + "average_try": 2.6043, + "solvedtags": [ + { + "bojTagId": 96, + "key": "parsing" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537667 + }, + "14405": { + "problemId": "14405", + "problemLevel": 6, + "problemName": "피카츄", + "average_try": 2.0731, + "solvedtags": [ + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537691 + }, + "4659": { + "problemId": "4659", + "problemLevel": 6, + "problemName": "비밀번호 발음하기", + "average_try": 1.8184, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537714 + }, + "16171": { + "problemId": "16171", + "problemLevel": 6, + "problemName": "나는 친구가 적다 (Small)", + "average_try": 1.8988, + "solvedtags": [ + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537738 + }, + "12871": { + "problemId": "12871", + "problemLevel": 6, + "problemName": "무한 문자열", + "average_try": 2.7676, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537762 + }, + "2204": { + "problemId": "2204", + "problemLevel": 6, + "problemName": "도비의 난독증 테스트", + "average_try": 1.8647, + "solvedtags": [ + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537785 + }, + "4446": { + "problemId": "4446", + "problemLevel": 6, + "problemName": "ROT13", + "average_try": 3.5083, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537809 + }, + "9342": { + "problemId": "9342", + "problemLevel": 7, + "problemName": "염색체", + "average_try": 1.4545, + "solvedtags": [ + { + "bojTagId": 63, + "key": "regex" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537832 + }, + "20114": { + "problemId": "20114", + "problemLevel": 6, + "problemName": "미아 노트", + "average_try": 1.2816, + "solvedtags": [ + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537855 + }, + "12933": { + "problemId": "12933", + "problemLevel": 7, + "problemName": "오리", + "average_try": 2.8467, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537877 + }, + "5534": { + "problemId": "5534", + "problemLevel": 6, + "problemName": "간판", + "average_try": 1.9853, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537901 + }, + "6550": { + "problemId": "6550", + "problemLevel": 6, + "problemName": "부분 문자열", + "average_try": 2.7459, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537924 + }, + "4396": { + "problemId": "4396", + "problemLevel": 6, + "problemName": "지뢰 찾기", + "average_try": 3.4, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 96, + "key": "parsing" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537947 + }, + "9242": { + "problemId": "9242", + "problemLevel": 6, + "problemName": "폭탄 해체", + "average_try": 1.9587, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.53797 + }, + "4836": { + "problemId": "4836", + "problemLevel": 7, + "problemName": "춤", + "average_try": 2.7442, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 96, + "key": "parsing" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.537992 + }, + "1764": { + "problemId": "1764", + "problemLevel": 7, + "problemName": "듣보잡", + "average_try": 2.5006, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 136, + "key": "hash_set" + }, + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.538015 + }, + "11656": { + "problemId": "11656", + "problemLevel": 7, + "problemName": "접미사 배열", + "average_try": 1.4369, + "solvedtags": [ + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.538039 + }, + "1620": { + "problemId": "1620", + "problemLevel": 7, + "problemName": "나는야 포켓몬 마스터 이다솜", + "average_try": 3.0375, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 136, + "key": "hash_set" + } + ], + "lastupdate": 1640720099.538062 + }, + "1213": { + "problemId": "1213", + "problemLevel": 7, + "problemName": "팰린드롬 만들기", + "average_try": 2.7884, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.538084 + }, + "20291": { + "problemId": "20291", + "problemLevel": 8, + "problemName": "파일 정리", + "average_try": 1.4661, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 136, + "key": "hash_set" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 96, + "key": "parsing" + }, + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 158, + "key": "string" + }, + { + "bojTagId": 74, + "key": "tree_set" + } + ], + "lastupdate": 1640720099.538106 + }, + "19844": { + "problemId": "19844", + "problemLevel": 7, + "problemName": "단어 개수 세기", + "average_try": 2.9548, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.538129 + }, + "1622": { + "problemId": "1622", + "problemLevel": 6, + "problemName": "공통 순열", + "average_try": 4.3718, + "solvedtags": [ + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.538152 + }, + "17413": { + "problemId": "17413", + "problemLevel": 8, + "problemName": "단어 뒤집기 2", + "average_try": 1.7816, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.538174 + }, + "11478": { + "problemId": "11478", + "problemLevel": 8, + "problemName": "서로 다른 부분 문자열의 개수", + "average_try": 1.7137, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 136, + "key": "hash_set" + }, + { + "bojTagId": 158, + "key": "string" + }, + { + "bojTagId": 74, + "key": "tree_set" + } + ], + "lastupdate": 1640720099.538197 + }, + "2852": { + "problemId": "2852", + "problemLevel": 7, + "problemName": "NBA 농구", + "average_try": 2.9908, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.53822 + }, + "1972": { + "problemId": "1972", + "problemLevel": 8, + "problemName": "놀라운 문자열", + "average_try": 1.6753, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 136, + "key": "hash_set" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.538242 + }, + "19948": { + "problemId": "19948", + "problemLevel": 8, + "problemName": "음유시인 영재", + "average_try": 3.7669, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.538265 + }, + "9548": { + "problemId": "9548", + "problemLevel": 8, + "problemName": "무제", + "average_try": 2.7547, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 159, + "key": "rope" + }, + { + "bojTagId": 69, + "key": "splay_tree" + }, + { + "bojTagId": 158, + "key": "string" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.538287 + }, + "17609": { + "problemId": "17609", + "problemLevel": 10, + "problemName": "회문", + "average_try": 3.542, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + }, + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.53831 + }, + "3005": { + "problemId": "3005", + "problemLevel": 9, + "problemName": "크로스워드 퍼즐 쳐다보기", + "average_try": 2.0932, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 96, + "key": "parsing" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.538334 + }, + "19583": { + "problemId": "19583", + "problemLevel": 10, + "problemName": "싸이버개강총회", + "average_try": 2.4674, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 136, + "key": "hash_set" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 96, + "key": "parsing" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.538357 + }, + "13022": { + "problemId": "13022", + "problemLevel": 10, + "problemName": "늑대와 올바른 단어", + "average_try": 3.2708, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 96, + "key": "parsing" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.538379 + }, + "15927": { + "problemId": "15927", + "problemLevel": 11, + "problemName": "회문은 회문아니야!!", + "average_try": 2.3474, + "solvedtags": [ + { + "bojTagId": 109, + "key": "ad_hoc" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.538402 + }, + "3107": { + "problemId": "3107", + "problemLevel": 11, + "problemName": "IPv6", + "average_try": 2.78, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.538425 + }, + "2671": { + "problemId": "2671", + "problemLevel": 11, + "problemName": "잠수함식별", + "average_try": 2.6366, + "solvedtags": [ + { + "bojTagId": 63, + "key": "regex" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.538447 + }, + "20437": { + "problemId": "20437", + "problemLevel": 11, + "problemName": "문자열 게임 2", + "average_try": 2.2591, + "solvedtags": [ + { + "bojTagId": 68, + "key": "sliding_window" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.53847 + }, + "16916": { + "problemId": "16916", + "problemLevel": 13, + "problemName": "부분 문자열", + "average_try": 2.7625, + "solvedtags": [ + { + "bojTagId": 40, + "key": "kmp" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.538493 + }, + "2115": { + "problemId": "2115", + "problemLevel": 12, + "problemName": "갤러리", + "average_try": 1.3495, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + } + ], + "lastupdate": 1640720099.538515 + }, + "16890": { + "problemId": "16890", + "problemLevel": 13, + "problemName": "창업", + "average_try": 5.9857, + "solvedtags": [ + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.538537 + }, + "20210": { + "problemId": "20210", + "problemLevel": 14, + "problemName": "파일 탐색기", + "average_try": 4.2778, + "solvedtags": [ + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.53856 + }, + "14567": { + "problemId": "14567", + "problemLevel": 11, + "problemName": "선수과목 (Prerequisite)", + "average_try": 1.5097, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 78, + "key": "topological_sorting" + } + ], + "lastupdate": 1640720099.539452 + }, + "2056": { + "problemId": "2056", + "problemLevel": 12, + "problemName": "작업", + "average_try": 2.3477, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 78, + "key": "topological_sorting" + } + ], + "lastupdate": 1640720099.539498 + }, + "14676": { + "problemId": "14676", + "problemLevel": 12, + "problemName": "영우는 사기꾼?", + "average_try": 3.0422, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 102, + "key": "implementation" + }, + { + "bojTagId": 78, + "key": "topological_sorting" + } + ], + "lastupdate": 1640720099.539528 + }, + "1005": { + "problemId": "1005", + "problemLevel": 13, + "problemName": "ACM Craft", + "average_try": 4.0813, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 78, + "key": "topological_sorting" + } + ], + "lastupdate": 1640720099.539555 + }, + "1516": { + "problemId": "1516", + "problemLevel": 13, + "problemName": "게임 개발", + "average_try": 2.0828, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 78, + "key": "topological_sorting" + } + ], + "lastupdate": 1640720099.539579 + }, + "9470": { + "problemId": "9470", + "problemLevel": 13, + "problemName": "Strahler 순서", + "average_try": 2.5184, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 78, + "key": "topological_sorting" + } + ], + "lastupdate": 1640720099.539603 + }, + "2252": { + "problemId": "2252", + "problemLevel": 13, + "problemName": "줄 세우기", + "average_try": 1.8293, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 78, + "key": "topological_sorting" + } + ], + "lastupdate": 1640720099.539627 + }, + "1766": { + "problemId": "1766", + "problemLevel": 14, + "problemName": "문제집", + "average_try": 2.1222, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 59, + "key": "priority_queue" + }, + { + "bojTagId": 78, + "key": "topological_sorting" + } + ], + "lastupdate": 1640720099.539651 + }, + "2623": { + "problemId": "2623", + "problemLevel": 14, + "problemName": "음악프로그램", + "average_try": 2.0482, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 78, + "key": "topological_sorting" + } + ], + "lastupdate": 1640720099.539675 + }, + "2637": { + "problemId": "2637", + "problemLevel": 14, + "problemName": "장난감 조립", + "average_try": 2.1457, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 78, + "key": "topological_sorting" + } + ], + "lastupdate": 1640720099.539698 + }, + "20119": { + "problemId": "20119", + "problemLevel": 15, + "problemName": "클레어와 물약", + "average_try": 3.3858, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 78, + "key": "topological_sorting" + } + ], + "lastupdate": 1640720099.539722 + }, + "3665": { + "problemId": "3665", + "problemLevel": 15, + "problemName": "최종 순위", + "average_try": 2.7497, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 78, + "key": "topological_sorting" + } + ], + "lastupdate": 1640720099.539746 + }, + "1948": { + "problemId": "1948", + "problemLevel": 16, + "problemName": "임계경로", + "average_try": 3.3721, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 78, + "key": "topological_sorting" + } + ], + "lastupdate": 1640720099.539769 + }, + "1991": { + "problemId": "1991", + "problemLevel": 10, + "problemName": "트리 순회", + "average_try": 1.5406, + "solvedtags": [ + { + "bojTagId": 62, + "key": "recursion" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.540166 + }, + "9372": { + "problemId": "9372", + "problemLevel": 8, + "problemName": "상근이의 여행", + "average_try": 1.6359, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.540199 + }, + "9934": { + "problemId": "9934", + "problemLevel": 10, + "problemName": "완전 이진 트리", + "average_try": 1.4572, + "solvedtags": [ + { + "bojTagId": 62, + "key": "recursion" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.540227 + }, + "11725": { + "problemId": "11725", + "problemLevel": 9, + "problemName": "트리의 부모 찾기", + "average_try": 2.3595, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.540252 + }, + "20364": { + "problemId": "20364", + "problemLevel": 9, + "problemName": "부동산 다툼", + "average_try": 3.3834, + "solvedtags": [ + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.540277 + }, + "1068": { + "problemId": "1068", + "problemLevel": 11, + "problemName": "트리", + "average_try": 3.7239, + "solvedtags": [ + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.540302 + }, + "5639": { + "problemId": "5639", + "problemLevel": 10, + "problemName": "이진 검색 트리", + "average_try": 2.6409, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 62, + "key": "recursion" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.540326 + }, + "15900": { + "problemId": "15900", + "problemLevel": 10, + "problemName": "나무 탈출", + "average_try": 2.4957, + "solvedtags": [ + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.54035 + }, + "6416": { + "problemId": "6416", + "problemLevel": 11, + "problemName": "트리인가?", + "average_try": 4.9727, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.540374 + }, + "14675": { + "problemId": "14675", + "problemLevel": 11, + "problemName": "단절점과 단절선", + "average_try": 1.9596, + "solvedtags": [ + { + "bojTagId": 4, + "key": "articulation" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.540398 + }, + "15681": { + "problemId": "15681", + "problemLevel": 11, + "problemName": "트리와 쿼리", + "average_try": 2.0156, + "solvedtags": [ + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 92, + "key": "dp_tree" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.540422 + }, + "17073": { + "problemId": "17073", + "problemLevel": 11, + "problemName": "나무 위의 빗물", + "average_try": 2.485, + "solvedtags": [ + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.540446 + }, + "19641": { + "problemId": "19641", + "problemLevel": 11, + "problemName": "중첩 집합 모델", + "average_try": 2.3896, + "solvedtags": [ + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.54047 + }, + "1240": { + "problemId": "1240", + "problemLevel": 11, + "problemName": "노드사이의 거리", + "average_try": 1.87, + "solvedtags": [ + { + "bojTagId": 126, + "key": "bfs" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.540494 + }, + "1967": { + "problemId": "1967", + "problemLevel": 12, + "problemName": "트리의 지름", + "average_try": 2.2727, + "solvedtags": [ + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.540518 + }, + "3584": { + "problemId": "3584", + "problemLevel": 12, + "problemName": "가장 가까운 공통 조상", + "average_try": 1.8627, + "solvedtags": [ + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 41, + "key": "lca" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.540543 + }, + "4256": { + "problemId": "4256", + "problemLevel": 13, + "problemName": "트리", + "average_try": 1.8405, + "solvedtags": [ + { + "bojTagId": 24, + "key": "divide_and_conquer" + }, + { + "bojTagId": 62, + "key": "recursion" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.540567 + }, + "4803": { + "problemId": "4803", + "problemLevel": 12, + "problemName": "트리", + "average_try": 2.9898, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 81, + "key": "disjoint_set" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.54059 + }, + "4933": { + "problemId": "4933", + "problemLevel": 13, + "problemName": "뉴턴의 사과", + "average_try": 1.6429, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 71, + "key": "stack" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.540613 + }, + "9489": { + "problemId": "9489", + "problemLevel": 12, + "problemName": "사촌", + "average_try": 3.4359, + "solvedtags": [ + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.540636 + }, + "14267": { + "problemId": "14267", + "problemLevel": 12, + "problemName": "회사 문화 1", + "average_try": 2.5269, + "solvedtags": [ + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 92, + "key": "dp_tree" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.540659 + }, + "19542": { + "problemId": "19542", + "problemLevel": 12, + "problemName": "전단지 돌리기", + "average_try": 2.3875, + "solvedtags": [ + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.540683 + }, + "20924": { + "problemId": "20924", + "problemLevel": 12, + "problemName": "트리의 기둥과 가지", + "average_try": 2.8579, + "solvedtags": [ + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.540706 + }, + "20955": { + "problemId": "20955", + "problemLevel": 12, + "problemName": "민서의 응급 수술", + "average_try": 2.7952, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 81, + "key": "disjoint_set" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.540812 + }, + "21276": { + "problemId": "21276", + "problemLevel": 13, + "problemName": "계보 복원가 호석", + "average_try": 2.0508, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 136, + "key": "hash_set" + }, + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 78, + "key": "topological_sorting" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.540847 + }, + "1167": { + "problemId": "1167", + "problemLevel": 13, + "problemName": "트리의 지름", + "average_try": 2.9105, + "solvedtags": [ + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.540878 + }, + "1595": { + "problemId": "1595", + "problemLevel": 13, + "problemName": "북쪽나라의 도로", + "average_try": 3.2021, + "solvedtags": [ + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.540909 + }, + "2058": { + "problemId": "2058", + "problemLevel": 13, + "problemName": "원자의 에너지", + "average_try": 3.5, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 92, + "key": "dp_tree" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.540937 + }, + "2263": { + "problemId": "2263", + "problemLevel": 14, + "problemName": "트리의 순회", + "average_try": 2.9098, + "solvedtags": [ + { + "bojTagId": 24, + "key": "divide_and_conquer" + }, + { + "bojTagId": 62, + "key": "recursion" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.540965 + }, + "2533": { + "problemId": "2533", + "problemLevel": 13, + "problemName": "사회망 서비스(SNS)", + "average_try": 2.8453, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 92, + "key": "dp_tree" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.540993 + }, + "11437": { + "problemId": "11437", + "problemLevel": 13, + "problemName": "LCA", + "average_try": 2.3267, + "solvedtags": [ + { + "bojTagId": 41, + "key": "lca" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.541022 + }, + "12896": { + "problemId": "12896", + "problemLevel": 13, + "problemName": "스크루지 민호", + "average_try": 2.6667, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.541051 + }, + "19535": { + "problemId": "19535", + "problemLevel": 13, + "problemName": "ㄷㄷㄷㅈ", + "average_try": 3.2653, + "solvedtags": [ + { + "bojTagId": 6, + "key": "combinatorics" + }, + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.541079 + }, + "2250": { + "problemId": "2250", + "problemLevel": 14, + "problemName": "트리의 높이와 너비", + "average_try": 3.6781, + "solvedtags": [ + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.541107 + }, + "4315": { + "problemId": "4315", + "problemLevel": 15, + "problemName": "나무 위의 구슬", + "average_try": 2.0541, + "solvedtags": [ + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.541134 + }, + "14657": { + "problemId": "14657", + "problemLevel": 14, + "problemName": "준오는 최종인재야!!", + "average_try": 3.6019, + "solvedtags": [ + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.541161 + }, + "16437": { + "problemId": "16437", + "problemLevel": 14, + "problemName": "양 구출 작전", + "average_try": 3.4979, + "solvedtags": [ + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.54119 + }, + "1949": { + "problemId": "1949", + "problemLevel": 15, + "problemName": "우수 마을", + "average_try": 1.9817, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 92, + "key": "dp_tree" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.541239 + }, + "2213": { + "problemId": "2213", + "problemLevel": 15, + "problemName": "트리의 독립집합", + "average_try": 2.0315, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 92, + "key": "dp_tree" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.541266 + }, + "2233": { + "problemId": "2233", + "problemLevel": 15, + "problemName": "사과나무", + "average_try": 3.1241, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 41, + "key": "lca" + }, + { + "bojTagId": 71, + "key": "stack" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.541294 + }, + "12912": { + "problemId": "12912", + "problemLevel": 15, + "problemName": "트리 수정", + "average_try": 2.1333, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.541321 + }, + "12978": { + "problemId": "12978", + "problemLevel": 13, + "problemName": "스크루지 민호 2", + "average_try": 2.0769, + "solvedtags": [ + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 92, + "key": "dp_tree" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.541347 + }, + "14570": { + "problemId": "14570", + "problemLevel": 14, + "problemName": "나무 위의 구슬", + "average_try": 3.2146, + "solvedtags": [ + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 62, + "key": "recursion" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.541373 + }, + "19581": { + "problemId": "19581", + "problemLevel": 15, + "problemName": "두 번째 트리의 지름", + "average_try": 2.2808, + "solvedtags": [ + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 120, + "key": "trees" + } + ], + "lastupdate": 1640720099.5414 + }, + "14425": { + "problemId": "14425", + "problemLevel": 8, + "problemName": "문자열 집합", + "average_try": 1.8101, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 158, + "key": "string" + }, + { + "bojTagId": 120, + "key": "trees" + }, + { + "bojTagId": 74, + "key": "tree_set" + }, + { + "bojTagId": 79, + "key": "trie" + } + ], + "lastupdate": 1640720099.542172 + }, + "5052": { + "problemId": "5052", + "problemLevel": 12, + "problemName": "전화번호 목록", + "average_try": 3.3791, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 158, + "key": "string" + }, + { + "bojTagId": 120, + "key": "trees" + }, + { + "bojTagId": 79, + "key": "trie" + } + ], + "lastupdate": 1640720099.542212 + }, + "4358": { + "problemId": "4358", + "problemLevel": 10, + "problemName": "생태학", + "average_try": 2.6768, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 136, + "key": "hash_set" + }, + { + "bojTagId": 158, + "key": "string" + }, + { + "bojTagId": 74, + "key": "tree_set" + } + ], + "lastupdate": 1640720099.542244 + }, + "14725": { + "problemId": "14725", + "problemLevel": 14, + "problemName": "개미굴", + "average_try": 1.5012, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 158, + "key": "string" + }, + { + "bojTagId": 120, + "key": "trees" + }, + { + "bojTagId": 79, + "key": "trie" + } + ], + "lastupdate": 1640720099.542274 + }, + "20166": { + "problemId": "20166", + "problemLevel": 11, + "problemName": "문자열 지옥에 빠진 호석", + "average_try": 2.7725, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 136, + "key": "hash_set" + }, + { + "bojTagId": 158, + "key": "string" + } + ], + "lastupdate": 1640720099.542303 + }, + "9202": { + "problemId": "9202", + "problemLevel": 16, + "problemName": "Boggle", + "average_try": 4.0512, + "solvedtags": [ + { + "bojTagId": 5, + "key": "backtracking" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 127, + "key": "dfs" + }, + { + "bojTagId": 7, + "key": "graphs" + }, + { + "bojTagId": 11, + "key": "graph_traversal" + }, + { + "bojTagId": 158, + "key": "string" + }, + { + "bojTagId": 120, + "key": "trees" + }, + { + "bojTagId": 79, + "key": "trie" + } + ], + "lastupdate": 1640720099.542332 + }, + "5670": { + "problemId": "5670", + "problemLevel": 17, + "problemName": "휴대폰 자판", + "average_try": 3.2965, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 158, + "key": "string" + }, + { + "bojTagId": 120, + "key": "trees" + }, + { + "bojTagId": 79, + "key": "trie" + } + ], + "lastupdate": 1640720099.54236 + }, + "5446": { + "problemId": "5446", + "problemLevel": 18, + "problemName": "용량 부족", + "average_try": 2.822, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 120, + "key": "trees" + }, + { + "bojTagId": 79, + "key": "trie" + } + ], + "lastupdate": 1640720099.542387 + }, + "19585": { + "problemId": "19585", + "problemLevel": 18, + "problemName": "전설", + "average_try": 6.7436, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 8, + "key": "hashing" + }, + { + "bojTagId": 120, + "key": "trees" + }, + { + "bojTagId": 79, + "key": "trie" + } + ], + "lastupdate": 1640720099.542414 + }, + "2470": { + "problemId": "2470", + "problemLevel": 11, + "problemName": "두 용액", + "average_try": 3.2674, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.542773 + }, + "15961": { + "problemId": "15961", + "problemLevel": 12, + "problemName": "회전 초밥", + "average_try": 2.6036, + "solvedtags": [ + { + "bojTagId": 68, + "key": "sliding_window" + }, + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.54281 + }, + "1806": { + "problemId": "1806", + "problemLevel": 12, + "problemName": "부분합", + "average_try": 3.9578, + "solvedtags": [ + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.542841 + }, + "7453": { + "problemId": "7453", + "problemLevel": 14, + "problemName": "합이 0인 네 정수", + "average_try": 4.4501, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 46, + "key": "mitm" + }, + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.542871 + }, + "15565": { + "problemId": "15565", + "problemLevel": 10, + "problemName": "귀여운 라이언", + "average_try": 2.4578, + "solvedtags": [ + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.542905 + }, + "2467": { + "problemId": "2467", + "problemLevel": 11, + "problemName": "용액", + "average_try": 2.8021, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.542933 + }, + "2473": { + "problemId": "2473", + "problemLevel": 12, + "problemName": "세 용액", + "average_try": 3.8241, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.542961 + }, + "1644": { + "problemId": "1644", + "problemLevel": 13, + "problemName": "소수의 연속합", + "average_try": 2.3677, + "solvedtags": [ + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + }, + { + "bojTagId": 9, + "key": "primality_test" + }, + { + "bojTagId": 67, + "key": "sieve" + }, + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.542989 + }, + "20181": { + "problemId": "20181", + "problemLevel": 14, + "problemName": "꿈틀꿈틀 호석 애벌레 - 효율성", + "average_try": 2.3981, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 25, + "key": "dp" + }, + { + "bojTagId": 139, + "key": "prefix_sum" + }, + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.543017 + }, + "16472": { + "problemId": "16472", + "problemLevel": 13, + "problemName": "고냥이", + "average_try": 2.368, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.543047 + }, + "11728": { + "problemId": "11728", + "problemLevel": 6, + "problemName": "배열 합치기", + "average_try": 2.2327, + "solvedtags": [ + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.543076 + }, + "2018": { + "problemId": "2018", + "problemLevel": 6, + "problemName": "수들의 합 5", + "average_try": 1.7347, + "solvedtags": [ + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.543104 + }, + "1940": { + "problemId": "1940", + "problemLevel": 7, + "problemName": "주몽", + "average_try": 2.0285, + "solvedtags": [ + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.543131 + }, + "3273": { + "problemId": "3273", + "problemLevel": 8, + "problemName": "두 수의 합", + "average_try": 2.6286, + "solvedtags": [ + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.543158 + }, + "10025": { + "problemId": "10025", + "problemLevel": 7, + "problemName": "게으른 백곰", + "average_try": 3.0465, + "solvedtags": [ + { + "bojTagId": 68, + "key": "sliding_window" + }, + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.543184 + }, + "6159": { + "problemId": "6159", + "problemLevel": 7, + "problemName": "코스튬 파티", + "average_try": 1.5944, + "solvedtags": [ + { + "bojTagId": 139, + "key": "prefix_sum" + } + ], + "lastupdate": 1640720099.543211 + }, + "2003": { + "problemId": "2003", + "problemLevel": 8, + "problemName": "수들의 합 2", + "average_try": 2.0532, + "solvedtags": [ + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.543237 + }, + "2559": { + "problemId": "2559", + "problemLevel": 8, + "problemName": "수열", + "average_try": 2.891, + "solvedtags": [ + { + "bojTagId": 139, + "key": "prefix_sum" + }, + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.543264 + }, + "2531": { + "problemId": "2531", + "problemLevel": 10, + "problemName": "회전 초밥", + "average_try": 2.5721, + "solvedtags": [ + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.54329 + }, + "2118": { + "problemId": "2118", + "problemLevel": 10, + "problemName": "두 개의 탑", + "average_try": 2.5353, + "solvedtags": [ + { + "bojTagId": 139, + "key": "prefix_sum" + }, + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.543316 + }, + "20922": { + "problemId": "20922", + "problemLevel": 10, + "problemName": "겹치는 건 싫어", + "average_try": 3.1792, + "solvedtags": [ + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.543342 + }, + "2230": { + "problemId": "2230", + "problemLevel": 11, + "problemName": "수 고르기", + "average_try": 3.3834, + "solvedtags": [ + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.543369 + }, + "14921": { + "problemId": "14921", + "problemLevel": 11, + "problemName": "용액 합성하기", + "average_try": 2.7585, + "solvedtags": [ + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.543395 + }, + "9024": { + "problemId": "9024", + "problemLevel": 11, + "problemName": "두 수의 합", + "average_try": 2.3824, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.543421 + }, + "1484": { + "problemId": "1484", + "problemLevel": 12, + "problemName": "다이어트", + "average_try": 2.821, + "solvedtags": [ + { + "bojTagId": 124, + "key": "math" + }, + { + "bojTagId": 95, + "key": "number_theory" + }, + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.543447 + }, + "13422": { + "problemId": "13422", + "problemLevel": 12, + "problemName": "도둑", + "average_try": 3.5131, + "solvedtags": [ + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.543517 + }, + "15831": { + "problemId": "15831", + "problemLevel": 13, + "problemName": "준표의 조약돌", + "average_try": 3.0828, + "solvedtags": [ + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.543544 + }, + "20366": { + "problemId": "20366", + "problemLevel": 13, + "problemName": "같이 눈사람 만들래?", + "average_try": 3.6357, + "solvedtags": [ + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.54357 + }, + "6137": { + "problemId": "6137", + "problemLevel": 12, + "problemName": "문자열 생성", + "average_try": 4.1078, + "solvedtags": [ + { + "bojTagId": 33, + "key": "greedy" + }, + { + "bojTagId": 158, + "key": "string" + }, + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.543596 + }, + "3151": { + "problemId": "3151", + "problemLevel": 12, + "problemName": "합이 0", + "average_try": 4.6986, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 125, + "key": "bruteforcing" + }, + { + "bojTagId": 97, + "key": "sorting" + }, + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.543622 + }, + "20442": { + "problemId": "20442", + "problemLevel": 13, + "problemName": "ㅋㅋ루ㅋㅋ", + "average_try": 2.6867, + "solvedtags": [ + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.543648 + }, + "21279": { + "problemId": "21279", + "problemLevel": 15, + "problemName": "광부 호석", + "average_try": 4.6944, + "solvedtags": [ + { + "bojTagId": 175, + "key": "data_structures" + }, + { + "bojTagId": 59, + "key": "priority_queue" + }, + { + "bojTagId": 65, + "key": "segtree" + }, + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.543674 + }, + "2428": { + "problemId": "2428", + "problemLevel": 8, + "problemName": "표절", + "average_try": 3.6095, + "solvedtags": [ + { + "bojTagId": 12, + "key": "binary_search" + }, + { + "bojTagId": 68, + "key": "sliding_window" + }, + { + "bojTagId": 97, + "key": "sorting" + } + ], + "lastupdate": 1640720099.5437 + }, + "21921": { + "problemId": "21921", + "problemLevel": 8, + "problemName": "블로그", + "average_try": 2.212, + "solvedtags": [ + { + "bojTagId": 139, + "key": "prefix_sum" + }, + { + "bojTagId": 68, + "key": "sliding_window" + } + ], + "lastupdate": 1640720099.543726 + }, + "22862": { + "problemId": "22862", + "problemLevel": 10, + "problemName": "가장 긴 짝수 연속한 부분 수열 (large)", + "average_try": 2.5446, + "solvedtags": [ + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.543752 + }, + "22945": { + "problemId": "22945", + "problemLevel": 12, + "problemName": "팀 빌딩", + "average_try": 1.9189, + "solvedtags": [ + { + "bojTagId": 80, + "key": "two_pointer" + } + ], + "lastupdate": 1640720099.543778 + } +} \ No newline at end of file diff --git a/scripts/make_contributor.py b/scripts/make_contributor.py new file mode 100644 index 0000000..18e834b --- /dev/null +++ b/scripts/make_contributor.py @@ -0,0 +1,64 @@ +import json +import os + +data = dict() +contributors = list() + +with open('./markdown/contributor.json', 'r') as f: + data = json.load(f) + contributors = data.get('id') + f.close() + +LIST = list() +LN = "\n" + +# Header +LIST.append("## Contributors") +LIST.append(LN) + +LIST.append("") + +idx = 0 +columns = 5 +SP = " " +N = len(contributors) + +while idx < N: + cur = contributors[idx:idx + columns] + + # TOP + LIST.append(f"{SP}") + for ID in cur: + GITHUBID = data[ID]["githubid"] + LIST.append(f"{SP}{SP}") + LIST.append(f"{SP}") + + # BOTTOM + LIST.append(f"{SP}") + for ID in cur: + baekjoon = data[ID]["baekjoon"] + LIST.append(f"{SP}{SP}") + LIST.append(f"{SP}") + idx = idx + columns + +LIST.append("
") + LIST.append(f"{SP}{SP}{SP}") + LIST.append(f"{SP}{SP}{SP}
") + LIST.append(f"{SP}{SP}{SP}{ID}") + LIST.append(f"{SP}{SP}
") + if baekjoon == "$": + LIST.append(f"{SP}{SP}{SP}PRIVATE") + else: + LIST.append(f"{SP}{SP}{SP}") + LIST.append(f"{SP}{SP}{SP}
") + LIST.append(f"{SP}{SP}{SP}Baekjoon") + LIST.append(f"{SP}{SP}{SP}
") + LIST.append(f"{SP}{SP}{SP}solved.ac") + LIST.append(f"{SP}{SP}
") +LIST.append("\n") + +LIST = [ f"{_}\n" for _ in LIST ] + +with open('./markdown/contributors.md', 'w') as f: + f.writelines(LIST) + f.close() diff --git a/scripts/make_main_readme.py b/scripts/make_main_readme.py new file mode 100644 index 0000000..cee6f6d --- /dev/null +++ b/scripts/make_main_readme.py @@ -0,0 +1,57 @@ +import os +import subprocess as sp + +seq = [ "header.md", "codingtest_info.md", "workbook_header.md", "workbook.md", "workbook_footer.md", "contributors.md", "updatelog.md", "TODO.md", "footer.md" ] + +EXCEPT_FOLDER = [ 'solution', '.git', 'solutions', '.github', '__pycache__', 'markdown', "scripts" ] + +def getCount(folder): + lines = list() + with open(f'./{folder}/list.md', 'r') as f: + lines = f.readlines() + f.close() + + total = 0 + cnt = 0 + for line in lines: + S = line.split(",")[0] + total += 1 + if S != '': + cnt += 1 + + return cnt, total + +def make_table(file="./markdown/list.md"): + lines = list() + with open(file, 'r') as f: + lines = f.readlines() + f.close() + + ret = "| 순번 | Tag | 태그 | 문제집 | 추천 문제 수 | 총 문제 수 | 상태 |\n" + ret += "| :--: | :--------------------------: | :-----------------: | :------: | :---------: | :------: |:---------------:|\n" + for idx, line in enumerate(lines): + folder, tag_en, tag_kr, status = line.strip().split(',') + rec_cnt, total = getCount(folder) + curLine = f"| {idx:02d} | {tag_en} | {tag_kr} | [바로가기](./{folder}) | {rec_cnt:02d} | {total:02d} | ![status][{status}] |\n" + ret += curLine + + ret += ' \n \n\n ' + + with open('./markdown/workbook.md', 'w') as f: + f.write(ret) + f.close() + +def assemble(): + with open('./README.md', 'w') as f: + f.close() + + for md in seq: + os.system(f"cat ./markdown/{md} >> ./README.md") + +def make_contributors(): + os.system('python3 ./scripts/make_contributor.py') + +if __name__=="__main__": + make_contributors() + make_table() + assemble() diff --git a/scripts/make_table.py b/scripts/make_table.py new file mode 100644 index 0000000..f9f4ccd --- /dev/null +++ b/scripts/make_table.py @@ -0,0 +1,177 @@ +from API import SolvedAPI +import json + +def urlProblem(number, name): + FORMAT = f"{name}" + return FORMAT + +def urlSolution(link): + if link == "": + return "" + FORMAT = f"바로가기" + return FORMAT + +def urlLevel(level): + url = f"https://static.solved.ac/tier_small/{level}.svg" + ret = f"" + return ret + +class DataForm: + def __init__(self): + self.data = { + "id" : "", + "rec" : "", + "problemId" : "", + "name" : "", + "level" : "", + "url" : "", + "average_try" : "" + } + + def __lt__(self, other): + if self.data['rec'] == other.getItem('rec'): + LeftData = int( self.data['level'][73:][:-7]) + RightData = int(other.data['level'][73:][:-7]) + if LeftData == RightData: + return self.data['average_try'] < other.data['average_try'] + else: + return LeftData < RightData + + return self.data['rec'] != '' + + def __repr__(self): + ID = self.data['id'] + REC = ":heavy_check_mark:" if self.data['rec'] != "" else " " + PROBLEMID = self.data['problemId'] + NAME = self.data['name'] + LEVEL = self.data['level'] + URL = self.data['url'] + FORMATING = f"| {ID:02} | {REC:^20} | {PROBLEMID:^7} | {NAME:^20} | {LEVEL:^15} | {URL:^20} |" + return FORMATING + + def format(self): + return self.__repr__() + + def putItem(self, key, value): + assert key in self.data.keys(), f"[*** Key Error] {key}" + self.data[key] = value + + def getItem(self, key): + assert key in self.data.keys(), f"[*** Key Error] {key}" + return self.data[key] + + +class Table: + title = [ "순번", "추천 문제", "문제 번호", "문제 이름", "난이도", "풀이 링크" ] + keys = [ "id", "rec", "problemId", "name", "level", "url" ] + + def __init__(self, api, config): + self.config = config + self.api = api + self.data = list() + self.Line = list() + + def __read(self, File): + + assert type(File) == str, f"[*** Type Error] File type is {type(File)}.\n It must be str" + + self.data = list() + self.Line = list() + + with open(File, 'r') as f: + self.data = [ _.strip() for _ in f.readlines() ] + f.close() + + def __write(self, File): + + assert type(File) == str, f"[*** Type Error] File type is {type(File)}.\n It must be str" + + with open(File, 'w') as f: + f.writelines([ f"{_}\n" for _ in self.data ]) + f.close() + + def __writeREADME(self, tag): + READMEFile = f"./{tag}/README.md" + HEADERFile = f"./{tag}/header.md" + + headerData = None + # Read header + with open(HEADERFile, 'r') as f: + headerData = f.readlines() + f.close() + + # Make New + with open(READMEFile, 'w') as f: + f.writelines(headerData) + f.close() + + # Put Table + TableFormat = list() + A,B,C,D,E,F = self.title + TableFormat.append(f"| {A:^20} | {B:^20} | {C:^20} | {D:^20} | {E:^20} | {F:^20} |\n") + TableFormat.append(f"| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: |\n") + for line in self.Line: + TableFormat.append(f"{line.format()}\n") + with open(READMEFile, 'a+') as f: + f.writelines(TableFormat) + f.close() + + def makeForm(self, data, force=False): + # data -> rec, problemId, solution link + ret = dict() + recommend = data[0] + problemId = data[1] + solutionLink = data[2] + problemInfo = dict() + if force: + problemInfo = self.api.requestForce(problemId) + else: + problemInfo = self.api.request(problemId) + problemName = problemInfo.get('problemName') + problemLevel = problemInfo.get('problemLevel') + + ret[self.keys[1]] = data[0] + ret[self.keys[2]] = urlProblem(problemId, problemId) + ret[self.keys[3]] = urlProblem(problemId, problemName) + ret[self.keys[4]] = urlLevel(problemLevel) + ret[self.keys[5]] = urlSolution(solutionLink) + + return ret + + def sort(self): + self.Line = sorted(self.Line) + N = len(self.data) + for i in range(N): + self.Line[i].putItem("id", i) + + def putLine(self, data): + + assert type(data) == dict, f"[*** Type Error] data type is {type(data)}.\n It must be dict" + + newData = DataForm() + for k, v in data.items(): + newData.putItem(k, v) + self.Line.append(newData) + + def run(self, force=False): + + for tag in self.config.get('tags'): + self.__read( f"./{tag}/list.md") + for data in self.data: + splitData = list(map(str, data.strip().split(','))) + form = self.makeForm(splitData, force) + self.putLine(form) + + self.sort() + self.__writeREADME(tag) + self.__write(f"{tag}/list.md") + +if __name__ == "__main__": + config = dict() + with open('./scripts/config.json', 'r') as f: + config = json.load(f) + f.close() + + api = SolvedAPI(config.get('API')) + table = Table(api, config) + table.run() diff --git a/scripts/pick.problem b/scripts/pick.problem new file mode 100644 index 0000000..ba808b3 Binary files /dev/null and b/scripts/pick.problem differ diff --git a/scripts/pick_data.in b/scripts/pick_data.in new file mode 100644 index 0000000..6f962c4 --- /dev/null +++ b/scripts/pick_data.in @@ -0,0 +1,887 @@ +1038$11 +1062$12 +1166$8 +1174$10 +1182$9 +1189$10 +1248$13 +1342$10 +1405$11 +1497$10 +1553$10 +1654$8 +1729$15 +1759$11 +1789$6 +1799$15 +1920$7 +1941$13 +1987$12 +2023$11 +2026$13 +2239$12 +2417$6 +2512$8 +2529$9 +2580$12 +2661$12 +2792$8 +2805$8 +2922$12 +3165$14 +3980$12 +6236$9 +6443$11 +6603$9 +6987$11 +7682$11 +7795$8 +9663$11 +10421$11 +10597$10 +10815$7 +10816$7 +10819$9 +10971$9 +10974$8 +11561$8 +11663$8 +12908$13 +13908$11 +14627$8 +14712$10 +14888$10 +14889$8 +15566$10 +15649$8 +15650$8 +15651$8 +15652$8 +15654$8 +15655$8 +15656$8 +15657$8 +15658$9 +15659$13 +15663$9 +15664$9 +15665$9 +15666$9 +15684$12 +15810$9 +15918$12 +16198$10 +16401$8 +16922$8 +16938$12 +16987$10 +17124$8 +17136$14 +17266$6 +17393$8 +17451$8 +17503$9 +18113$9 +18290$10 +18429$8 +18430$10 +19637$8 +19699$9 +19942$11 +20208$11 +20551$7 +20950$9 +1018$6 +1025$11 +1059$6 +1065$7 +1120$7 +1145$5 +1251$6 +1254$10 +1300$14 +1359$7 +1411$9 +1421$9 +1436$6 +1477$12 +1487$8 +1503$8 +1527$10 +1543$7 +1548$10 +1561$14 +1668$4 +1895$7 +1939$12 +1969$6 +2022$10 +2110$11 +2121$8 +2143$13 +2160$5 +2231$4 +2309$4 +2343$10 +2412$13 +2422$6 +2435$6 +2503$7 +2613$14 +2635$6 +2798$4 +2866$11 +2961$10 +3020$11 +3040$4 +3079$10 +3085$8 +4096$5 +5568$6 +5671$6 +5883$7 +7568$6 +8983$12 +9007$13 +9079$7 +9996$8 +11502$7 +11687$11 +12757$13 +13397$12 +13410$4 +14575$10 +14620$9 +14697$4 +14912$6 +15661$10 +15728$8 +15823$13 +15970$7 +16434$13 +16439$7 +16508$8 +16564$10 +16937$7 +16943$10 +16951$7 +16960$7 +17179$10 +17484$7 +17610$10 +17951$12 +18312$4 +18511$6 +18868$5 +19532$4 +19947$6 +19949$8 +20444$11 +20495$10 +1010$6 +1021$7 +1030$13 +1034$11 +1043$12 +1074$10 +1107$11 +1158$6 +1269$8 +1302$7 +1493$12 +1581$12 +1655$14 +1711$11 +1717$12 +1780$9 +1802$9 +1863$11 +1874$8 +1918$13 +1927$10 +1935$8 +1966$8 +1976$12 +1992$10 +2075$11 +2164$7 +2304$9 +2346$8 +2374$12 +2447$10 +2448$12 +2493$11 +2504$9 +2630$8 +2748$5 +2776$7 +2800$11 +2839$5 +3986$7 +4195$14 +4779$8 +4949$7 +5397$8 +5904$10 +7511$11 +7662$11 +9012$7 +9375$8 +9655$6 +10546$7 +10775$14 +10799$8 +10828$7 +10845$7 +10866$7 +10870$4 +11085$13 +11279$9 +11286$10 +12764$13 +12893$12 +14391$13 +14500$11 +14595$14 +14600$11 +15686$11 +15789$13 +16168$12 +16438$13 +16562$13 +16637$13 +16724$14 +16986$13 +17085$10 +17352$11 +17471$12 +17626$7 +17829$9 +18115$8 +18116$13 +18222$9 +20040$12 +21278$11 +21315$11 +21939$12 +21943$14 +21944$13 +22866$12 +22942$11 +22944$12 +22947$14 +1003$8 +1106$10 +1149$10 +1309$10 +1463$8 +1495$10 +1535$9 +1633$10 +1660$9 +1699$8 +1890$9 +1912$9 +1915$12 +1932$10 +1965$9 +2011$10 +2156$10 +2193$8 +2225$11 +2228$11 +2293$11 +2294$10 +2302$10 +2407$8 +2491$8 +2565$11 +2579$8 +2624$11 +2629$14 +2631$11 +2670$7 +2688$11 +2876$9 +3067$11 +4811$11 +5557$11 +5582$11 +7579$13 +9084$11 +9095$8 +9251$11 +9461$8 +9465$10 +10164$10 +10211$8 +10844$10 +11048$10 +11051$10 +11052$10 +11053$9 +11055$9 +11057$10 +11060$9 +11568$10 +11722$9 +11726$8 +11727$8 +12026$10 +12101$10 +12865$11 +13302$11 +13398$11 +13699$7 +13910$10 +14430$9 +14501$8 +14722$12 +14728$11 +14852$11 +15486$10 +15489$6 +15624$7 +15988$9 +15989$10 +15990$9 +15991$10 +15992$10 +15993$10 +16194$10 +16195$10 +17069$11 +17070$11 +17175$8 +17208$12 +17212$8 +17291$9 +17845$11 +18353$9 +18427$12 +19622$9 +19645$15 +20152$8 +20162$9 +20667$15 +21317$10 +22857$8 +22869$10 +22871$10 +1012$9 +1135$15 +1260$9 +1301$12 +1303$10 +1325$10 +1520$12 +1577$12 +1600$12 +1695$12 +1697$10 +1727$13 +1743$10 +1757$11 +1823$13 +1926$10 +1937$13 +1943$13 +1958$13 +2073$11 +2157$12 +2178$10 +2229$11 +2253$12 +2411$12 +2583$10 +2589$11 +2602$12 +2606$8 +2616$12 +2636$11 +2644$9 +2667$10 +2758$12 +3055$12 +3184$9 +3187$9 +3687$14 +5014$11 +5569$11 +5624$12 +6118$10 +7569$10 +7576$10 +9019$11 +10026$11 +10653$12 +10942$13 +11049$13 +11054$13 +11066$13 +11123$10 +11559$12 +11724$9 +11909$11 +11985$11 +12015$14 +13565$9 +13902$12 +14502$11 +14699$11 +14716$10 +14863$12 +14925$12 +14940$11 +14945$12 +15558$10 +15724$10 +16174$10 +16928$10 +16948$10 +16954$12 +17086$9 +17129$11 +17141$12 +17216$10 +17255$12 +17265$11 +17404$12 +17485$11 +18232$9 +18404$10 +18405$10 +20542$12 +1080$9 +1082$12 +1092$11 +1343$6 +1374$11 +1439$6 +1449$8 +1474$10 +1541$9 +1707$12 +1715$12 +1726$13 +1744$12 +1758$7 +1817$6 +1931$9 +1946$10 +2109$13 +2138$10 +2141$12 +2146$13 +2151$12 +2194$11 +2206$12 +2212$11 +2217$7 +2234$12 +2285$12 +2457$12 +2573$12 +2638$12 +2665$12 +2668$11 +2812$12 +2847$7 +4179$12 +5427$12 +6068$11 +8980$13 +9466$13 +10711$13 +11000$11 +11047$9 +11256$6 +11399$8 +11508$7 +11509$10 +12782$7 +12931$12 +13023$11 +13164$11 +13305$7 +13413$7 +13913$12 +13975$12 +14247$8 +14400$9 +14442$13 +14916$6 +14923$12 +16162$7 +16206$10 +16208$6 +16432$11 +16435$6 +16932$12 +16947$13 +16953$10 +16956$8 +16985$13 +16988$13 +17142$12 +17521$6 +17615$10 +17616$13 +18234$12 +18513$11 +19598$11 +19939$6 +20115$8 +20117$10 +20300$8 +20365$9 +21313$4 +21758$10 +21937$10 +22868$13 +22946$14 +22948$14 +22949$15 +1022$12 +1045$15 +1110$5 +1188$11 +1197$12 +1244$7 +1283$9 +1368$14 +1414$14 +1456$10 +1647$12 +1669$10 +1774$13 +1913$6 +1934$6 +1944$14 +1978$7 +1990$11 +2167$5 +2168$10 +2406$13 +2436$11 +2469$10 +2553$9 +2578$6 +2581$6 +2609$6 +2615$8 +2729$7 +2745$4 +2824$11 +2877$10 +2960$7 +3343$11 +4386$12 +5347$7 +5766$7 +6497$12 +9081$10 +9421$10 +9613$8 +10703$8 +10994$7 +11441$8 +11653$6 +13418$13 +13905$12 +14467$6 +14621$13 +14719$11 +14950$13 +15787$9 +15806$15 +15886$9 +16139$9 +16202$12 +16398$12 +16719$11 +16926$9 +16927$11 +16935$10 +17128$9 +17276$10 +17390$8 +17406$12 +17472$14 +17490$13 +18311$6 +18769$12 +20116$8 +20164$11 +20207$10 +20327$13 +20546$5 +21275$8 +21277$13 +21312$3 +21608$10 +21611$15 +21919$8 +21920$7 +21924$12 +22858$8 +22859$13 +22860$13 +22864$3 +22943$10 +1058$9 +1219$15 +1238$13 +1261$12 +1277$12 +1389$10 +1445$14 +1446$10 +1504$12 +1507$13 +1613$13 +1713$9 +1719$12 +1749$12 +1753$11 +1865$13 +1916$11 +1956$12 +2015$11 +2211$14 +2224$11 +2307$14 +2458$12 +2571$13 +2660$11 +2900$14 +2982$14 +3190$11 +3673$13 +4485$12 +5549$12 +5972$11 +9205$10 +9370$14 +10159$13 +10427$11 +10713$11 +10986$13 +11265$10 +11403$10 +11562$12 +11657$12 +11660$10 +11779$13 +11780$14 +13424$12 +13549$11 +13911$14 +14284$11 +14476$14 +14503$11 +14594$8 +14891$11 +14938$12 +15683$11 +15685$12 +15723$11 +16118$15 +16235$12 +16236$12 +16507$10 +17123$9 +17135$12 +17140$12 +17144$12 +17396$11 +17779$12 +18223$12 +18243$9 +18352$9 +18866$11 +19238$12 +19951$10 +20002$11 +20007$12 +20055$10 +20056$12 +20159$11 +20165$11 +20168$11 +20182$14 +20183$15 +20436$7 +20438$9 +20440$12 +20543$14 +20665$11 +21757$13 +21940$12 +1005$13 +1032$5 +1152$4 +1159$4 +1181$6 +1213$7 +1259$5 +1316$6 +1516$13 +1620$7 +1622$6 +1718$4 +1764$7 +1766$14 +1942$4 +1972$8 +2056$12 +2115$12 +2204$6 +2252$13 +2623$14 +2671$11 +2744$4 +2852$7 +2933$14 +2941$6 +3613$7 +4396$6 +4446$6 +4659$6 +4836$7 +6550$6 +6996$5 +9242$6 +9342$7 +9470$13 +9536$7 +9548$8 +9933$5 +10798$5 +10808$4 +10809$4 +10988$5 +11365$4 +11478$8 +11655$5 +11656$7 +11720$4 +12871$6 +12933$7 +13022$10 +13459$13 +14405$6 +14567$11 +15644$15 +15653$15 +16171$6 +16890$13 +16916$13 +16939$14 +17143$14 +17413$8 +17609$10 +17780$14 +17822$13 +17837$14 +18500$14 +19237$13 +19583$10 +19844$7 +19948$8 +20057$12 +20058$12 +20061$14 +20114$6 +20154$5 +20210$14 +20291$8 +20437$11 +20944$3 +21609$14 +21610$11 +21942$14 +22861$14 +1068$11 +1167$13 +1240$11 +1484$12 +1595$13 +1644$13 +1806$12 +1940$7 +1949$15 +1967$12 +1991$10 +2003$8 +2018$6 +2058$13 +2118$10 +2213$15 +2230$11 +2233$15 +2250$14 +2263$14 +2428$8 +2467$11 +2470$11 +2473$12 +2531$10 +2533$13 +2559$8 +2637$14 +3151$12 +3273$8 +3584$12 +3665$15 +4256$13 +4358$10 +4803$12 +4933$13 +5639$10 +6137$12 +6159$7 +6416$11 +7453$14 +9024$11 +9372$8 +9489$12 +9934$10 +10025$7 +11437$13 +11659$8 +11725$9 +11728$6 +12896$13 +12978$13 +13422$12 +14425$8 +14657$14 +14675$11 +14725$14 +14921$11 +15565$10 +15681$11 +15831$13 +15900$10 +15961$12 +16437$14 +16472$13 +17073$11 +19535$13 +19542$12 +19581$15 +19641$11 +20119$15 +20166$11 +20181$14 +20364$9 +20366$13 +20442$13 +20924$12 +20955$12 +21276$13 +21279$15 +21921$8 +22862$10 +22945$12 diff --git a/scripts/pick_problem.cpp b/scripts/pick_problem.cpp new file mode 100644 index 0000000..6168809 --- /dev/null +++ b/scripts/pick_problem.cpp @@ -0,0 +1,173 @@ +/****************************************************************************************************************************/ +/************************************* My Template Begin *************************************/ +/************************************* *************************************/ +/************************************* Template Version : 2.0.0 *************************************/ +/************************************* Made By : tony9402(Minsang Kim) *************************************/ +/****************************************************************************************************************************/ +#ifndef LOCAL +#pragma GCC optimize("O3") +#pragma GCC optimize("Ofast") +#pragma GCC optimize("unroll-loops") +#endif + +#include + +using namespace std; + +/******** #define BEGIN ********/ +#define all(x) (x).begin(),(x).end() +#define sortall(x) sort(all(x)) +#define reverseall(x) reverse(all(x)) +#define siz(x) (int)(x).size() +#define rep(i, n) for(int i=0;i<(n);i++) +#define repi(i, l, r) for(int i=l;i<=(r);i++) +#define rrep(i, n) for(int i=(n)-1;i>=0;i--) +#define rrepi(i, r, l) for(int i=r;i>=l;i--) +#define pb push_back +#define pf push_front +#define eb emplace_back +#define ef emplace_front +#define ppb pop_back +#define ppf pop_front +#define fi first +#define se second +/******** #define END ********/ + +/******** type define BEGIN ********/ +using ull = unsigned long long; +using ll = long long; +using ld = long double; +using pii = pair; +using pll = pair; +using pil = pair; +using pli = pair; +using vi = vector; +using vd = vector; +using vl = vector; +using vii = vector; +using vll = vector; +/******** type define END ********/ + +/******** const BEGIN ********/ +constexpr char ln = '\n'; +constexpr char sp = ' '; +constexpr ld PI = 3.141592653589793238462643383279502884197169399375105820974944; +// 0 ~ 3 -> UDLR, 4 ~ 7 -> (diag)UDLR, 8 ~ 15 -> knight +constexpr int dy[] = {-1,1,0,0,-1,-1,1,1,-2,-1,1,2,2,1,-1,-2}; +constexpr int dx[] = {0,0,-1,1,-1,1,-1,1,1,2,2,1,-1,-2,-2,-1}; +/******** const END ********/ + +/******** DEBUG TEMPLATE BEGIN ********/ +#ifdef LOCAL +void _DEBUG_S(string _s="") { cerr << "\n[------- " << _s << " ---------]\n"; } +template void _DEBUG(Type arg) { cerr << arg; } +template void _DEBUG(Type arg, Types ...args) { cerr << arg << ", ", _DEBUG(args...); } +#define debug(...) cerr << "[ " << #__VA_ARGS__ << " ] : ", _DEBUG(__VA_ARGS__) +#define debug2(...) _DEBUG_S("DEBUG BEGIN") debug(__VA_ARGS__) _DEBUG_S("DEBUG END") + +#else +#define debug(...) +#define debug2(...) +#endif +/******** DEBUG TEMPLATE END ********/ + +/******** I/O TEMPLATE BEGIN ********/ +template struct fastio{ fastio(){ +#ifndef LOCAL + if(fp>=0) { ios::sync_with_stdio(false); cin.tie(0); } +#endif + if(fp>0)cout << fixed << setprecision(fp); +} }; + +template void input(Type &arg){cin >> arg;} +template void input(Type &arg, Types &...args){cin>>arg;input(args...);} +template void output(Type arg){cout< void output(Type arg, Types ...args){cout< inline istream& operator>>(istream &in, pair &_p) { in >> _p.first >> _p.second; return in; } +template inline ostream& operator<<(ostream &out, const pair &_p) { out << _p.first << ' ' << _p.second; return out; } +template inline ostream& operator<<(ostream &out, const vector &v) { for(auto &i: v) out< inline istream& operator>>(istream &in, vector &v) { for(auto &i: v) in>>i; return in; } +template inline ostream& operator<<(ostream &out, const deque &v) { for(auto &i: v) out< inline istream& operator>>(istream &in, deque &v) { for(auto &i: v) in>>i; return in; } +/******** I/O TEMPLATE END ********/ + +template +T power(T a, T b, T mod=numeric_limits::max()){ + if(b == 0)return 1; + if(b % 2)return a * power(a, b-1, mod) % mod; + return power(a * a % mod, b >> 1, mod); +} +ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } +ll lcm(ll a, ll b) { return a / gcd(a, b) * b; } +ll extgcd(ll a, ll b, ll &x, ll &y){ + if(b) { + ll d = extgcd(b, a % b, y, x); + return y -= a / b * x, d; + } + return x = 1, y = 0, a; +} +/****************************************************************************************************************************/ +/************************************* My Template End *************************************/ +/****************************************************************************************************************************/ + +#include +long getSeed() { + struct timeval tick; + gettimeofday(&tick, 0); + return tick.tv_usec; +} + +int gen(int mn, int mx){ + assert(mn <= mx); + return rand() % (mx - mn + 1) + mn; +} + +string gen(int len){ + string ret = ""; + while(len--){ + ret += (char)('a' + gen(0, 25)); + } + return ret; +} + +set> problems; + +int main(){ + fastio<>(); + + srand(getSeed()); + string s; + int mx = 0; + while(cin >> s){ + // 1 ~ 15 + auto it = s.find("$", 0); + int number = stoi(s.substr(0, it)); + int level = stoi(s.substr(it + 1)); + mx = max(mx, number); + if(1 <= level && level <= 15) problems.emplace(level, number); + } + + // 1 ~ 8 1 + // 9 ~ 12 2 + // 13 ~ 15 1 + + vector> L; + L.emplace_back( 1, 8); // B5 ~ S3 + L.emplace_back( 9, 12); // S2 ~ G4 + L.emplace_back( 9, 12); // S2 ~ G4 + L.emplace_back(13, 15); // G3 ~ G1 + + vector> output; + for(auto &[l, r]: L){ + int level = gen(l, r); + int problem = gen(1000, mx); + auto it = problems.lower_bound(make_pair(level, problem)); + if(it->first != level && it != problems.begin()) it--; + output.emplace_back(it->first, it->second); + problems.erase(it); + } + sortall(output); + for(auto &i: output) cout << i.second << '\n'; + + return 0; +} diff --git a/scripts/pick_problem.py b/scripts/pick_problem.py new file mode 100644 index 0000000..3bcaa1d --- /dev/null +++ b/scripts/pick_problem.py @@ -0,0 +1,135 @@ +from API import SolvedAPI +import json +import subprocess as sp +import os +import datetime +import pytz + +def reset(): + database = dict() + with open('./scripts/database.json', 'r') as f: + database = json.load(f) + f.close() + + pick_data = list() + for key, data in database.items(): + if 1 <= data.get('problemLevel') <= 15: + line = f"{key}${data.get('problemLevel')}\n" + pick_data.append(line) + + with open('./scripts/pick_data.in', 'w') as f: + f.writelines(pick_data) + f.close() + + return pick_data + +def update(): + data = None + with open('./scripts/pick_data.in', 'r') as f: + data = f.readlines() + f.close() + + if len(data) <= 30: + data = reset() + + problem_database = None + with open('./scripts/database.json', 'r') as f: + problem_database = json.load(f) + f.close() + + newdata = list() + for line in data: + problemId, problemLevel = line.split('$') + problemInfo = api.request(problemId) + problemLevel = problemInfo["problemLevel"] + newdata.append(f"{problemId}${problemLevel}\n") + + with open('./scripts/pick_data.in', 'w') as f: + f.writelines(newdata) + f.close() + +def make_table(): + data = dict() + with open('./scripts/picked.json', 'r') as f: + data = json.load(f) + f.close() + + saveline = [] + keys = data.keys() + for key in keys: + saveline.append(f"## {key} \n") + saveline.append('\n') + saveline.append("| 난이도 | 번호 | 문제 이름 |\n") + saveline.append("|:------:|:----:|:---------:|\n") + for problem in data[key]: + problemInfo = api.request(problem) + problemName = problemInfo.get('problemName') + problemLevel = problemInfo.get('problemLevel') + imageurl = f"" + line = f"| {imageurl} | [{problem}](https://www.acmicpc.net/problem/{problem}) | [{problemName}](https://www.acmicpc.net/problem/{problem}) |\n" + saveline.append(line) + + saveline.append('\n') + + with open('./picked.md', 'w') as f: + f.writelines(saveline) + f.close() + +def pick(): + os.system('g++ -std=c++17 ./scripts/pick_problem.cpp -o ./scripts/pick.problem') + + data = None + with open('./scripts/pick_data.in', 'r') as f: + data = f.readlines() + f.close() + + os.system('./scripts/pick.problem < ./scripts/pick_data.in > ./scripts/today_problem.out') + with open("./scripts/today_problem.out", "r") as f: + ret = [ _.strip() + '$' for _ in f.readlines() ] + f.close() + + remain = list() + picked = list() + for v in ret: + for idx, line in enumerate(data): + if line.startswith(v): + picked.append(line) + del data[idx] + break + + remain = data + + picked_json = dict() + with open('./scripts/picked.json', 'r') as f: + picked_json = json.load(f) + f.close() + + timeformat = datetime.datetime.now(pytz.timezone('Asia/Seoul')) + timeformat = f"{timeformat.strftime('%Y/%m/%d')}" + new_data = dict() + new_data[timeformat] = list() + for problem in picked: + problemId, problemLevel = problem.strip().split('$') + new_data[timeformat].append(problemId) + + new_data.update(picked_json) + + with open('./scripts/picked.json', 'w') as f: + f.write(json.dumps(new_data, indent=4, ensure_ascii=False)) + f.close() + + with open('./scripts/pick_data.in', 'w') as f: + f.writelines(remain) + f.close() + +if __name__ == "__main__": + config = None + with open('./scripts/config.json', 'r') as f: + config = json.load(f) + f.close() + + api = SolvedAPI(config.get("API")) + + update() + pick() + make_table() diff --git a/scripts/picked.json b/scripts/picked.json new file mode 100644 index 0000000..1a57e94 --- /dev/null +++ b/scripts/picked.json @@ -0,0 +1,1508 @@ +{ + "2021/12/29": [ + "10448", + "16918", + "16400", + "17398" + ], + "2021/12/28": [ + "5534", + "7562", + "1469", + "16571" + ], + "2021/12/27": [ + "13702", + "10472", + "3107", + "14601" + ], + "2021/12/26": [ + "18512", + "14496", + "21314", + "18808" + ], + "2021/12/25": [ + "9094", + "5430", + "14226", + "17090" + ], + "2021/12/24": [ + "21756", + "11404", + "16973", + "20010" + ], + "2021/12/23": [ + "5618", + "21922", + "6087", + "18809" + ], + "2021/12/22": [ + "4690", + "3005", + "20922", + "14570" + ], + "2021/12/21": [ + "3029", + "5567", + "14676", + "13460" + ], + "2021/12/20": [ + "18258", + "17836", + "22865", + "12912" + ], + "2021/12/19": [ + "14929", + "12919", + "10282", + "4315" + ], + "2021/12/18": [ + "1864", + "14267", + "22856", + "9944" + ], + "2021/12/17": [ + "21918", + "1455", + "4097", + "2696" + ], + "2021/12/16": [ + "20053", + "5212", + "18114", + "16971" + ], + "2021/12/15": [ + "1072", + "4095", + "16234", + "10423" + ], + "2021/12/14": [ + "15270", + "4963", + "5547", + "6209" + ], + "2021/12/13": [ + "15779", + "21318", + "14499", + "15732" + ], + "2021/12/12": [ + "5597", + "19539", + "12851", + "21925" + ], + "2021/12/11": [ + "11170", + "5052", + "21923", + "19566" + ], + "2021/12/10": [ + "1212", + "12761", + "15927", + "3108" + ], + "2021/12/09": [ + "2753", + "14225", + "1922", + "8972" + ], + "2021/12/08": [ + "4134", + "13019", + "1747", + "5875" + ], + "2021/12/07": [ + "9046", + "7490", + "13707", + "2887" + ], + "2021/12/06": [ + "15721", + "14248", + "21938", + "19236" + ], + "2021/12/05": [ + "2193", + "1527", + "1548", + "1553" + ], + "2021/12/04": [ + "2121", + "11727", + "1669", + "1743" + ], + "2021/12/03": [ + "2003", + "14889", + "1927", + "1932" + ], + "2021/12/02": [ + "1972", + "1946", + "1991", + "1992" + ], + "2021/12/01": [ + "1966", + "2011", + "2022", + "2110" + ], + "2021/11/30": [ + "1935", + "15624", + "2118", + "2156" + ], + "2021/11/29": [ + "2346", + "15649", + "2168", + "2178" + ], + "2021/11/28": [ + "1874", + "15650", + "15651", + "2294" + ], + "2021/11/27": [ + "1699", + "2302", + "2343", + "2531" + ], + "2021/11/26": [ + "1654", + "2553", + "1025", + "1034" + ], + "2021/11/25": [ + "1503", + "15652", + "2565", + "1038" + ], + "2021/11/24": [ + "1487", + "2583", + "1068", + "1092" + ], + "2021/11/23": [ + "1463", + "15654", + "3005", + "1107" + ], + "2021/11/22": [ + "1283", + "2667", + "1188", + "1405" + ], + "2021/11/21": [ + "1166", + "15655", + "15656", + "1759" + ], + "2021/11/20": [ + "1072", + "15657", + "1916", + "2023" + ], + "2021/11/19": [ + "1003", + "15728", + "16508", + "2073" + ], + "2021/11/18": [ + "20436", + "20291", + "2075", + "2194" + ], + "2021/11/17": [ + "19844", + "2212", + "2225", + "2228" + ], + "2021/11/16": [ + "11561", + "16922", + "2229", + "2230" + ], + "2021/11/15": [ + "17626", + "16956", + "3079", + "2436" + ], + "2021/11/14": [ + "11502", + "17124", + "20116", + "2467" + ], + "2021/11/13": [ + "16960", + "17615", + "2470", + "2493" + ], + "2021/11/12": [ + "15270", + "2589", + "2624", + "2631" + ], + "2021/11/11": [ + "16951", + "2636", + "2660", + "2668" + ], + "2021/11/10": [ + "16439", + "17175", + "17276", + "2671" + ], + "2021/11/09": [ + "2792", + "18404", + "2688", + "2866" + ], + "2021/11/08": [ + "16162", + "17216", + "1022", + "1043" + ], + "2021/11/07": [ + "15970", + "1062", + "1082", + "1197" + ], + "2021/11/06": [ + "13413", + "17212", + "1990", + "1261" + ], + "2021/11/05": [ + "11508", + "18222", + "17085", + "1277" + ], + "2021/11/04": [ + "10866", + "2824", + "3067", + "1301" + ], + "2021/11/03": [ + "10845", + "16987", + "3107", + "1477" + ], + "2021/11/02": [ + "10828", + "16953", + "3190", + "1484" + ], + "2021/11/01": [ + "6159", + "16948", + "1493", + "1504" + ], + "2021/10/31": [ + "5883", + "17390", + "21315", + "1520" + ], + "2021/10/30": [ + "3986", + "17393", + "1577", + "1647" + ], + "2021/10/29": [ + "3085", + "1695", + "1707", + "1711" + ], + "2021/10/28": [ + "9461", + "16943", + "18405", + "1715" + ], + "2021/10/27": [ + "10816", + "16928", + "20665", + "1717" + ], + "2021/10/26": [ + "2960", + "1719", + "1726", + "1744" + ], + "2021/10/25": [ + "16937", + "1058", + "20444", + "1749" + ], + "2021/10/24": [ + "10994", + "16918", + "1757", + "1774" + ], + "2021/10/23": [ + "2852", + "16564", + "1806", + "1915" + ], + "2021/10/22": [ + "12933", + "17413", + "20437", + "1922" + ], + "2021/10/21": [ + "2847", + "20208", + "1939", + "1956" + ], + "2021/10/20": [ + "2776", + "17451", + "1967", + "1976" + ], + "2021/10/19": [ + "2729", + "2469", + "20168", + "1987" + ], + "2021/10/18": [ + "2670", + "20165", + "20166", + "2056" + ], + "2021/10/17": [ + "2217", + "18115", + "2115", + "2151" + ], + "2021/10/16": [ + "2164", + "18429", + "1374", + "2157" + ], + "2021/10/15": [ + "1978", + "16507", + "18430", + "2206" + ], + "2021/10/14": [ + "16401", + "19948", + "20164", + "2234" + ], + "2021/10/13": [ + "1940", + "19949", + "1697", + "2239" + ], + "2021/10/12": [ + "1920", + "1012", + "21317", + "2253" + ], + "2021/10/11": [ + "20551", + "1080", + "2285", + "2374" + ], + "2021/10/10": [ + "10815", + "1106", + "17485", + "2411" + ], + "2021/10/09": [ + "9536", + "1411", + "1421", + "2448" + ], + "2021/10/08": [ + "1895", + "16198", + "2457", + "2458" + ], + "2021/10/07": [ + "1817", + "2812", + "2473", + "2573" + ], + "2021/10/06": [ + "1764", + "2800", + "2580", + "2602" + ], + "2021/10/05": [ + "14501", + "20117", + "2616", + "2638" + ], + "2021/10/04": [ + "1758", + "1455", + "1600", + "2661" + ], + "2021/10/03": [ + "1302", + "1535", + "2665", + "2758" + ], + "2021/10/02": [ + "1244", + "1541", + "17471", + "2922" + ], + "2021/10/01": [ + "1213", + "16927", + "3055", + "1005" + ], + "2021/09/30": [ + "5766", + "1713", + "17144", + "1030" + ], + "2021/09/29": [ + "1120", + "20055", + "17142", + "1167" + ], + "2021/09/28": [ + "1065", + "17352", + "17396", + "1238" + ], + "2021/09/27": [ + "1021", + "16195", + "19951", + "1248" + ], + "2021/09/26": [ + "19939", + "1660", + "17140", + "1516" + ], + "2021/09/25": [ + "17521", + "17265", + "17135", + "1581" + ], + "2021/09/24": [ + "3273", + "1780", + "1753", + "1595" + ], + "2021/09/23": [ + "17484", + "1890", + "17255", + "1613" + ], + "2021/09/22": [ + "9548", + "15993", + "20159", + "1727" + ], + "2021/09/21": [ + "1622", + "1912", + "17141", + "1823" + ], + "2021/09/20": [ + "5347", + "18290", + "16938", + "1865" + ], + "2021/09/19": [ + "17266", + "21318", + "17129", + "1918" + ], + "2021/09/18": [ + "9375", + "1931", + "16932", + "1937" + ], + "2021/09/17": [ + "16435", + "17179", + "17073", + "1941" + ], + "2021/09/16": [ + "16208", + "5582", + "16236", + "1943" + ], + "2021/09/15": [ + "14467", + "17070", + "17208", + "1958" + ], + "2021/09/14": [ + "12871", + "17406", + "18427", + "2109" + ], + "2021/09/13": [ + "12782", + "17069", + "20056", + "2026" + ], + "2021/09/12": [ + "11728", + "1965", + "2138", + "2143" + ], + "2021/09/11": [ + "11256", + "2504", + "15992", + "2058" + ], + "2021/09/10": [ + "9655", + "16235", + "20040", + "2146" + ], + "2021/09/09": [ + "5671", + "21314", + "19542", + "2263" + ], + "2021/09/08": [ + "5568", + "15990", + "16202", + "1507" + ], + "2021/09/07": [ + "14405", + "15991", + "5569", + "2406" + ], + "2021/09/06": [ + "14916", + "1633", + "16973", + "2412" + ], + "2021/09/05": [ + "5534", + "2529", + "16168", + "2533" + ], + "2021/09/04": [ + "4396", + "1325", + "2644", + "2571" + ], + "2021/09/03": [ + "4134", + "2876", + "20057", + "3108" + ], + "2021/09/02": [ + "3613", + "15989", + "1747", + "3673" + ], + "2021/09/01": [ + "2941", + "15900", + "14945", + "14391" + ], + "2021/08/31": [ + "2635", + "18352", + "18234", + "13459" + ], + "2021/08/30": [ + "2609", + "15886", + "14938", + "14442" + ], + "2021/08/29": [ + "2581", + "13913", + "14923", + "14621" + ], + "2021/08/28": [ + "2578", + "15661", + "15724", + "13418" + ], + "2021/08/27": [ + "2503", + "18113", + "18243", + "12908" + ], + "2021/08/26": [ + "2435", + "17829", + "2141", + "15659" + ], + "2021/08/25": [ + "2422", + "15566", + "13905", + "15789" + ], + "2021/08/24": [ + "2428", + "18353", + "20365", + "15823" + ], + "2021/08/23": [ + "2417", + "16926", + "16954", + "15831" + ], + "2021/08/22": [ + "2204", + "15565", + "16432", + "12896" + ], + "2021/08/21": [ + "1620", + "16234", + "13902", + "16438" + ], + "2021/08/20": [ + "13699", + "10653", + "14863", + "16562" + ], + "2021/08/19": [ + "2018", + "12101", + "6068", + "16637" + ], + "2021/08/18": [ + "1969", + "17503", + "14925", + "16971" + ], + "2021/08/17": [ + "1934", + "11660", + "18223", + "16985" + ], + "2021/08/16": [ + "1913", + "20207", + "13707", + "16986" + ], + "2021/08/15": [ + "14627", + "11568", + "11562", + "16988" + ], + "2021/08/14": [ + "10546", + "16206", + "14676", + "17616" + ], + "2021/08/13": [ + "20115", + "16139", + "15927", + "18116" + ], + "2021/08/12": [ + "9372", + "11265", + "15723", + "18500" + ], + "2021/08/11": [ + "1789", + "20162", + "20364", + "18808" + ], + "2021/08/10": [ + "1439", + "15988", + "19539", + "11066" + ], + "2021/08/09": [ + "1436", + "11123", + "15686", + "19237" + ], + "2021/08/08": [ + "1359", + "15810", + "11509", + "19535" + ], + "2021/08/07": [ + "14594", + "11057", + "17404", + "20327" + ], + "2021/08/06": [ + "1343", + "1469", + "15683", + "20442" + ], + "2021/08/05": [ + "1316", + "9489", + "11404", + "21277" + ], + "2021/08/04": [ + "9095", + "15681", + "7511", + "1445" + ], + "2021/08/03": [ + "1251", + "17128", + "5624", + "11780" + ], + "2021/08/02": [ + "1181", + "5972", + "16916", + "1561" + ], + "2021/08/01": [ + "19637", + "17845", + "11657", + "1655" + ], + "2021/07/31": [ + "1158", + "11052", + "20002", + "1766" + ], + "2021/07/30": [ + "1059", + "4095", + "14940", + "2211" + ], + "2021/07/29": [ + "18311", + "3343", + "9466", + "16434" + ], + "2021/07/28": [ + "14425", + "19699", + "11051", + "2252" + ], + "2021/07/27": [ + "7795", + "12026", + "15685", + "2307" + ], + "2021/07/26": [ + "1018", + "5549", + "20007", + "2613" + ], + "2021/07/25": [ + "1010", + "14888", + "21278", + "2623" + ], + "2021/07/24": [ + "14912", + "11048", + "19598", + "11054" + ], + "2021/07/23": [ + "4659", + "15787", + "5430", + "11049" + ], + "2021/07/22": [ + "6996", + "11725", + "5014", + "2629" + ], + "2021/07/21": [ + "4096", + "10844", + "14921", + "2637" + ], + "2021/07/20": [ + "9933", + "1240", + "13424", + "2696" + ], + "2021/07/19": [ + "2839", + "2407", + "10597", + "2900" + ], + "2021/07/18": [ + "10988", + "20922", + "14728", + "1944" + ], + "2021/07/17": [ + "9242", + "11060", + "17123", + "3687" + ], + "2021/07/16": [ + "4446", + "15666", + "2447", + "11437" + ], + "2021/07/15": [ + "2748", + "10164", + "1342", + "17090" + ], + "2021/07/14": [ + "15489", + "4811", + "14719", + "16724" + ], + "2021/07/13": [ + "11656", + "9205", + "13910", + "17136" + ], + "2021/07/12": [ + "11655", + "11055", + "14567", + "17143" + ], + "2021/07/11": [ + "2167", + "18513", + "13422", + "17472" + ], + "2021/07/10": [ + "11399", + "15665", + "13164", + "17837" + ], + "2021/07/09": [ + "15721", + "5212", + "20058", + "13911" + ], + "2021/07/08": [ + "1259", + "11403", + "20542", + "19236" + ], + "2021/07/07": [ + "1145", + "11286", + "14503", + "20010" + ], + "2021/07/06": [ + "1449", + "11053", + "13397", + "20061" + ], + "2021/07/05": [ + "1110", + "17086", + "14502", + "20181" + ], + "2021/07/04": [ + "1032", + "15664", + "14500", + "20182" + ], + "2021/07/03": [ + "14929", + "15558", + "16194", + "1300" + ], + "2021/07/02": [ + "14697", + "14712", + "4358", + "20210" + ], + "2021/07/01": [ + "2160", + "11724", + "18114", + "10942" + ], + "2021/06/30": [ + "18258", + "5639", + "5904", + "19566" + ], + "2021/06/29": [ + "10798", + "20438", + "13022", + "16571" + ], + "2021/06/28": [ + "16171", + "14499", + "12931", + "10711" + ], + "2021/06/27": [ + "13410", + "1182", + "11047", + "16472" + ], + "2021/06/26": [ + "11720", + "1074", + "14284", + "16437" + ], + "2021/06/25": [ + "14247", + "2304", + "13975", + "20543" + ], + "2021/06/24": [ + "10870", + "13549", + "14226", + "1045" + ], + "2021/06/23": [ + "6236", + "2961", + "5567", + "16947" + ], + "2021/06/22": [ + "3040", + "15658", + "2877", + "2250" + ], + "2021/06/21": [ + "19532", + "11722", + "19641", + "1414" + ], + "2021/06/20": [ + "2798", + "3020", + "16398", + "19645" + ], + "2021/06/19": [ + "20546", + "10971", + "18232", + "15732" + ], + "2021/06/18": [ + "2745", + "19583", + "17610", + "1729" + ], + "2021/06/17": [ + "10974", + "11279", + "14496", + "1799" + ], + "2021/06/16": [ + "21313", + "14852", + "17951", + "1949" + ], + "2021/06/15": [ + "20152", + "17836", + "20440", + "2213" + ], + "2021/06/14": [ + "4836", + "7562", + "2224", + "2233" + ], + "2021/06/13": [ + "2309", + "14400", + "17291", + "17490" + ], + "2021/06/12": [ + "10809", + "6497", + "20955", + "15653" + ], + "2021/06/11": [ + "20300", + "13398", + "18866", + "21279" + ], + "2021/06/10": [ + "13702", + "12893", + "13023", + "4315" + ], + "2021/06/09": [ + "7568", + "6603", + "3151", + "17822" + ], + "2021/06/08": [ + "2231", + "14699", + "5052", + "17470" + ], + "2021/06/07": [ + "11365", + "10472", + "12865", + "15644" + ], + "2021/06/06": [ + "1718", + "10421", + "9007", + "20183" + ], + "2021/06/05": [ + "1668", + "4963", + "6087", + "3165" + ], + "2021/06/04": [ + "18511", + "9084", + "10026", + "20667" + ], + "2021/06/03": [ + "1159", + "9663", + "20924", + "12764" + ], + "2021/06/02": [ + "1269", + "9251", + "11687", + "16118" + ], + "2021/06/01": [ + "1543", + "11000", + "12851", + "14725" + ], + "2021/05/31": [ + "1152", + "10819", + "19238", + "19581" + ], + "2021/05/30": [ + "11653", + "9934", + "15918", + "9470" + ], + "2021/05/29": [ + "1942", + "13565", + "12757", + "11085" + ], + "2021/05/28": [ + "6550", + "12919", + "14675", + "8980" + ], + "2021/05/27": [ + "15779", + "10427", + "10713", + "14950" + ], + "2021/05/26": [ + "4949", + "7576", + "20495", + "3665" + ], + "2021/05/25": [ + "21275", + "16719", + "10986", + "7579" + ], + "2021/05/24": [ + "10025", + "9081", + "14267", + "17780" + ], + "2021/05/23": [ + "11170", + "3187", + "4386", + "10159" + ], + "2021/05/22": [ + "13019", + "14430", + "9024", + "1644" + ], + "2021/05/21": [ + "3029", + "1260", + "19622", + "1368" + ], + "2021/05/20": [ + "18312", + "3184", + "7682", + "10775" + ], + "2021/05/19": [ + "10808", + "1926", + "14891", + "11779" + ], + "2021/05/18": [ + "19947", + "5557", + "17779", + "17398" + ], + "2021/05/17": [ + "9342", + "4097", + "14248", + "2887" + ], + "2021/05/16": [ + "9046", + "17609", + "11985", + "9944" + ], + "2021/05/15": [ + "2753", + "1802", + "7662", + "10423" + ], + "2021/05/14": [ + "4690", + "16935", + "11909", + "16939" + ], + "2021/05/13": [ + "5397", + "14716", + "16174", + "15806" + ], + "2021/05/12": [ + "5618", + "20950", + "16890", + "14657" + ], + "2021/05/11": [ + "21312", + "4256", + "4933", + "20366" + ], + "2021/05/10": [ + "5597", + "11559", + "10282", + "2933" + ], + "2021/05/09": [ + "4779", + "15663", + "6416", + "14601" + ], + "2021/05/08": [ + "18512", + "14575", + "8983", + "6443" + ], + "2021/05/07": [ + "20944", + "5547", + "7569", + "9370" + ], + "2021/05/06": [ + "10799", + "12761", + "4803", + "7453" + ], + "2021/05/05": [ + "10448", + "19942", + "2015", + "2982" + ], + "2021/05/04": [ + "2744", + "4179", + "4485", + "6209" + ], + "2021/05/03": [ + "18868", + "9465", + "14620", + "4195" + ], + "2021/05/02": [ + "9012", + "14722", + "15684", + "6137" + ], + "2021/05/01": [ + "20154", + "2293", + "21276", + "14595" + ], + "2021/04/30": [ + "1212", + "3980", + "14600", + "14570" + ], + "2021/04/29": [ + "20053", + "9421", + "14425", + "20119" + ], + "2021/04/28": [ + "20114", + "6987", + "9019", + "14476" + ], + "2021/04/27": [ + "9079", + "16400", + "3584", + "1219" + ], + "2021/04/26": [ + "9094", + "5427", + "8972", + "13460" + ], + "2021/04/25": [ + "6118", + "13302", + "15961", + "12978" + ], + "2021/04/24": [ + "13305", + "13908", + "18769", + "12912" + ], + "2021/04/23": [ + "15486", + "7490", + "5875", + "18809" + ] +} \ No newline at end of file diff --git a/scripts/today_problem.out b/scripts/today_problem.out new file mode 100644 index 0000000..d2f6847 --- /dev/null +++ b/scripts/today_problem.out @@ -0,0 +1,4 @@ +10448 +16918 +16400 +17398 diff --git a/shortest_path/README.md b/shortest_path/README.md new file mode 100644 index 0000000..b3936cf --- /dev/null +++ b/shortest_path/README.md @@ -0,0 +1,74 @@ +# Shortest Path (최단거리) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +추천 문제 아닌 나머지는 나머지를 난이도 섞었습니다. + +최단거리 문제를 해결할 때 사용하는 알고리즘 중 다익스트라, 벨만-포드, 플로이드 위주로 뽑았습니다. + +문제를 읽어보고 문제를 해결하기 위해 필요한 무엇인지 생각해봐야 합니다. + +위 알고리즘들의 차이와 각 알고리즘의 특성을 이해하지 못한 상황에서 문제를 푸는 것은 도움이 안된다고 생각합니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/7273) +| 순번 | 추천 문제 | 문제 번호 | 문제 이름 | 난이도 | 풀이 링크 | +| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | +| 00 | :heavy_check_mark: | 18352 | 특정 거리의 도시 찾기 | | | +| 01 | :heavy_check_mark: | 11403 | 경로 찾기 | | | +| 02 | :heavy_check_mark: | 11265 | 끝나지 않는 파티 | | | +| 03 | :heavy_check_mark: | 1753 | 최단경로 | | | +| 04 | :heavy_check_mark: | 13549 | 숨바꼭질 3 | | | +| 05 | :heavy_check_mark: | 2224 | 명제 증명 | | | +| 06 | :heavy_check_mark: | 14938 | 서강그라운드 | | | +| 07 | :heavy_check_mark: | 1719 | 택배 | | 바로가기 | +| 08 | :heavy_check_mark: | 1277 | 발전소 설치 | | | +| 09 | :heavy_check_mark: | 11404 | 플로이드 | | | +| 10 | :heavy_check_mark: | 1956 | 운동 | | | +| 11 | :heavy_check_mark: | 11657 | 타임머신 | | | +| 12 | :heavy_check_mark: | 22865 | 가장 먼 곳 | | | +| 13 | :heavy_check_mark: | 1238 | 파티 | | | +| 14 | :heavy_check_mark: | 10159 | 저울 | | | +| 15 | :heavy_check_mark: | 1507 | 궁금한 민호 | | | +| 16 | :heavy_check_mark: | 1613 | 역사 | | | +| 17 | :heavy_check_mark: | 1865 | 웜홀 | | | +| 18 | | 18243 | Small World Network | | | +| 19 | | 1058 | 친구 | | | +| 20 | | 1446 | 지름길 | | | +| 21 | | 1389 | 케빈 베이컨의 6단계 법칙 | | | +| 22 | | 9205 | 맥주 마시면서 걸어가기 | | | +| 23 | | 1916 | 최소비용 구하기 | | | +| 24 | | 17396 | 백도어 | | | +| 25 | | 5972 | 택배 배송 | | | +| 26 | | 14284 | 간선 이어가기 2 | | | +| 27 | | 20168 | 골목 대장 호석 - 기능성 | | | +| 28 | | 2660 | 회장뽑기 | | | +| 29 | | 15723 | n단 논법 | | | +| 30 | | 13424 | 비밀 모임 | | | +| 31 | | 1261 | 알고스팟 | | | +| 32 | | 1504 | 특정한 최단 경로 | | | +| 33 | | 4485 | 녹색 옷 입은 애가 젤다지? | | | +| 34 | | 10282 | 해킹 | | 바로가기 | +| 35 | | 18223 | 민준이와 마산 그리고 건우 | | | +| 36 | | 20007 | 떡 돌리기 | | | +| 37 | | 2458 | 키 순서 | | | +| 38 | | 11562 | 백양로 브레이크 | | | +| 39 | | 21940 | 가운데에서 만나기 | | | +| 40 | | 11779 | 최소비용 구하기 2 | | | +| 41 | | 20182 | 골목 대장 호석 - 효율성 1 | | | +| 42 | | 13911 | 집 구하기 | | | +| 43 | | 2982 | 국왕의 방문 | | | +| 44 | | 9370 | 미확인 도착지 | | | +| 45 | | 2211 | 네트워크 복구 | | | +| 46 | | 1445 | 일요일 아침의 데이트 | | | +| 47 | | 2307 | 도로검문 | | | +| 48 | | 11780 | 플로이드 2 | | | +| 49 | | 20183 | 골목 대장 호석 - 효율성 2 | | | +| 50 | | 16118 | 달빛 여우 | | | +| 51 | | 1219 | 오민식의 고민 | | | +| 52 | | 22870 | 산책 (large) | | | diff --git a/shortest_path/header.md b/shortest_path/header.md new file mode 100644 index 0000000..9570ff6 --- /dev/null +++ b/shortest_path/header.md @@ -0,0 +1,19 @@ +# Shortest Path (최단거리) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +추천 문제 아닌 나머지는 나머지를 난이도 섞었습니다. + +최단거리 문제를 해결할 때 사용하는 알고리즘 중 다익스트라, 벨만-포드, 플로이드 위주로 뽑았습니다. + +문제를 읽어보고 문제를 해결하기 위해 필요한 무엇인지 생각해봐야 합니다. + +위 알고리즘들의 차이와 각 알고리즘의 특성을 이해하지 못한 상황에서 문제를 푸는 것은 도움이 안된다고 생각합니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/7273) diff --git a/shortest_path/list.md b/shortest_path/list.md new file mode 100644 index 0000000..4666c9b --- /dev/null +++ b/shortest_path/list.md @@ -0,0 +1,53 @@ +1,18352, +1,1753, +,1916, +1,13549, +,1446, +,13424, +,17396, +,5972, +,14284, +,20168, +,20182, +,20183, +,1261, +,1504, +,4485, +,10282,./../solution/shortest_path/10282 +1,14938, +1,1719,./../solution/shortest_path/1719 +,18223, +,20007, +1,1277, +1,1238, +,11779, +,13911, +,2982, +,9370, +,2211, +,16118, +,1445, +,2307, +,18243, +1,11403, +,1389, +,9205, +,1058, +1,2224, +1,11265, +,2660, +,15723, +1,11404, +,2458, +1,1956, +,11562, +1,10159, +1,1507, +1,1613, +,11780, +1,11657, +1,1865, +,1219, +,21940, +1,22865, +,22870, diff --git a/simulation/README.md b/simulation/README.md new file mode 100644 index 0000000..8df6aae --- /dev/null +++ b/simulation/README.md @@ -0,0 +1,65 @@ +# Simulation (시뮬레이션) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +추천 문제 아닌 나머지는 나머지를 난이도 섞었습니다. + +기출 문제를 맨 위로 올렸습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/6832) +| 순번 | 추천 문제 | 문제 번호 | 문제 이름 | 난이도 | 풀이 링크 | +| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | +| 00 | :heavy_check_mark: | 16234 | 인구 이동 | | 바로가기 | +| 01 | :heavy_check_mark: | 21610 | 마법사 상어와 비바라기 | | 바로가기 | +| 02 | :heavy_check_mark: | 17144 | 미세먼지 안녕! | | 바로가기 | +| 03 | :heavy_check_mark: | 20056 | 마법사 상어와 파이어볼 | | | +| 04 | :heavy_check_mark: | 16236 | 아기 상어 | | 바로가기 | +| 05 | :heavy_check_mark: | 15685 | 드래곤 커브 | | | +| 06 | :heavy_check_mark: | 16235 | 나무 재테크 | | | +| 07 | :heavy_check_mark: | 17135 | 캐슬 디펜스 | | | +| 08 | :heavy_check_mark: | 17140 | 이차원 배열과 연산 | | | +| 09 | :heavy_check_mark: | 17779 | 게리맨더링 2 | | | +| 10 | :heavy_check_mark: | 19238 | 스타트 택시 | | | +| 11 | :heavy_check_mark: | 20057 | 마법사 상어와 토네이도 | | 바로가기 | +| 12 | :heavy_check_mark: | 20058 | 마법사 상어와 파이어스톰 | | 바로가기 | +| 13 | :heavy_check_mark: | 17822 | 원판 돌리기 | | | +| 14 | :heavy_check_mark: | 19237 | 어른 상어 | | | +| 15 | :heavy_check_mark: | 19236 | 청소년 상어 | | | +| 16 | :heavy_check_mark: | 17143 | 낚시왕 | | | +| 17 | :heavy_check_mark: | 20061 | 모노미노도미노 2 | | 바로가기 | +| 18 | :heavy_check_mark: | 21609 | 상어 중학교 | | | +| 19 | :heavy_check_mark: | 20436 | ZOAC 3 | | | +| 20 | :heavy_check_mark: | 5212 | 지구 온난화 | | | +| 21 | :heavy_check_mark: | 1713 | 후보 추천하기 | | | +| 22 | :heavy_check_mark: | 20055 | 컨베이어 벨트 위의 로봇 | | | +| 23 | :heavy_check_mark: | 14891 | 톱니바퀴 | | 바로가기 | +| 24 | :heavy_check_mark: | 15683 | 감시 | | | +| 25 | :heavy_check_mark: | 20165 | 인내의 도미노 장인 호석 | | 바로가기 | +| 26 | :heavy_check_mark: | 21922 | 학부 연구생 민상 | | | +| 27 | :heavy_check_mark: | 17837 | 새로운 게임 2 | | | +| 28 | :heavy_check_mark: | 22861 | 폴더 정리 (large) | | | +| 29 | :heavy_check_mark: | 13460 | 구슬 탈출 2 | | | +| 30 | | 14594 | 동방 프로젝트 (Small) | | | +| 31 | | 20665 | 독서실 거리두기 | | | +| 32 | | 14503 | 로봇 청소기 | | | +| 33 | | 3190 | | | 바로가기 | +| 34 | | 14499 | 주사위 굴리기 | | 바로가기 | +| 35 | | 8972 | 미친 아두이노 | | | +| 36 | | 13459 | 구슬 탈출 | | | +| 37 | | 18808 | 스티커 붙이기 | | | +| 38 | | 2933 | 미네랄 | | | +| 39 | | 18500 | 미네랄 2 | | | +| 40 | | 17780 | 새로운 게임 | | | +| 41 | | 16939 | 2×2×2 큐브 | | | +| 42 | | 15653 | 구슬 탈출 4 | | | +| 43 | | 18809 | Gaaaaaaaaaarden | | | +| 44 | | 15644 | 구슬 탈출 3 | | | +| 45 | | 5373 | 큐빙 | | 바로가기 | +| 46 | | 19235 | 모노미노도미노 | | | +| 47 | | 3025 | 돌 던지기 | | | diff --git a/simulation/header.md b/simulation/header.md new file mode 100644 index 0000000..487ed3f --- /dev/null +++ b/simulation/header.md @@ -0,0 +1,15 @@ +# Simulation (시뮬레이션) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +추천 문제 아닌 나머지는 나머지를 난이도 섞었습니다. + +기출 문제를 맨 위로 올렸습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/6832) diff --git a/simulation/list.md b/simulation/list.md new file mode 100644 index 0000000..58c1d47 --- /dev/null +++ b/simulation/list.md @@ -0,0 +1,48 @@ +1,20436, +,14594, +1,5212, +1,14891,./../solution/simulation/14891 +1,1713, +1,20055, +,20665, +,14503, +,3190,./../solution/simulation/3190 +,14499,./../solution/simulation/14499 +1,15683, +2,16234,./../solution/simulation/16234 +2,17144,./../solution/simulation/17144 +2,20056, +1,20165,./../solution/simulation/20165 +2,16236,./../solution/simulation/16236 +2,15685, +2,16235, +2,17135, +2,17140, +2,17779, +2,19238, +2,20057,./../solution/simulation/20057 +2,20058,./../solution/simulation/20058 +,8972, +2,17822, +2,19236, +,13459, +,2933, +2,19237, +,18808, +,18500, +2,17143, +1,17837, +,15653, +,17780, +2,20061,./../solution/simulation/20061 +,5373,./../solution/simulation/5373 +,18809, +,16939, +,19235, +,3025, +1,13460, +,15644, +2,21609, +2,21610,./../solution/simulation/21610 +1,21922, +1,22861, diff --git a/solution/backtracking/1038/main.py b/solution/backtracking/1038/main.py new file mode 100644 index 0000000..91e4054 --- /dev/null +++ b/solution/backtracking/1038/main.py @@ -0,0 +1,35 @@ +# Authored by : gkgg123 +# Co-authored by : - +# Link : http://boj.kr/ab9a5bb2d14943b3aefaf98f4648a469 +import sys +from collections import deque + +def input(): + return sys.stdin.readline().rstrip() + +def bfs(N): + queue = deque() + for i in range(1, 10): + queue.append((i, str(i))) + while queue: + if len(result) == N + 1: + break + cur_num,totol_num = queue.popleft() + if cur_num != 0: + for k in range(cur_num): + next_num = totol_num + str(k) + queue.append((k,next_num)) + result.append(next_num) + +N = int(input()) +result = [] +for i in range(10): + result.append(i) + +if N >=10: + bfs(N) + +if len(result) > N: + print(result[N]) +else: + print(-1) diff --git a/solution/backtracking/10974/main.py b/solution/backtracking/10974/main.py new file mode 100644 index 0000000..b4cde09 --- /dev/null +++ b/solution/backtracking/10974/main.py @@ -0,0 +1,24 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/f386e090dfe84518a7329d6f0a77f8c6 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +def DFS(): + if len(arr) == N: + print(*arr) + return + for i in range(1, N+1): + if visited[i] == 0: + visited[i] = 1 + arr.append(i) + DFS() + arr.pop() + visited[i] = 0 + +N = int(input()) +arr = [] +visited = [0] * (N+1) +DFS() \ No newline at end of file diff --git a/solution/backtracking/1182/Main.java b/solution/backtracking/1182/Main.java new file mode 100644 index 0000000..d584f11 --- /dev/null +++ b/solution/backtracking/1182/Main.java @@ -0,0 +1,78 @@ +// Authored by : lms0806 +// Co-authored by : - +// Link : http://boj.kr/4ec78fe2e6674292a7179dc07a7718b3 +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.StringTokenizer; + +public class Main { + static int n, s; + static int[] arr = new int[22]; + + public static void main(String[] args) throws IOException { + FastReader rd = new FastReader(); + + n = rd.nextInt(); + s = rd.nextInt(); + + for (int i = 0; i < n; i++) { + arr[i] = rd.nextInt(); + } + + System.out.print(solve(false, 0, 0)); + } + + public static int solve(boolean flag, int idx, int num) { + if (idx == n) { // 끝부분까지 갔을 때 + if (num == s && flag) { // flag가 true면 다 확인했고, 값이 같으므로 1 + return 1; + } + return 0; // 끝까지 갔으나 다르므로 0 + } + + return solve(true, idx + 1, num + arr[idx]) + solve(flag, idx + 1, num); + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while (st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { + return Integer.parseInt(next()); + } + + long nextLong() { + return Long.parseLong(next()); + } + + double nextDouble() { + return Double.parseDouble(next()); + } + + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} diff --git a/solution/backtracking/1182/main.py b/solution/backtracking/1182/main.py new file mode 100644 index 0000000..b6f12d5 --- /dev/null +++ b/solution/backtracking/1182/main.py @@ -0,0 +1,29 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/1938989c82c1488282cdb2c22d4a9e17 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +def backTracking(idx): + global ans + if len(poc) >= N: + if sum(poc) == S: + ans += 1 + return + else: + if sum(poc) == S and poc: + ans += 1 + for i in range(idx,N): + poc.append(arr[i]) + backTracking(i+1) + poc.pop() + +N, S = map(int, input().split()) +arr = list(map(int, input().split())) +visited = [0] * N +poc = [] +ans = 0 +backTracking(0) +print(ans) \ No newline at end of file diff --git a/solution/backtracking/1189/main.cpp b/solution/backtracking/1189/main.cpp new file mode 100644 index 0000000..05de145 --- /dev/null +++ b/solution/backtracking/1189/main.cpp @@ -0,0 +1,42 @@ +// Authored by : jybin321 +// Co-authored by : - +// Link : http://boj.kr/4e07968244514f549f599884c6fd819e + +#include +using namespace std; +int r, c, k, ans; +string _map[6]; +bool visited[6][6]; +int dx[] = {0, -1, 0, 1}; +int dy[] = {-1, 0, 1, 0}; + +void input() { + cin >> r >> c >> k; + for(int i = r - 1; i >= 0; i--) { + string s; cin >> s; + _map[i] = s; + } +} + +void func(int cnt, int y, int x) { + if(cnt == k) { + if(y == r - 1 && x == c - 1) ans += 1; + return; + } + visited[y][x] = 1; + for(int i = 0; i < 4; i++) { + int nx = x + dx[i], ny = y + dy[i]; + if(nx < 0 || nx >= c || ny < 0 || ny >= r) continue; + if(visited[ny][nx] || _map[ny][nx] == 'T') continue; + func(cnt + 1, ny, nx); + visited[ny][nx] = 0; + } +} + +int main(void) { + ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); + input(); + func(1, 0, 0); + cout << ans; + return 0; +} \ No newline at end of file diff --git a/solution/backtracking/1405/main.py b/solution/backtracking/1405/main.py new file mode 100644 index 0000000..05aea73 --- /dev/null +++ b/solution/backtracking/1405/main.py @@ -0,0 +1,32 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/90f99f64ed7f4b2ba7af6cba10fac4b9 + +import sys + +def input(): + return sys.stdin.readline().rstrip() + +def DFS(x,y,ct,now): + global ans + if ct == N: + ans += now + return + for i in range(4): + dx = x + nx[i] + dy = y + ny[i] + if visited[dx][dy] == 0: + visited[dx][dy] = 1 + DFS(dx,dy,ct+1,now*dir[i]/100) + visited[dx][dy] = 0 + +arr = list(map(int, input().split())) +ans = 0 +nx = [0, 0, 1, -1] +ny = [1, -1, 0, 0] +visited = [[0 for i in range(31)] for j in range(31)] +N = arr[0] +dir = arr[1:] +visited[14][14] = 1 +DFS(14,14,0,1) +print(ans) \ No newline at end of file diff --git a/solution/backtracking/14712/Main.java b/solution/backtracking/14712/Main.java new file mode 100644 index 0000000..229aa3e --- /dev/null +++ b/solution/backtracking/14712/Main.java @@ -0,0 +1,78 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/f810af85a30044488b4324ded456497d +import java.io.*; +import java.util.*; +import java.lang.*; + +public class Main { + static int [][]map; + static int N, M; + static int answer; + static public void main(String[] args) { + FastReader rd = new FastReader(); + + N = rd.nextInt(); + M = rd.nextInt(); + + map = new int[N + 1][M + 1]; // 1-index + + dfs(0); + + System.out.println(answer); + } + + static void dfs(int cnt) { + if(cnt == N * M) { + answer ++; + return ; + } + int y = cnt / M + 1; + int x = cnt % M + 1; + + if(map[y - 1][x] == 1 && map[y][x - 1] == 1 && map[y - 1][x - 1] == 1) { // 현재 놓을 수 없는 곳 + dfs(cnt + 1); + } + else { + dfs(cnt + 1); // 선택 안하고 다음껄 볼 경우 + map[y][x] = 1; + dfs(cnt + 1); // 선택 하고 다음껄 볼 경우 + map[y][x] = 0; + } + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + long nextLong() { return Long.parseLong(next()); } + double nextDouble() { return Double.parseDouble(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} diff --git a/solution/backtracking/14712/main.cpp b/solution/backtracking/14712/main.cpp new file mode 100644 index 0000000..f1ba4bc --- /dev/null +++ b/solution/backtracking/14712/main.cpp @@ -0,0 +1,42 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/1a1754c8c07c462e9d52af5ae146809c + +#include + +using namespace std; + +int N, M, Map[33][33]; // 1-index +int answer = 0; + +bool check(int y, int x) { + return Map[y-1][x] && Map[y][x-1] && Map[y-1][x-1]; +} + +void go(int usedCnt) { + if(usedCnt == N * M) { + answer ++; + return ; + } + + int y = usedCnt / M + 1; + int x = usedCnt % M + 1; + + go(usedCnt + 1); + if(!check(y, x)) { + Map[y][x] = 1; + go(usedCnt + 1); + Map[y][x] = 0; + } +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + cin >> N >> M; + go(0); + cout << answer; + + return 0; +} diff --git a/solution/backtracking/14712/main.py b/solution/backtracking/14712/main.py new file mode 100644 index 0000000..cd763d0 --- /dev/null +++ b/solution/backtracking/14712/main.py @@ -0,0 +1,31 @@ +# Authored by : tony9402 +# Co-authored by : - +# Link : http://boj.kr/117634e91c71493787610c9e0406a605 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N, M = map(int, input().split()) + +# 1-index +Map = [ [ 0 for _ in range(M + 1) ] for __ in range(N + 1) ] +answer = 0 + +def dfs(cnt): + global answer + if cnt == N * M: + answer += 1 + return + + y = cnt // M + 1 + x = cnt % M + 1 + + dfs(cnt + 1) + if Map[y - 1][x] == 0 or Map[y][x - 1] == 0 or Map[y - 1][x - 1] == 0: # 만약 놓을 수 있는 곳이라면 + Map[y][x] = 1 + dfs(cnt + 1) + Map[y][x] = 0 + +dfs(0) +print(answer) diff --git a/solution/backtracking/14889/main.cpp b/solution/backtracking/14889/main.cpp new file mode 100644 index 0000000..b4f0fc3 --- /dev/null +++ b/solution/backtracking/14889/main.cpp @@ -0,0 +1,48 @@ +// Authored by : jybin321 +// Co-authored by : - +// Link : http://boj.kr/1352b81ac8c5417f908c5e9fd2f395d9 + +#include +using namespace std; +int n, ans = INT_MAX, arr[21][21]; +bool v[21]; + +void input() { + cin >> n; + for(int i = 0; i < n; i++) + for(int j = 0; j < n; j++) + cin >> arr[i][j]; +} + +int check(int clan) { + int res = 0; + for(int i = 0; i < n; i++) + for(int j = 0; j < n; j++) + if(v[i] == clan && v[j] == clan) + res += arr[i][j]; + return res; +} + +void func(int idx, int cnt) { + if(idx == n / 2) { + int a = check(1); + int b = check(0); + ans = min(ans, abs(a - b)); + return; + } + + for(int i = cnt; i < n; i++) { + if(v[i]) continue; + v[i] = 1; + func(idx + 1, i); + v[i] = 0; + } +} + +int main(void) { + ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); + input(); + func(0, 0); + cout << ans; + return 0; +} diff --git a/solution/backtracking/15649/main.cpp b/solution/backtracking/15649/main.cpp new file mode 100644 index 0000000..f6376b3 --- /dev/null +++ b/solution/backtracking/15649/main.cpp @@ -0,0 +1,37 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/51963cf92cd741ea8bb67b164cc944f9 +#include + +using namespace std; + +int choose[10], N, M; +bool used[10]; + +void dfs(int cnt) { + if(cnt == M) { + for(int i=0;i> N >> M; + dfs(0); + + return 0; +} diff --git a/solution/backtracking/15649/main.py b/solution/backtracking/15649/main.py new file mode 100644 index 0000000..243c71c --- /dev/null +++ b/solution/backtracking/15649/main.py @@ -0,0 +1,29 @@ +# Authored by : tony9402 +# Co-authored by : - +# Link : http://boj.kr/69f68131effd4506a17fdac4b8569c6c +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N, M = map(int, input().split()) +choose = [ 0 for _ in range(10) ] +used = [ 0 for _ in range(10) ] + +def dfs(cnt): + global N, M + if cnt == M: + for idx in range(cnt): + print(choose[idx], end=' ') + print() + return + + for i in range(1, N + 1): + if used[i]: + continue + used[i] = 1 + choose[cnt] = i + dfs(cnt + 1) + used[i] = 0 + +dfs(0) diff --git a/solution/backtracking/15650/main.cpp b/solution/backtracking/15650/main.cpp new file mode 100644 index 0000000..925b460 --- /dev/null +++ b/solution/backtracking/15650/main.cpp @@ -0,0 +1,38 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/dc4a2e040e7d406b875abaa4d969bd50 +#include + +using namespace std; + +int choose[10], N, M; +bool used[10]; + +void dfs(int pre, int cnt) { + if(cnt == M) { + for(int i=0;i> N >> M; + dfs(0, 0); + + return 0; +} + diff --git a/solution/backtracking/15650/main.py b/solution/backtracking/15650/main.py new file mode 100644 index 0000000..58a021e --- /dev/null +++ b/solution/backtracking/15650/main.py @@ -0,0 +1,31 @@ +# Authored by : tony9402 +# Co-authored by : - +# Link : http://boj.kr/afca9b0c42354f99a6578ab92e0de0a3 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N, M = map(int, input().split()) +choose = [ 0 for _ in range(10) ] +used = [ 0 for _ in range(10) ] + +def dfs(idx, cnt): + global N, M + if cnt == M: + for idx in range(cnt): + print(choose[idx], end=' ') + print() + return + + for i in range(idx, N + 1): + if used[i]: + continue + used[i] = 1 + choose[cnt] = i + dfs(i + 1, cnt + 1) + used[i] = 0 + +dfs(1, 0) + + diff --git a/solution/backtracking/15651/main.cpp b/solution/backtracking/15651/main.cpp new file mode 100644 index 0000000..b169471 --- /dev/null +++ b/solution/backtracking/15651/main.cpp @@ -0,0 +1,33 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/0a5ce31db1ff47cf8190b0275e74bef8 +#include + +using namespace std; + +int choose[10], N, M; + +void dfs(int cnt) { + if(cnt == M) { + for(int i=0;i> N >> M; + dfs(0); + + return 0; +} diff --git a/solution/backtracking/15651/main.py b/solution/backtracking/15651/main.py new file mode 100644 index 0000000..06047ff --- /dev/null +++ b/solution/backtracking/15651/main.py @@ -0,0 +1,25 @@ +# Authored by : tony9402 +# Co-authored by : - +# Link : http://boj.kr/4631083fc0c04817af9b1020e2396ddc +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N, M = map(int, input().split()) +choose = [ 0 for _ in range(10) ] + +def dfs(idx, cnt): + global N, M + if cnt == M: + for idx in range(cnt): + print(choose[idx], end=' ') + print() + return + + for i in range(1, N + 1): + choose[cnt] = i + dfs(i + 1, cnt + 1) + +dfs(1, 0) + diff --git a/solution/backtracking/15652/main.cpp b/solution/backtracking/15652/main.cpp new file mode 100644 index 0000000..e6ef667 --- /dev/null +++ b/solution/backtracking/15652/main.cpp @@ -0,0 +1,33 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/a90bad59d92f4f87bbb056c9e643b330 +#include + +using namespace std; + +int choose[10], N, M; + +void dfs(int pre, int cnt) { + if(cnt == M) { + for(int i=0;i> N >> M; + dfs(1, 0); + + return 0; +} diff --git a/solution/backtracking/15652/main.py b/solution/backtracking/15652/main.py new file mode 100644 index 0000000..bcfd3c6 --- /dev/null +++ b/solution/backtracking/15652/main.py @@ -0,0 +1,26 @@ +# Authored by : tony9402 +# Co-authored by : - +# Link : http://boj.kr/2a9874489cb74d7babd30d70501acff9 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N, M = map(int, input().split()) +choose = [ 0 for _ in range(10) ] + +def dfs(idx, cnt): + global N, M + if cnt == M: + for idx in range(cnt): + print(choose[idx], end=' ') + print() + return + + for i in range(idx, N + 1): + choose[cnt] = i + dfs(i, cnt + 1) + +dfs(1, 0) + + diff --git a/solution/backtracking/15654/main.cpp b/solution/backtracking/15654/main.cpp new file mode 100644 index 0000000..b2d76b8 --- /dev/null +++ b/solution/backtracking/15654/main.cpp @@ -0,0 +1,39 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/3955b249d38d4c79851d4cf97d474c0b +#include + +using namespace std; + +int choose[10]; +int arr[10], N, M; +bool used[10]; + +void dfs(int cnt) { + if(cnt == M) { + for(int i=0;i> N >> M; + for(int i=0;i> arr[i]; + sort(arr, arr + N); + dfs(0); + + return 0; +} diff --git a/solution/backtracking/15654/main.py b/solution/backtracking/15654/main.py new file mode 100644 index 0000000..4b39fbf --- /dev/null +++ b/solution/backtracking/15654/main.py @@ -0,0 +1,30 @@ +# Authored by : tony9402 +# Co-authored by : - +# Link : http://boj.kr/fa5e88e6aac14dbabbbb8b5bc7037963 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N, M = map(int, input().split()) +arr = sorted(list(map(int, input().split()))) +choose = [ 0 for _ in range(10) ] +used = [ 0 for _ in range(10) ] + +def dfs(cnt): + global N, M + if cnt == M: + for idx in range(cnt): + print(arr[choose[idx]], end=' ') + print() + return + + for i in range(0,N): + if used[i]: + continue + used[i] = 1 + choose[cnt] = i + dfs(cnt + 1) + used[i] = 0 + +dfs(0) diff --git a/solution/backtracking/15655/main.cpp b/solution/backtracking/15655/main.cpp new file mode 100644 index 0000000..27a6e14 --- /dev/null +++ b/solution/backtracking/15655/main.cpp @@ -0,0 +1,39 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/cb5e9a75972a4ac59cc7b4428d07f2fa +#include + +using namespace std; + +int arr[10], choose[10], N, M; +bool used[10]; + +void dfs(int idx, int cnt) { + if(cnt == M){ + for(int i=0;i> N >> M; + for(int i=0;i> arr[i]; + sort(arr, arr + N); + dfs(0, 0); + + return 0; +} diff --git a/solution/backtracking/15655/main.py b/solution/backtracking/15655/main.py new file mode 100644 index 0000000..1378325 --- /dev/null +++ b/solution/backtracking/15655/main.py @@ -0,0 +1,30 @@ +# Authored by : tony9402 +# Co-authored by : - +# Link : http://boj.kr/d4f609a8ba2e40e8b578c37f3d21d344 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N, M = map(int, input().split()) +arr = sorted(list(map(int, input().split()))) +choose = [ 0 for _ in range(10) ] +used = [ 0 for _ in range(10) ] + +def dfs(idx, cnt): + global N, M + if cnt == M: + for idx in range(cnt): + print(arr[choose[idx]], end=' ') + print() + return + + for i in range(idx,N): + if used[i]: + continue + used[i] = 1 + choose[cnt] = i + dfs(i + 1, cnt + 1) + used[i] = 0 + +dfs(0, 0) diff --git a/solution/backtracking/15656/main.cpp b/solution/backtracking/15656/main.cpp new file mode 100644 index 0000000..4fda9cc --- /dev/null +++ b/solution/backtracking/15656/main.cpp @@ -0,0 +1,34 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/83f80cd932d54d52bc8cd412a6ee3abc +#include + +using namespace std; + +int arr[10], choose[10], N, M; + +void dfs(int cnt) { + if(cnt == M) { + for(int i=0;i> N >> M; + for(int i=0;i> arr[i]; + sort(arr, arr + N); + dfs(0); + + return 0; +} diff --git a/solution/backtracking/15656/main.py b/solution/backtracking/15656/main.py new file mode 100644 index 0000000..7c7aaf9 --- /dev/null +++ b/solution/backtracking/15656/main.py @@ -0,0 +1,25 @@ +# Authored by : tony9402 +# Co-authored by : - +# Link : http://boj.kr/dd28c9dd06a54efeb12b4f72e82e8c77 +import sys + +def input(): + return sys.stdin.readline().strip() + +N, M = map(int, input().split()) +arr = sorted(list(map(int, input().split()))) +choose = [ 0 for _ in range(10) ] + +def dfs(cnt): + global N, M + if cnt == M: + for idx in range(cnt): + print(arr[choose[idx]], end=' ') + print() + return + + for i in range(0,N): + choose[cnt] = i + dfs(cnt + 1) + +dfs(0) diff --git a/solution/backtracking/15657/main.cpp b/solution/backtracking/15657/main.cpp new file mode 100644 index 0000000..a38e258 --- /dev/null +++ b/solution/backtracking/15657/main.cpp @@ -0,0 +1,34 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/ba10084d78354aeabad7a57999d07356 +#include + +using namespace std; + +int arr[10], choose[10], N, M; + +void dfs(int idx, int cnt) { + if(cnt == M) { + for(int i=0;i> N >> M; + for(int i=0;i> arr[i]; + sort(arr, arr + N); + dfs(0, 0); + + return 0; +} diff --git a/solution/backtracking/15657/main.py b/solution/backtracking/15657/main.py new file mode 100644 index 0000000..97ba764 --- /dev/null +++ b/solution/backtracking/15657/main.py @@ -0,0 +1,26 @@ +# Authored by : tony9402 +# Co-authored by : - +# Link : http://boj.kr/7bbdc54527b2456d9e1e829834a2ece2 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N, M = map(int, input().split()) +arr = sorted(list(map(int, input().split()))) +choose = [ 0 for _ in range(10) ] + +def dfs(idx, cnt): + global N, M + if cnt == M: + for idx in range(cnt): + print(arr[choose[idx]], end=' ') + print() + return + + for i in range(idx,N): + choose[cnt] = i + dfs(i, cnt + 1) + +dfs(0, 0) + diff --git a/solution/backtracking/15658/main.py b/solution/backtracking/15658/main.py new file mode 100644 index 0000000..6e39bb8 --- /dev/null +++ b/solution/backtracking/15658/main.py @@ -0,0 +1,43 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/7f225e2c0f214a7a9033560ded2a16d4 + +import sys +from collections import deque + +def input(): + return sys.stdin.readline().rstrip() + +def DFS(ans): + global MIN, MAX + if not arr: + MIN = min(MIN, ans) + MAX = max(MAX, ans) + return + for i in range(4): + if oper[i] > 0: + oper[i] -= 1 + first = arr[0] + if i == 0: + DFS(ans+arr.popleft()) + elif i == 1: + DFS(ans-arr.popleft()) + elif i == 2: + DFS(ans*arr.popleft()) + elif i == 3: + if ans < 0 and arr[0] > 0 or ans > 0 and arr[0] < 0: + div = abs(ans) // abs(arr.popleft()) + DFS(-div) + else: + DFS(ans//arr.popleft()) + arr.appendleft(first) + oper[i] += 1 + +N = int(input()) +arr = deque(list(map(int, input().split()))) +oper = list(map(int, input().split())) +MIN = 1e9+1 +MAX = -1e9-1 +DFS(arr.popleft()) +print(MAX) +print(MIN) \ No newline at end of file diff --git a/solution/backtracking/15663/main.cpp b/solution/backtracking/15663/main.cpp new file mode 100644 index 0000000..d9dc2c9 --- /dev/null +++ b/solution/backtracking/15663/main.cpp @@ -0,0 +1,40 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/07e0a7b8b518418d86ac107dcdf56a7e +#include + +using namespace std; + +int arr[10], choose[10], N, M; +bool used[10]; + +void dfs(int cnt) { + if(cnt == M) { + for(int i=0;i> N >> M; + for(int i=0;i> arr[i]; + sort(arr, arr + N); + dfs(0); + + return 0; +} diff --git a/solution/backtracking/15663/main.py b/solution/backtracking/15663/main.py new file mode 100644 index 0000000..f1c07d0 --- /dev/null +++ b/solution/backtracking/15663/main.py @@ -0,0 +1,32 @@ +# Authored by : tony9402 +# Co-authored by : - +# Link : http://boj.kr/186f2997e3dd48859f2ef8b729d98bf3 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N, M = map(int, input().split()) +arr = sorted(list(map(int, input().split()))) +choose = [ 0 for _ in range(10) ] +used = [ 0 for _ in range(10) ] + +def dfs(cnt): + global N, M + if cnt == M: + for idx in range(cnt): + print(arr[choose[idx]], end=' ') + print() + return + + pre = -1 + for i in range(N): + if used[i] or pre == arr[i]: + continue + pre = arr[i] + used[i] = 1 + choose[cnt] = i + dfs(cnt + 1) + used[i] = 0 + +dfs(0) diff --git a/solution/backtracking/15664/main.cpp b/solution/backtracking/15664/main.cpp new file mode 100644 index 0000000..4a102f7 --- /dev/null +++ b/solution/backtracking/15664/main.cpp @@ -0,0 +1,40 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/6b0fef4c57c541529fa7feb2b74cd385 +#include + +using namespace std; + +int arr[10], choose[10], N, M; +bool used[10]; + +void dfs(int idx, int cnt) { + if(cnt == M) { + for(int i=0;i> N >> M; + for(int i=0;i> arr[i]; + sort(arr, arr + N); + dfs(0, 0); + + return 0; +} diff --git a/solution/backtracking/15664/main.py b/solution/backtracking/15664/main.py new file mode 100644 index 0000000..0012a33 --- /dev/null +++ b/solution/backtracking/15664/main.py @@ -0,0 +1,33 @@ +# Authored by : tony9402 +# Co-authored by : - +# Link : http://boj.kr/e43bf55556be4bd19c0ae586bcf5d12a +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N, M = map(int, input().split()) +arr = sorted(list(map(int, input().split()))) +choose = [ 0 for _ in range(10) ] +used = [ 0 for _ in range(10) ] + +def dfs(idx, cnt): + global N, M + if cnt == M: + for idx in range(cnt): + print(arr[choose[idx]], end=' ') + print() + return + + pre = -1 + for i in range(idx, N): + if used[i] or pre == arr[i]: + continue + pre = arr[i] + used[i] = 1 + choose[cnt] = i + dfs(i + 1, cnt + 1) + used[i] = 0 + +dfs(0, 0) + diff --git a/solution/backtracking/15665/main.cpp b/solution/backtracking/15665/main.cpp new file mode 100644 index 0000000..8090274 --- /dev/null +++ b/solution/backtracking/15665/main.cpp @@ -0,0 +1,37 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/216c114645a74d2fa0bcba6ddec5370b +#include + +using namespace std; + +int arr[10], choose[10], N, M; + +void dfs(int cnt) { + if(cnt == M) { + for(int i=0;i> N >> M; + for(int i=0;i> arr[i]; + sort(arr, arr + N); + dfs(0); + + return 0; +} diff --git a/solution/backtracking/15665/main.py b/solution/backtracking/15665/main.py new file mode 100644 index 0000000..c821dde --- /dev/null +++ b/solution/backtracking/15665/main.py @@ -0,0 +1,29 @@ +# Authored by : tony9402 +# Co-authored by : - +# Link : http://boj.kr/fc8e94e5fb3f4384a7272130a0624d8d +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N, M = map(int, input().split()) +arr = sorted(list(map(int, input().split()))) +choose = [ 0 for _ in range(10) ] + +def dfs(cnt): + global N, M + if cnt == M: + for idx in range(cnt): + print(arr[choose[idx]], end=' ') + print() + return + + pre = -1 + for i in range(0, N): + if pre == arr[i]: + continue + pre = arr[i] + choose[cnt] = i + dfs(cnt + 1) + +dfs(0) diff --git a/solution/backtracking/15666/main.cpp b/solution/backtracking/15666/main.cpp new file mode 100644 index 0000000..cf8827d --- /dev/null +++ b/solution/backtracking/15666/main.cpp @@ -0,0 +1,38 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/f952a2a2e4724f8981ff82ceccbdf854 +#include + +using namespace std; + +int arr[10], choose[10], N, M; + +void dfs(int idx, int cnt) { + if(cnt == M) { + for(int i=0;i> N >> M; + for(int i=0;i> arr[i]; + sort(arr, arr + N); + dfs(0, 0); + + return 0; +} + diff --git a/solution/backtracking/15666/main.py b/solution/backtracking/15666/main.py new file mode 100644 index 0000000..a63d8d2 --- /dev/null +++ b/solution/backtracking/15666/main.py @@ -0,0 +1,30 @@ +# Authored by : tony9402 +# Co-authored by : - +# Link : http://boj.kr/dbd389b484d4468990a877b205126f0f +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N, M = map(int, input().split()) +arr = sorted(list(map(int, input().split()))) +choose = [ 0 for _ in range(10) ] + +def dfs(idx, cnt): + global N, M + if cnt == M: + for idx in range(cnt): + print(arr[choose[idx]], end=' ') + print() + return + + pre = -1 + for i in range(idx, N): + if pre == arr[i]: + continue + pre = arr[i] + choose[cnt] = i + dfs(i, cnt + 1) + +dfs(0, 0) + diff --git a/solution/backtracking/16198/main.py b/solution/backtracking/16198/main.py new file mode 100644 index 0000000..242149e --- /dev/null +++ b/solution/backtracking/16198/main.py @@ -0,0 +1,25 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/3ba9e83879cc4489a5db43c977f87f45 + +import sys + +def input(): + return sys.stdin.readline().rstrip() + +def DFS(x): + global MAX + if len(arr) == 2: + MAX = max(MAX, x) + return + for i in range(1, len(arr)-1): + save = arr[i] + arr.pop(i) + DFS(x + arr[i-1] * arr[i]) + arr.insert(i, save) + +N = int(input()) +MAX = 0 +arr = list(map(int, input().split())) +DFS(0) +print(MAX) diff --git a/solution/backtracking/18430/main.cpp b/solution/backtracking/18430/main.cpp new file mode 100644 index 0000000..6913694 --- /dev/null +++ b/solution/backtracking/18430/main.cpp @@ -0,0 +1,69 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/9af9a652c69740c78b6f572ad732c356 +#include + +using namespace std; +int arr[10][10], n, m; +bool used[10][10]; +pair cases[4] = {{0,0}, {0,1}, {1,1}, {1,0}}; + +bool check(int y, int x, int c){ + int dy = cases[c].first, dx = cases[c].second; + for(int i=0;i<2;i++) + for(int j=0;j<2;j++){ + if(i == dy && j == dx)continue; + if(i + y >= n || j + x >= m)return false; + if(used[y+i][x+j])return false; + } + return true; +} + +void change(int y, int x, int c){ + int dy = cases[c].first, dx = cases[c].second; + for(int i=0;i<2;i++) + for(int j=0;j<2;j++){ + if(i == dy && j == dx)continue; + used[i+y][j+x] = !used[i+y][j+x]; + } +} + +int cal(int y, int x, int c){ + int dy = cases[c].first, dx = cases[c].second; + int oy = cases[(c+2)%4].first, ox = cases[(c+2)%4].second; + int ret = 0; + for(int i=0;i<2;i++) + for(int j=0;j<2;j++){ + if(i == dy && j == dx) ret += arr[y+oy][x+ox]; + else ret += arr[y+i][x+j]; + } + return ret; +} + +int solve(int y, int x){ + int ret = 0; + for(int i=y;i> n >> m; + for(int i=0;i> arr[i][j]; + + cout << solve(0, 0); +} diff --git a/solution/backtracking/2026/main.py b/solution/backtracking/2026/main.py new file mode 100644 index 0000000..ba8f935 --- /dev/null +++ b/solution/backtracking/2026/main.py @@ -0,0 +1,62 @@ +# Authored by : yj2221 +# Co-authored by : - +# Link : http://boj.kr/23aa0efe0fd94f888b47fdcacfbce2c7 + +import sys + +def input(): + return sys.stdin.readline().rstrip() + +K, N, F = map(int, sys.stdin.readline().split()) +relation = [[True if i == j else False for j in range(N+1)] for i in range(N+1)] + +for _ in range(F): + a, b = map(int, sys.stdin.readline().split()) + relation[a][b] = True + relation[b][a] = True + +def check(cur, friends): # 지금까지 쌓아온 친구들과 모두 관계가 성립하는지 확인 + result = True + for friend in friends: + if not relation[cur][friend]: + result = False + break + return result + +def dfs(start, relation, friends): + global flag, visit, answer + if flag: # 친구 관계 성립되면 더이상 할 필요 X + return + if len(friends) == K: # 만족하는 친구관계가 K개 일때 + flag = True + answer = friends + return + for nxt, status in enumerate(relation[start]): + if not status: continue + if visit[nxt]: continue + if not check(nxt, friends): continue + visit[nxt] = True + dfs(nxt, relation, friends + [nxt]) + visit[nxt] = False + +def solution(relation, K): + global flag, visit, answer + flag = False + answer = -1 + visit = [False for _ in range(N+1)] + for i in range(1, N+1): + if sum(relation[i]) < K: continue # i번째 사람의 친구가 K보다 작으면 할 필요 X + if flag: # 성공한 적 있으면 더이상 할 필요 X + break + visit[i] = True + dfs(i, relation, [i]) + visit[i] = False + return answer + +answer = solution(relation, K) + +if flag: + for num in answer: + print(num) +else: + print(-1) diff --git a/solution/backtracking/22944/main.py b/solution/backtracking/22944/main.py new file mode 100644 index 0000000..46081eb --- /dev/null +++ b/solution/backtracking/22944/main.py @@ -0,0 +1,56 @@ +# Authored by : yj2221 +# Co-authored by : - +# Link : http://boj.kr/62858e6576584934b6d2db90001acd5b + +import sys +sys.setrecursionlimit(10**4) + +def input(): + return sys.stdin.readline().rstrip() + +n, h, d = map(int, input().split()) + +visit = [[False] * n for _ in range(n)] +umbs = [] +for i in range(n): + line = input() + for j in range(n): + if line[j] == 'U': + umbs.append([i, j]) + elif line[j] == 'S': + start = [i, j] + elif line[j] == 'E': + end = [i, j] + +INF = 99999999 +answer = INF + +dy = [0, 0, -1, 1] +dx = [-1, 1, 0, 0] + +def dfs(cur): + global answer, n + y, x, health, durability, cnt = cur + dist = abs(end[0] - y) + abs(end[1] - x) + if dist <= health + durability: + answer = min(answer, cnt + dist) + return + else: + for umb in umbs: + uy, ux = umb + if visit[uy][ux]: continue + dist2 = abs(uy - y) + abs(ux - x) + if dist2 - 1 >= health + durability: continue + visit[uy][ux] = True + if dist2 <= durability: + dfs((uy, ux, health, d, cnt + dist2)) + else: + dfs((uy, ux, health + durability - dist2, d, cnt + dist2)) + visit[uy][ux] = False + +dfs((start[0], start[1], h, 0, 0)) + +if answer == INF: + print(-1) +else: + print(answer) diff --git a/solution/backtracking/2580/main.cpp b/solution/backtracking/2580/main.cpp new file mode 100644 index 0000000..da2060e --- /dev/null +++ b/solution/backtracking/2580/main.cpp @@ -0,0 +1,64 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/0ceb759a209343af89d8559da57a2bb2 +#include + +using namespace std; + +int Quiz[9][9], zeroCnt; +bool y[9][10], x[9][10], xy[9][10]; + +void input() { + for(int i=0;i<9;i++){ + for(int j=0;j<9;j++){ + cin >> Quiz[i][j]; + if(Quiz[i][j] == 0)zeroCnt++; + else { + x[j][Quiz[i][j]] = true; + y[i][Quiz[i][j]] = true; + xy[i/3*3+j/3][Quiz[i][j]] = true; + } + } + } +} + +void output() { + for(int i=0;i<9;i++){ + for(int j=0;j<9;j++){ + cout << Quiz[i][j] << " "; + } + cout << '\n'; + } +} + +bool solve() { + if(zeroCnt == 0) return true; + + // Find 0 + for(int i=0;i<9;i++){ + for(int j=0;j<9;j++){ + if(Quiz[i][j] != 0) continue; + for(int k=1;k<=9;k++){ + if(x[j][k] || y[i][k] || xy[i/3*3+j/3][k]) continue; + x[j][k] = y[i][k] = xy[i/3*3+j/3][k] = true; + Quiz[i][j] = k; + zeroCnt--; + if(solve()) return true; + x[j][k] = y[i][k] = xy[i/3*3+j/3][k] = false; + Quiz[i][j] = 0; + zeroCnt++; + } + return false; + } + } + return false; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + input(); + solve(); + output(); +} diff --git a/solution/backtracking/9663/main.cpp b/solution/backtracking/9663/main.cpp new file mode 100644 index 0000000..8d9bbd4 --- /dev/null +++ b/solution/backtracking/9663/main.cpp @@ -0,0 +1,33 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/bb3cca54213d47268ddc82a82728f730 +#include + +using namespace std; + +int n, ans; +bool Y[22], DL[44], DR[44]; + +void dfs(int y, int cnt){ + if(cnt == n){ + ans++; + return; + } + for(int j=0;j> n; + dfs(0, 0); + cout << ans; + + return 0; +} diff --git a/solution/binary_search/10815/Main.java b/solution/binary_search/10815/Main.java new file mode 100644 index 0000000..b094b35 --- /dev/null +++ b/solution/binary_search/10815/Main.java @@ -0,0 +1,81 @@ +// Authored by : lms0806 +// Co-authored by : - +// Link : http://boj.kr/7105d879677a4ebb96ade9837f789f03 +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.Arrays; +import java.util.StringTokenizer; + +public class Main { + static int[] arr; + public static void main(String[] args) throws IOException{ + FastReader rd = new FastReader(); + + int size = rd.nextInt(); + + arr = new int[size]; + + for(int i = 0; i < size; i++) { + arr[i] = rd.nextInt(); + } + + Arrays.sort(arr); + + size = rd.nextInt(); + + StringBuilder sb = new StringBuilder(); + while(size --> 0) { + sb.append(binary_search(0, arr.length - 1, rd.nextInt())).append(" "); + } + System.out.print(sb); + } + + public static int binary_search(int start, int end, int n) { + while(start <= end) { + int mid = (start + end) / 2; + if(arr[mid] == n) { + return 1; + } + + if(n < arr[mid]) end = mid - 1; + else start = mid + 1; + } + return 0; + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + long nextLong() { return Long.parseLong(next()); } + double nextDouble() { return Double.parseDouble(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} diff --git a/solution/binary_search/10815/main.cpp b/solution/binary_search/10815/main.cpp new file mode 100644 index 0000000..16dc877 --- /dev/null +++ b/solution/binary_search/10815/main.cpp @@ -0,0 +1,24 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/9e4cc6a176c6444d99cbc0379c5fd53a +#include + +using namespace std; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + vector V(N); + for(auto &i: V) cin >> i; + sort(V.begin(), V.end()); + int Q; cin >> Q; + for(int i=0;i> x; + if(binary_search(V.begin(), V.end(), x)) cout << 1 << ' '; + else cout << 0 << ' '; + } + + return 0; +} diff --git a/solution/binary_search/10816/main.py b/solution/binary_search/10816/main.py new file mode 100644 index 0000000..621286a --- /dev/null +++ b/solution/binary_search/10816/main.py @@ -0,0 +1,17 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/3bcac4799e584285b9df8be8d69ab79a +import sys +from bisect import bisect_left, bisect_right +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +arr = list(map(int, input().split())) +M = int(input()) +arr2 = list(map(int, input().split())) +arr.sort() +for i in arr2: + idx_left = bisect_left(arr,i) + idx_right = bisect_right(arr,i) + print(idx_right - idx_left, end=' ') \ No newline at end of file diff --git a/solution/binary_search/1477/main.py b/solution/binary_search/1477/main.py new file mode 100644 index 0000000..3b6681a --- /dev/null +++ b/solution/binary_search/1477/main.py @@ -0,0 +1,29 @@ +# Authored by : yj2221 +# Co-authored by : - +# Link : http://boj.kr/b93ed1e8f2a7413fa8fe39483692604f + +import sys + +def input(): + return sys.stdin.readline().rstrip() + +n, m, l = map(int, input().split()) +rests = sorted([0] + list(map(int, input().split())) + [l]) + +low = 1 +high = l +answer = high +while low <= high: + mid = (low + high) // 2 + + cnt = 0 + for i in range(n+1): + cnt += (rests[i+1] - rests[i] - 1) // mid + + if cnt<=m: + answer = mid + high = mid - 1 + else: + low = mid + 1 + +print(answer) diff --git a/solution/binary_search/1654/main.py b/solution/binary_search/1654/main.py new file mode 100644 index 0000000..98caf71 --- /dev/null +++ b/solution/binary_search/1654/main.py @@ -0,0 +1,30 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/5200a798517a4ec09af16f496ad137bd +import sys + +def input(): + return sys.stdin.readline().rstrip() + +def binary_search(): + global ans + start, end = 1, max(arr) + + while start <= end: + ct = 0 + mid = (start + end) // 2 + for i in arr: + ct += i // mid + if ct < N: + end = mid - 1 + else: + start = mid + 1 + ans = end + +K,N = map(int, input().split()) +arr = [] +ans = 0 +for i in range(K): + arr.append(int(input())) +binary_search() +print(ans) diff --git a/solution/binary_search/1789/Main.java b/solution/binary_search/1789/Main.java new file mode 100644 index 0000000..fe89131 --- /dev/null +++ b/solution/binary_search/1789/Main.java @@ -0,0 +1,58 @@ +// Authored by : lms0806 +// Co-authored by : - +// Link : http://boj.kr/67f7e1ce71fd4319ae9fbb05c69d50c2 +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.StringTokenizer; + +public class Main { + public static void main(String[] args) throws IOException{ + FastReader rd = new FastReader(); + + long size = rd.nextLong(); + + long count = 1, sum = 0; + while(size >= sum) { + sum += count; + count++; + } + + System.out.print(count - 2); + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + long nextLong() { return Long.parseLong(next()); } + double nextDouble() { return Double.parseDouble(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} \ No newline at end of file diff --git a/solution/binary_search/1789/main.cpp b/solution/binary_search/1789/main.cpp new file mode 100644 index 0000000..c3df21c --- /dev/null +++ b/solution/binary_search/1789/main.cpp @@ -0,0 +1,23 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/b757695822a7451ca902c666e024bb5f +#include + +using namespace std; +typedef long long ll; + +ll S; +bool chk(ll n){ return n*(n+1)/2 > S; } + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + cin >> S; + ll l = 1, r = 93000; // sqrt(4294967295 * 2) + while(l <= r){ + ll mid = (l + r) / 2; + if(chk(mid))r = mid - 1; + else l = mid + 1; + } + cout << r; +} diff --git a/solution/binary_search/1920/main.cpp b/solution/binary_search/1920/main.cpp new file mode 100644 index 0000000..0cbf30a --- /dev/null +++ b/solution/binary_search/1920/main.cpp @@ -0,0 +1,24 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/ecf2284ada79472da95d933e310ca959 +#include + +using namespace std; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + vector V(N); + for(auto &i: V) cin >> i; + sort(V.begin(), V.end()); + int Q; cin >> Q; + for(int i=0;i> x; + if(binary_search(V.begin(), V.end(), x)) cout << 1 << '\n'; + else cout << 0 << '\n'; + } + + return 0; +} diff --git a/solution/binary_search/19637/main.cpp b/solution/binary_search/19637/main.cpp new file mode 100644 index 0000000..888b75b --- /dev/null +++ b/solution/binary_search/19637/main.cpp @@ -0,0 +1,44 @@ +// Authored by : tallua_y +// Co-authored by : tony9402 +// Link : http://boj.kr/f9b5128041b54d33822f60534944128c +#include + +using namespace std; + +int main() +{ + ios::sync_with_stdio(false); + cin.tie(nullptr); + + int N, M; + cin >> N >> M; + + vector title_levels; + vector title_names; + + title_levels.reserve(N); + title_names.reserve(N); + + for(int i = 0; i < N; i++) { + string name; + int level; + cin >> name >> level; + + if (!title_levels.empty() && title_levels.back() == level) { + continue; + } + + title_levels.push_back(level); + title_names.push_back(name); + } + + for(int i = 0; i < M; i++) { + int power_level; + cin >> power_level; + + int index = lower_bound(title_levels.begin(), title_levels.end(), power_level) - title_levels.begin(); + cout << title_names[index] << '\n'; + } + + return 0; +} diff --git a/solution/binary_search/2110/Main.java b/solution/binary_search/2110/Main.java new file mode 100644 index 0000000..036828e --- /dev/null +++ b/solution/binary_search/2110/Main.java @@ -0,0 +1,82 @@ +// Authored by : lms0806 +// Co-authored by : - +// Link : http://boj.kr/200735713a4a43b9a67e046187e1c2d9 +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.Arrays; +import java.util.StringTokenizer; + +public class Main { + static int[] arr; + public static void main(String[] args) throws IOException{ + FastReader rd = new FastReader(); + + int size = rd.nextInt(), num = rd.nextInt(); + + arr = new int[size]; + + for(int i = 0; i < size; i++) { + arr[i] = rd.nextInt(); + } + + Arrays.sort(arr); + + int start = 1, end = arr[size - 1], answer = -1; + while(start <= end) { + int mid = (start + end) / 2; + int count = 1, last = arr[0]; + + for(int i = 1; i < size; i++) { + if(arr[i] - last >= mid) { + count++; + last = arr[i];//차이 좁혀가기 + } + } + + if(count >= num) { + answer = mid; + start = mid + 1;//start 차이 좁혀가기 + } + else { + end = mid - 1;//end 차이 좁혀가기 + } + } + System.out.print(answer); + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + long nextLong() { return Long.parseLong(next()); } + double nextDouble() { return Double.parseDouble(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} \ No newline at end of file diff --git a/solution/binary_search/2143/main.cpp b/solution/binary_search/2143/main.cpp new file mode 100644 index 0000000..502a6be --- /dev/null +++ b/solution/binary_search/2143/main.cpp @@ -0,0 +1,37 @@ +// Authored by : xhdxhl +// Co-authored by : - +// Link : http://boj.kr/7bb72686d3ca4feaba809fd4dd3f8c2e +#include +#define ll long long +using namespace std; +ll n, m, t, ans; +int main(){ + cin >> t >> n; + vector a(n); + for(int i = 0; i < n; i++) cin >> a[i]; + cin >> m; + vector b(m); + for(int i = 0; i < m; i++) cin >> b[i]; + for(int i = 0; i < n; i++){ + ll sum = a[i]; + for(int j = i+1; j < n; j++){ + sum += a[j]; + a.push_back(sum); + } + } + + for(int i = 0; i < m; i++){ + ll sum = b[i]; + for(int j = i+1; j < m; j++){ + sum += b[j]; + b.push_back(sum); + } + } + sort(b.begin(),b.end()); + for(int i = 0; i < a.size(); i++){ + int idx = lower_bound(b.begin(),b.end(),t - a[i]) - b.begin(); + int endIdx = upper_bound(b.begin(),b.end(),t - a[i]) - b.begin(); + ans += endIdx - idx; + } + cout << ans; +} \ No newline at end of file diff --git a/solution/binary_search/2417/Main.java b/solution/binary_search/2417/Main.java new file mode 100644 index 0000000..5258ff9 --- /dev/null +++ b/solution/binary_search/2417/Main.java @@ -0,0 +1,51 @@ +// Authored by : lms0806 +// Co-authored by : - +// Link : http://boj.kr/0d734197171d4318bf44c3de32cd5b65 +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.StringTokenizer; + +public class Main { + public static void main(String[] args) throws IOException{ + FastReader rd = new FastReader(); + + long n = rd.nextLong(), num = (long)Math.sqrt(n); + System.out.print(num >= n ? num : num + 1); + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + long nextLong() { return Long.parseLong(next()); } + double nextDouble() { return Double.parseDouble(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} \ No newline at end of file diff --git a/solution/binary_search/2417/main.cpp b/solution/binary_search/2417/main.cpp new file mode 100644 index 0000000..e22869e --- /dev/null +++ b/solution/binary_search/2417/main.cpp @@ -0,0 +1,32 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/dc2b68715aff442db67228432e9510ed +#include + +using namespace std; +typedef long long ll; + +bool chk(ll a, ll b) { + if(b % a == 0) return a >= b / a; + return a > b / a; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + ll N; cin >> N; + if(N == 0) { + cout << 0; + return 0; + } + ll L = 1, R = 1LL << 32; + while(L <= R) { + ll mid = L + (R - L) / 2; + if(chk(mid, N)) R = mid - 1; + else L = mid + 1; + } + cout << L; + + return 0; +} diff --git a/solution/binary_search/2470/main.py b/solution/binary_search/2470/main.py new file mode 100644 index 0000000..32a80ed --- /dev/null +++ b/solution/binary_search/2470/main.py @@ -0,0 +1,44 @@ +# Authored by : cieske +# Co-authored by : - +# Link : http://boj.kr/c487c1f5e7f34df0aaeba6a14fb6b2a5 +from bisect import bisect_left +import sys +def input(): + return sys.stdin.readline().rstrip() + +n = int(input()) +lst_pos, lst_neg = [], [] +input_lst = list(map(int, input().split())) +for x in input_lst: + if x > 0: lst_pos.append(x) + else: lst_neg.append(x) + +lst_pos.sort() +lst_neg.sort() + +if not lst_pos: print(*lst_neg[-2:]) # 양수가 없는 경우 +elif not lst_neg: print(*lst_pos[:2]) # 음수가 없는 경우 +else: + tmp = 2000000001 #최악 케이스+1 + if len(lst_neg) > 1: # 음수만 가지고 답일 수 있음 + if tmp > abs(sum(lst_neg[-2:])): + tmp = abs(sum(lst_neg[-2:])) + sol = lst_neg[-2:] + + if len(lst_pos) > 1: # 양수만 가지고 답일 수 있음 + if tmp > abs(sum(lst_pos[:2])): + tmp = abs(sum(lst_pos[:2])) + sol = lst_pos[:2] + + for num in lst_neg: + idx = bisect_left(lst_pos, -num) + if idx == len(lst_pos): idx -= 1 # 마지막 인덱스 + elif idx == 0: pass # 처음 인덱스 + elif abs(num+lst_pos[idx]) > abs(num+lst_pos[idx-1]): # 둘 중 최적 선택 + idx -= 1 + + if tmp > abs(num+lst_pos[idx]): # 필요 시 업데이트 + tmp = abs(num+lst_pos[idx]) + sol = sorted([num, lst_pos[idx]]) + + print(*sol) diff --git a/solution/binary_search/2512/main.py b/solution/binary_search/2512/main.py new file mode 100644 index 0000000..0dd3696 --- /dev/null +++ b/solution/binary_search/2512/main.py @@ -0,0 +1,28 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/7910ebb7f8ec409ba2e93cb14d047a19 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +def binary_search(): + start, end = 0, max(arr) + while start <= end: + mid = (start + end) // 2 + total = 0 + for i in arr: + if mid < i: + total += mid + else: + total += i + if total <= M: + start = mid + 1 + else: + end = mid - 1 + return end + +N = int(input()) +arr = list(map(int, input().split())) +M = int(input()) +print(binary_search()) diff --git a/solution/binary_search/2776/main.py b/solution/binary_search/2776/main.py new file mode 100644 index 0000000..08f07e0 --- /dev/null +++ b/solution/binary_search/2776/main.py @@ -0,0 +1,29 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/93afacc450454aedbd2b0d6667914846 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +def binary_search(t): + start, end = 0, len(arr)-1 + while start <= end: + mid = (start + end) // 2 + if arr[mid] == t: + return 1 + elif arr[mid] > t: + end = mid - 1 + else: + start = mid + 1 + return 0 + +T = int(input()) +for i in range(T): + N = int(input()) + arr = list(map(int, input().split())) + M = int(input()) + arr2 = list(map(int, input().split())) + arr.sort() + for j in arr2: + print(binary_search(j)) \ No newline at end of file diff --git a/solution/binary_search/2805/Main.java b/solution/binary_search/2805/Main.java new file mode 100644 index 0000000..d7552ae --- /dev/null +++ b/solution/binary_search/2805/Main.java @@ -0,0 +1,83 @@ +// Authored by : lms0806 +// Co-authored by : - +// Link : http://boj.kr/72e516ae033949fba8f5ab0b042e4364 +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.StringTokenizer; + +public class Main { + static int[] arr; + public static void main(String[] args) throws IOException{ + FastReader rd = new FastReader(); + + int size = rd.nextInt(), num = rd.nextInt(); + + arr = new int[size]; + + for(int i = 0; i < size; i++) { + arr[i] = rd.nextInt(); + } + + long end = arr[0]; + for(int n : arr) { + end = Math.max(end, n); + } + + long start = 0, answer = -1; + while(start <= end) { + long mid = (start + end) / 2, now = 0; + + for(int n : arr) { + now += Math.max(0, n - mid); + if(now >= num) { + break; + } + } + + if(now >= num) { + answer = mid; + start = mid + 1;//start 차이 좁혀가기 + } + else { + end = mid - 1;//end 차이 좁혀가기 + } + } + System.out.print(answer); + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + long nextLong() { return Long.parseLong(next()); } + double nextDouble() { return Double.parseDouble(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} \ No newline at end of file diff --git a/solution/binary_search/2805/main.py b/solution/binary_search/2805/main.py new file mode 100644 index 0000000..3f40296 --- /dev/null +++ b/solution/binary_search/2805/main.py @@ -0,0 +1,30 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/331c1288d35f4db9b12e371e014dfffd +import sys + +def input(): + return sys.stdin.readline().rstrip() + +def binary_search(): + global ans + start, end = 0, max(arr) + + while start <= end: + mid = (start + end) // 2 + total_length = 0 + for i in arr: + if i - mid >= 0: + total_length += i - mid + + if total_length < M: + end = mid - 1 + else: + start = mid + 1 + ans = end + +N, M = map(int, input().split()) +arr = list(map(int, input().split())) +ans = 0 +binary_search() +print(ans) diff --git a/solution/binary_search/3079/main.py b/solution/binary_search/3079/main.py new file mode 100644 index 0000000..428a016 --- /dev/null +++ b/solution/binary_search/3079/main.py @@ -0,0 +1,24 @@ +# Authored by : yj2221 +# Co-authored by : - +# Link : http://boj.kr/efcb8c8f772044538717ee1203d7c02d + +import sys + +def input(): + return sys.stdin.readline().rstrip() + +n, m = map(int, input().split()) +arr = [int(input()) for _ in range(n)] + +low, high = 0, 1000000000 * m +while low <= high: + mid = (low + high)//2 + cnt = 0 + for time in arr: + cnt += mid//time + if cnt>=m: + high = mid - 1 + else: + low = mid + 1 + +print(low) diff --git a/solution/binary_search/6236/main.py b/solution/binary_search/6236/main.py new file mode 100644 index 0000000..716793b --- /dev/null +++ b/solution/binary_search/6236/main.py @@ -0,0 +1,33 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/2fe2f6f8da4f448a8b1b2e6a4da13627 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +def binary_search(): + global K + start, end = max(arr), sum(arr) + while start <= end: + mid = (start + end) // 2 + have,ct = 0,0 + for i in arr: + if have < i: + have = mid - i + ct += 1 + else: + have = have - i + if ct > M: + start = mid + 1 + else: + end = mid - 1 + K = mid + +N, M = map(int, input().split()) +arr = [] +K = 0 +for i in range(N): + arr.append(int(input())) +binary_search() +print(K) diff --git a/solution/brute_force/1145/main.py b/solution/brute_force/1145/main.py new file mode 100644 index 0000000..fed5937 --- /dev/null +++ b/solution/brute_force/1145/main.py @@ -0,0 +1,17 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/d16fad5335804ed3a30799f0cf9fdf11 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +arr = list(map(int, input().split())) +for i in range(min(arr), 1000001): + ct = 0 + for j in range(5): + if i % arr[j] == 0: + ct += 1 + if ct >= 3: + print(i) + break \ No newline at end of file diff --git a/solution/brute_force/13140/main.cpp b/solution/brute_force/13140/main.cpp new file mode 100644 index 0000000..abbd2ad --- /dev/null +++ b/solution/brute_force/13140/main.cpp @@ -0,0 +1,44 @@ +// Authored by : xhdxhl +// Co-authored by : - +// Link : http://boj.kr/86c226302ae94672947f1600061f2976 +#include + +using namespace std; + +int result, nums[10], flag; +string word = "helowrd"; +unordered_map m; + +int main(){ + ios_base::sync_with_stdio(0); + cin.tie(0); cout.tie(0); + + cin >> result; + for(int i = 0; i < 10; i++) nums[i] = i; + + do{ + for(int i = 0; i < word.size(); i++) m[word[i]] = nums[i]; + + if(m['h'] == 0 || m['w'] == 0) continue; + + int a = m['h'] * 10000 + m['e'] * 1000 + m['l'] * 100 + m['l'] * 10 + m['o']; + int b = m['w'] * 10000 + m['o'] * 1000 + m['r'] * 100 + m['l'] * 10 + m['d']; + + if(a + b == result){ + int as = to_string(a).size(); + int bs = to_string(b).size(); + + cout << " " << a << '\n'; + cout << "+ " << b << '\n'; + cout << "-------\n"; + for(int i = 0; i < 7 - to_string(result).size(); i++) cout << ' '; + cout << result << '\n'; + + flag = 1; + break; + } + + } while(next_permutation(nums, nums + 10)); + + if(!flag) cout << "No Answer"; +} diff --git a/solution/brute_force/13410/main.py b/solution/brute_force/13410/main.py new file mode 100644 index 0000000..5d6e249 --- /dev/null +++ b/solution/brute_force/13410/main.py @@ -0,0 +1,11 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/6cd0f036ab1d40eaad68c57ee4eb6ff4 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N, K = map(int, input().split()) +num = [ int(str(N * i)[::-1]) for i in range(1, K + 1) ] +print(max(num)) diff --git a/solution/brute_force/1436/main.py b/solution/brute_force/1436/main.py new file mode 100644 index 0000000..dc8056a --- /dev/null +++ b/solution/brute_force/1436/main.py @@ -0,0 +1,25 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/32ff54d1000b438281226631f054c697 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +ct = 0 +ans = 0 +num = 666 + +while True: + + if '666' in str(num): + ct += 1 + + if ct == N: + ans = num + break + + num += 1 + +print(ans) \ No newline at end of file diff --git a/solution/brute_force/14500/main.py b/solution/brute_force/14500/main.py new file mode 100644 index 0000000..6eccc36 --- /dev/null +++ b/solution/brute_force/14500/main.py @@ -0,0 +1,77 @@ +#Authored by : shjeong92 +#Co-authored by : - +#Link : http://boj.kr/04d943fbb1d14ca0b17c62790a25fe8a +import sys +from itertools import combinations as combi + +def input(): + return sys.stdin.readline().rstrip() + +N, M = map(int,input().split()) +#보드입력받기 +board = [list(map(int,input().split())) for _ in range(N)] +#백트래킹용 체크 +check = [ [True] * M for _ in range(N)] +#RLUD +dx = (0,0,-1,1) +dy = (1,-1,0,0) +answer = 0 +#T 자블록 검색 +def block_T(x,y): + #중앙의 한 점이라고 가정한다 + result = board[x][y] + # 상하좌우의 티어나온부분 중 날개가 4개면 + # 제일작은 값을 제거한값이 최대값이 될것이고, + # 날개가 2개라면 T가아니고 날개가 3개라면 그냥 그값을 리턴해준다. + wings = 4 + MIN = int(1e9) + for i in range(4): + nx = x + dx[i] + ny = y + dy[i] + if wings == 2: + return 0 + #꼬다리부분이 맵을 벗어난다? 그방향 날개는 없는것. + if not (0<=nx board[nx][ny]: + MIN = board[nx][ny] + #모든방향 날개가 살아있단 말이므로 4방향의 날개중 제일 작은날개 하나를 잘라준다. + if wings == 4: + result -= MIN + return result + +#T자를 제외한 블록은 dfs를 이용해 계산 +def dfs(x,y,val,depth): + global answer + if depth == 4: + answer = max(answer,val) + return + + for i in range(4): + nx = x + dx[i] + ny = y + dy[i] + if 0 <= nx < N and 0 <= ny < M: + if check[nx][ny]: + #4개블럭값이 이전 블럭값이면 안되니까 false 해주고 + check[nx][ny] = False + dfs(nx,ny,val+board[nx][ny],depth+1) + #끝난후 다시 방문가능처리해줌. + check[nx][ny] = True + + +for i in range(N): + for j in range(M): + #시작블록을 다시방문하면안됨 + check[i][j] = False + dfs(i,j,board[i][j],1) + #끝난후 다시 방문가능처리 + check[i][j] = True + + temp = block_T(i,j) + answer = max(answer,temp) + + +print(answer) diff --git a/solution/brute_force/14620/main.py b/solution/brute_force/14620/main.py new file mode 100644 index 0000000..4d55318 --- /dev/null +++ b/solution/brute_force/14620/main.py @@ -0,0 +1,44 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/3b62a8a262a34102b1361a464e12f0c9 + +import sys +from itertools import combinations + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +arr = [] +flower = [] +MIN = 1e9 +nx = [-1, 0, 1, 0] +ny = [0, -1, 0, 1] +for i in range(N): + arr.append(list(map(int, input().split()))) +for i in range(1, N-1): + for j in range(1, N-1): + flower.append((i,j)) +for flower_comb in combinations(flower, 3): + temp = 0 + flag = 0 + visited = [[0 for i in range(N)] for j in range(N)] + for flo in flower_comb: + if visited[flo[0]][flo[1]] == 0: + visited[flo[0]][flo[1]] + temp += arr[flo[0]][flo[1]] + else: + flag = 1 + break + for i in range(4): + dx = flo[0] + nx[i] + dy = flo[1] + ny[i] + if visited[dx][dy] == 0: + visited[dx][dy] = 1 + temp += arr[dx][dy] + else: + flag = 1 + break + if not flag: + MIN = min(MIN, temp) +print(MIN) \ No newline at end of file diff --git a/solution/brute_force/15661/main.py b/solution/brute_force/15661/main.py new file mode 100644 index 0000000..6176ad1 --- /dev/null +++ b/solution/brute_force/15661/main.py @@ -0,0 +1,26 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/946d652cbd7a4361aaeff5ff1f2612d5 +import sys +from itertools import combinations + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +arr = [] +num = [i for i in range(N)] +MIN = 1e9 +for i in range(N): + arr.append(list(map(int, input().split()))) +comb_list = list(combinations(num, N//2)) +for comb in comb_list: + start = 0 + link = 0 + remain = [i for i in range(N) if i not in comb] + for com in combinations(comb, 2): + start += arr[com[0]][com[1]] + for ar in combinations(remain, 2): + link += arr[ar[0]][ar[1]] + MIN = min(MIN, abs(start - link)) +print(MIN) \ No newline at end of file diff --git a/solution/brute_force/15721/main.cpp b/solution/brute_force/15721/main.cpp new file mode 100644 index 0000000..1f12825 --- /dev/null +++ b/solution/brute_force/15721/main.cpp @@ -0,0 +1,29 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/2e1ee57b7481444fad22d74a53c6ac21 +#include + +using namespace std; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int A, T, B; cin >> A >> T >> B; + int answer = -1; + for(int i=1; T ;i++){ + for(int j=0;T && j<4;j++) { + T -= (j % 2 == B); + ++answer; + } + for(int j=0;T && j<2;j++) { + for(int k=0;T && k<=i;k++) { + T -= (j % 2 == B); + ++answer; + } + } + } + cout << answer % A; + + return 0; +} diff --git a/solution/brute_force/16439/main.cpp b/solution/brute_force/16439/main.cpp new file mode 100644 index 0000000..1e2fcc3 --- /dev/null +++ b/solution/brute_force/16439/main.cpp @@ -0,0 +1,31 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/e9a6c4d2144e4f7db1fd8ab2bfd14058 +#include + +using namespace std; + +int arr[33][33]; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N, M; cin >> N >> M; + for(int i=0;i> arr[i][j]; + int answer = 0; + for(int i=0;i N: + break + if a * a + b * b == N: + ret = 2 + + if ret <= 2: + break + for c in range(1, sqrtN + 1): + if a * a + b * b + c * c > N: + break + if a * a + b * b + c * c == N: + ret = 3 + break + + return ret + +N = int(input()) +sqrtN = int(sqrt(N)) +print(solve(N)) diff --git a/solution/brute_force/18312/main.cpp b/solution/brute_force/18312/main.cpp new file mode 100644 index 0000000..1638932 --- /dev/null +++ b/solution/brute_force/18312/main.cpp @@ -0,0 +1,31 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/a1f005e8ee00409590b55623b8057ff0 +#include + +using namespace std; + +bool chk(int a, int b) { + for(int i=0;i<2;i++) { + if(a % 10 == b) return true; + a /= 10; + } + return false; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N, K; cin >> N >> K; + int answer = 0; + for(int i=0;i<(N+1)*3600;i++) { + int hh = i / 3600; + int mm = i / 60 % 60; + int ss = i % 60; + if(chk(hh, K) || chk(mm, K) || chk(ss, K)) answer++; + } + cout << answer; + + return 0; +} diff --git a/solution/brute_force/18511/main.py b/solution/brute_force/18511/main.py new file mode 100644 index 0000000..caab2ad --- /dev/null +++ b/solution/brute_force/18511/main.py @@ -0,0 +1,23 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/b56f91d1e33b44c2b24d57cd460eace2 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +def backTracking(num): + global ans + if num > N: + return + ans = max(ans,num) + for i in K: + num = num * 10 + i + backTracking(num) + num = (num - i) // 10 + +N, C = map(int, input().split()) +K = list(map(int, input().split())) +ans = 0 +backTracking(0) +print(ans) diff --git a/solution/brute_force/18808/main.py b/solution/brute_force/18808/main.py new file mode 100644 index 0000000..3b57b98 --- /dev/null +++ b/solution/brute_force/18808/main.py @@ -0,0 +1,80 @@ +# Authored by : yj2221 +# Co-authored by : - +# Link : http://boj.kr/81188121d759417d8f72e6a00476ce7c + +from collections import deque +import sys + +def input(): + return sys.stdin.readline().rstrip() + +def rotate(arr, N): + result = [] + i_array = [] + j_array = [] + for item in arr: + i,j = item + i_array.append(j) + j_array.append(N-i-1) + result.append((j,N-i-1)) + i_min = min(i_array) + j_min = min(j_array) + real_result = [] + for item in result: + y,x = item + real_result.append((y-i_min,x-j_min)) + return real_result + +def check(n,m,arr,visit): + for i in range(n): + for j in range(m): + chk = True + temp = set() + for y,x in arr: + if y+i + +using namespace std; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + vector V(6); + for(int i=0;i<6;i++) cin >> V[i]; + + for(int x = -1000; x <= 1000; x++) { + for(int y = -1000; y <= 1000; y++) { + int F = V[0] * x + V[1] * y - V[2]; + int S = V[3] * x + V[4] * y - V[5]; + if(F == 0 && S == 0) { + cout << x << ' ' << y; + return 0; + } + } + } + + return 0; +} diff --git a/solution/brute_force/1969/main.py b/solution/brute_force/1969/main.py new file mode 100644 index 0000000..76218fb --- /dev/null +++ b/solution/brute_force/1969/main.py @@ -0,0 +1,33 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/c08f03602f524dc3822344da70739929 + +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N, M = map(int, input().split()) +arr = [] +word = '' +dist = 0 + +for i in range(N): + arr.append(input()) + +for i in range(M): + dic = {} + for j in range(N): + if arr[j][i] not in dic: + dic[arr[j][i]] = 1 + + else: + dic[arr[j][i]] += 1 + + ans = list(dic.items()) + ans.sort(key = lambda x : (-x[1], x[0])) + word += ans[0][0] + dist += N - ans[0][1] + +print(word) +print(dist) \ No newline at end of file diff --git a/solution/brute_force/21278/main.py b/solution/brute_force/21278/main.py new file mode 100644 index 0000000..bef384c --- /dev/null +++ b/solution/brute_force/21278/main.py @@ -0,0 +1,67 @@ +# Authored by : yj2221 +# Co-authored by : - +# Link : http://boj.kr/b52664ec81c3495db8b8091cd12f95d5 + +from itertools import combinations +from collections import deque +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N, M = map(int, input().split()) +graph = {i: [] for i in range(1, N+1)} +for _ in range(M): + a, b = map(int, input().split()) + graph[a].append(b) + graph[b].append(a) + +def bfs(start1, start2, graph, N): + result = [99999999 for _ in range(N+1)] + result[0] = 0 # 인덱스 0은 더미 + result[start1] = 0 + result[start2] = 0 + q = deque() + q.append((start1, 0)) + q.append((start2, 0)) + visit = set() + visit.add(start1) + visit.add(start2) + while q: + if len(visit) == N: + break + cur, dist = q.popleft() + for nxt in graph[cur]: + if nxt in visit: continue + visit.add(nxt) + q.append((nxt, dist + 1)) + result[nxt] = dist + 1 + return sum(result) + + +def solution(graph, N): + candidate = [i for i in range(1, N+1)] + answer = 99999999 + fin_store1 = N+1 + fin_store2 = N+1 + for comb in combinations(candidate, 2): + store1, store2 = comb + result = bfs(store1, store2, graph, N) + if answer > result: + fin_store1 = store1 + fin_store2 = store2 + answer = result + elif answer == result: + if fin_store1 > store1: + fin_store1 = store1 + fin_store2 = store2 + answer = result + elif fin_store1 == store1: + if fin_store2 > store2: + fin_store1 = store1 + fin_store2 = store2 + answer = result + + return ' '.join(map(str, [fin_store1, fin_store2, answer * 2])) + +print(solution(graph, N)) diff --git a/solution/brute_force/21315/main.py b/solution/brute_force/21315/main.py new file mode 100644 index 0000000..25bdfb3 --- /dev/null +++ b/solution/brute_force/21315/main.py @@ -0,0 +1,38 @@ +# Authored by : yj2221 +# Co-authored by : - +# Link : http://boj.kr/9857ec1183e144acb9d49a7316bdf595 + +from itertools import permutations +import sys + +def input(): + return sys.stdin.readline().rstrip() + +def shuffle(card1, card2, card3): + card = card2 + card1 + card3 + if len(card2) > 1: + return shuffle(card2[:len(card2)//2] + card1, card2[len(card2)//2:], card3) + else: + card = card2 + card1 + card3 + return card + +n = int(input()) +correct_cards = list(map(int,input().split())) +answer = [] +orders = [i for i in range(1, 10)] + [i for i in range(1, 10)] + +for perm in permutations(orders, 2): + if 2 ** max(perm)>=n: + continue + cards = [i for i in range(1, n+1)] + for k in perm: + card1 = [] + card2 = cards[n-(2**k):] + card3 = cards[:n-(2**k)] + cards = shuffle(card1, card2, card3) + + if cards == correct_cards: + answer = perm + break + +print(' '.join(map(str, answer))) diff --git a/solution/brute_force/2231/main.cpp b/solution/brute_force/2231/main.cpp new file mode 100644 index 0000000..df6f456 --- /dev/null +++ b/solution/brute_force/2231/main.cpp @@ -0,0 +1,28 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/19379bdb38884854badc892db21a8d6b +#include + +using namespace std; + +int cal(int x) { + int tmp = x; + while(x) { + tmp += x % 10; + x /= 10; + } + return tmp; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + int cur = 1; + while(cur < N + 100 && N != cal(cur)) cur++; + if(cur == N + 100) cur = 0; + cout << cur; + + return 0; +} diff --git a/solution/brute_force/2309/main.py b/solution/brute_force/2309/main.py new file mode 100644 index 0000000..94e2667 --- /dev/null +++ b/solution/brute_force/2309/main.py @@ -0,0 +1,28 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/be3b4fb036844cb390e1f7a818471cde + +import sys + +def input(): + return sys.stdin.readline().rstrip() + +def findIndex(ans): + + for i in range(9): + for j in range(i+1,9): + if arr[i] + arr[j] == ans: + return (arr[i], arr[j]) + +arr = [] +for i in range(9): + arr.append(int(input())) + +ans = sum(arr) - 100 +first, second = findIndex(ans) +arr.remove(first) +arr.remove(second) +arr.sort() + +for i in arr: + print(i) \ No newline at end of file diff --git a/solution/brute_force/2422/main.cpp b/solution/brute_force/2422/main.cpp new file mode 100644 index 0000000..3f3b226 --- /dev/null +++ b/solution/brute_force/2422/main.cpp @@ -0,0 +1,31 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/514a7a75b2eb4a2eaf862e8227682be7 +#include + +using namespace std; + +bool chk[222][222]; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N, M; cin >> N >> M; + for(int i=0;i> a >> b; + chk[a][b] = chk[b][a] = true; + } + int answer = 0; + for(int i=1;i<=N;i++) { + for(int j=i+1;j<=N;j++) { + for(int k=j+1;k<=N;k++) { + if(chk[i][j] || chk[j][k] || chk[i][k])continue; + answer++; + } + } + } + cout << answer; + + return 0; +} diff --git a/solution/brute_force/2503/main.py b/solution/brute_force/2503/main.py new file mode 100644 index 0000000..00066af --- /dev/null +++ b/solution/brute_force/2503/main.py @@ -0,0 +1,48 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/4e0ef6629dd34e659f1b3d6d470ccc41 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +def isDifferentAndNotZero(num): + if num[0] == num[1] or num[0] == num[2] or num[1] == num[2]: + return False + if '0' in num: + return False + return True + +def baseball(num): + flag = 0 + for i in range(N): + strike, ball = 0,0 + for j in range(3): + if num[j] == arr[i][0][j]: + strike += 1 + if num[0] == arr[i][0][1] or num[0] == arr[i][0][2]: + ball += 1 + if num[1] == arr[i][0][0] or num[1] == arr[i][0][2]: + ball += 1 + if num[2] == arr[i][0][0] or num[2] == arr[i][0][1]: + ball += 1 + if strike == arr[i][1] and ball == arr[i][2]: + flag += 1 + if flag == N: + return True + else: + return False + +N = int(input()) +arr = [] +poc = [] +ans = 0 + +for i in range(N): + num, strike, ball = input().split() + arr.append([num, int(strike), int(ball)]) + +for i in range(123,988): + if isDifferentAndNotZero(str(i)) and baseball(str(i)): + ans += 1 +print(ans) \ No newline at end of file diff --git a/solution/brute_force/2615/Main.java b/solution/brute_force/2615/Main.java new file mode 100644 index 0000000..424b6d7 --- /dev/null +++ b/solution/brute_force/2615/Main.java @@ -0,0 +1,117 @@ +// Authored by : smw123123 +// Co-authored by : - +// Link : http://boj.kr/7fe90aad8ed1484f95674d7fd4464d5c + +import java.util.*; +import java.lang.*; +import java.io.*; + +public class Main { + static int[][] board; + static int lastX, lastY; + public static void main(String[] args) { + FastReader sc = new FastReader(); + board = new int[19][19]; + for (int i = 0; i < 19; i++) { + for (int j = 0; j < 19; j++) { + board[i][j] = sc.nextInt(); + } + } + for (int i = 0; i < 19; i++) { + for (int j = 0; j < 19; j++) { + int cur = board[i][j]; + if(cur > 0) { + for (int d = 0; d < 4; d++) { + int nx = i + dx[d]; + int ny = j + dy[d]; + if(!isPossible(nx, ny)) continue; + if(board[nx][ny] == cur) { + var a = checkFirst(nx, ny, cur, d) + 1; + if(a == 5) { + var b = checkSecond(cur, d); + if(a == b) { + System.out.println(cur); + System.out.println((lastX+ dx[d]+1) + " " + (lastY+dy[d]+1)); + return; + } + } + } + } + } + } + } + System.out.println(0); + } + + private static int checkFirst(int x, int y, int cur, int direction) { + lastX = x; + lastY = y; + int nx = x + dx[direction]; + int ny = y + dy[direction]; + if(!isPossible(nx, ny)) return 1; + if(board[nx][ny] == cur) { + return checkFirst(nx, ny, cur, direction) + 1; + } + else + return 1; + } + + private static int checkSecond(int cur, int d) { + lastX = lastX + rdx[d]; + lastY = lastY + rdy[d]; + if(!isPossible(lastX, lastY)) return 1; + if(board[lastX][lastY] == cur) { + return checkSecond(cur, d) + 1; + } + else { + return 1; + } + } + private static boolean isPossible(int x, int y) { + return x >= 0 && x < 19 && y >= 0 && y < 19; + } + + // 오른쪽 위↗, 오른쪽→, 오른쪽 아래↘, 아래↓ + static int[] dx = {-1, 0, 1, 1}; + static int[] dy = {1, 1, 1, 0}; + + // 왼쪽 아래↙, 왼쪽←, 왼쪽 위↖, 위↑ + static int[] rdx = {1, 0, -1, -1}; + static int[] rdy = {-1, -1, -1, 0}; + + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + long nextLong() { return Long.parseLong(next()); } + double nextDouble() { return Double.parseDouble(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} diff --git a/solution/brute_force/2798/main.cpp b/solution/brute_force/2798/main.cpp new file mode 100644 index 0000000..c199254 --- /dev/null +++ b/solution/brute_force/2798/main.cpp @@ -0,0 +1,28 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/dc356e3adafd4e158b47dce9a9acd59b +#include + +using namespace std; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N, M; cin >> N >> M; + int answer = 0; + vector V(N); + for(int i=0;i> V[i]; + for(int i=0;i M) continue; + answer = max(answer, value); + } + } + } + cout << answer; + + return 0; +} diff --git a/solution/brute_force/2798/main.py b/solution/brute_force/2798/main.py new file mode 100644 index 0000000..1995310 --- /dev/null +++ b/solution/brute_force/2798/main.py @@ -0,0 +1,17 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/29a558ec778348f589fad5c627187638 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N, M = map(int, input().split()) +MAX = 0 +arr = list(map(int, input().split())) +for i in range(len(arr)): + for j in range(i+1,len(arr)): + for z in range(j+1,len(arr)): + if arr[i] + arr[j] + arr[z] <= M: + MAX = max(MAX, arr[i] + arr[j] + arr[z]) +print(MAX) \ No newline at end of file diff --git a/solution/brute_force/4096/main.py b/solution/brute_force/4096/main.py new file mode 100644 index 0000000..d87fe55 --- /dev/null +++ b/solution/brute_force/4096/main.py @@ -0,0 +1,26 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/b554cc74d1a24c9e9306775641121065 +import sys +def input(): + return sys.stdin.readline().rstrip() + +def isPalindrome(s): + return s == s[::-1] + +while True: + N = input() + length = len(N) + ct = 0 + if N == '0': + break + elif isPalindrome(N): + print(0) + else: + while True: + if isPalindrome(N): + print(ct) + break + N = str(int(N)+1) + N = '0' * (length - len(N)) + N + ct += 1 \ No newline at end of file diff --git a/solution/brute_force/4690/main.py b/solution/brute_force/4690/main.py new file mode 100644 index 0000000..78447b1 --- /dev/null +++ b/solution/brute_force/4690/main.py @@ -0,0 +1,9 @@ +# Authored by : chj3748 +# Co-authored by : - +# Link : http://boj.kr/fb355cbf95324465b430f4423567a2c4 +for a in range(2, 100 + 1): + for b in range(2, a): + for c in range(b, a): + for d in range(c, a): + if a ** 3 == b ** 3 + c ** 3 + d ** 3: + print(f'Cube = {a}, Triple = ({b},{c},{d})') \ No newline at end of file diff --git a/solution/brute_force/5568/main.py b/solution/brute_force/5568/main.py new file mode 100644 index 0000000..1fc4604 --- /dev/null +++ b/solution/brute_force/5568/main.py @@ -0,0 +1,23 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/0dd94001579e4341b3ea06ed523d2cba +import sys +from itertools import permutations + +def input(): + return sys.stdin.readline().rstrip() + +n = int(input()) +arr = [] +ans = set() +k = int(input()) +for i in range(n): + arr.append(input()) +per = list(permutations(arr, k)) +for i in range(len(per)): + st = '' + for j in range(len(per[i])): + st += per[i][j] + ans.add(st) +ans = list(ans) +print(len(ans)) \ No newline at end of file diff --git a/solution/brute_force/7568/main.py b/solution/brute_force/7568/main.py new file mode 100644 index 0000000..e04f188 --- /dev/null +++ b/solution/brute_force/7568/main.py @@ -0,0 +1,22 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/5540a61d3d364466bbe47e8c62beaedb +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +arr = [] + +for i in range(N): + weight, height = map(int, input().split()) + arr.append([weight,height,1]) + +for i in range(N): + for j in range(N): + if arr[i][0] < arr[j][0] and arr[i][1] < arr[j][1]: + arr[i][2] += 1 + +for i in range(len(arr)): + print(arr[i][2], end=' ') \ No newline at end of file diff --git a/solution/brute_force/9079/main.cpp b/solution/brute_force/9079/main.cpp new file mode 100644 index 0000000..a3af8d3 --- /dev/null +++ b/solution/brute_force/9079/main.cpp @@ -0,0 +1,129 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/98c4781dcf14402db3f83717f0154d5e +#include + +using namespace std; + +int makeBit(string s) { + int bit = 0; + for(int i = 8; i >= 0; i--) { + bit <<= 1; + if(s[i] == 'H') bit |= 1; + } + return bit; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int T; cin >> T; + while(T--) { + string coin; + bool used[512] = { false }; + int answer = -1; + + for(int i = 0; i < 9; i++) { + char ch; cin >> ch; + coin += ch; + } + + int bit = makeBit(coin); + + queue Q; + Q.push(bit); + used[bit] = true; + + bool flag = true; + while(!Q.empty() && flag) { + int qsize = Q.size(); + answer ++; + while(qsize--) { + int cur = Q.front(); Q.pop(); + if(cur == 0 || cur == (1 << 9) - 1) { + flag = false; + break; + } + // 자세한 내용은 맨 아래 Note 참고 + for(int nxt : { 7, 56, 448, 73, 146, 292, 273, 84 }) { + int nxtState = cur ^ nxt; + if(used[nxtState]) continue; + used[nxtState] = true; + Q.push(nxtState); + } + } + } + if(flag) answer = -1; + cout << answer << '\n'; + } + + return 0; +} + +/* + * NOTE !! + * + * - 동전 상태를 비트로 저장 + * 비트의 위치를 의미 + * + * 012 + * 345 -> [876543210] + * 678 + * + * ex) + * HTT 100 + * HTT -> 100 -> 110001001 -> 393 + * THH 011 + * + * + * - 동전을 뒤집는 경우 값 + * + * 111 + * 000 -> 000000111 -> 7 + * 000 + * + * 000 + * 111 -> 000111000 -> 56 + * 000 + * + * 000 + * 000 -> 111000000 -> 448 + * 111 + * + * 100 + * 100 -> 001001001 -> 73 + * 100 + * + * 010 + * 010 -> 010010010 -> 146 + * 010 + * + * 001 + * 001 -> 100100100 -> 292 + * 001 + * + * 100 + * 010 -> 100010001 -> 273 + * 001 + * + * 001 + * 010 -> 001010100 -> 84 + * 100 + * + * - 위 값을 이용하여 동전 뒤집기 + * + * HTT THH <--- 요 라인 + * HTT -> HTT : 가장 윗 부분 뒤집기 + * THH THH + * + * 이를 숫자를 이용하여 계산을 해본다면 아래와 같음 + * + * 왼쪽 동전 상태의 값 : 110001001 -> 393 + * 가장 위를 뒤집는 값 : 000000111 -> 7 + * 오른쪽 동전 상태의 값 : 110001110 -> 398 + * + * 해당 위치를 뒤집을 땐 XOR 연산을 이용하면 됨. + * + * 393 ^ 7 => 398 + */ diff --git a/solution/brute_force/9094/main.py b/solution/brute_force/9094/main.py new file mode 100644 index 0000000..929ab03 --- /dev/null +++ b/solution/brute_force/9094/main.py @@ -0,0 +1,18 @@ +# Authored by : gusdn3477 +# Co-authored by : tony9402 +# Link : http://boj.kr/ea96af96027540dcb1daa3b65e849eab +import sys + +def input(): + return sys.stdin.readline().rstrip() + +T = int(input()) +for i in range(T): + n,m = map(int, input().split()) + ct = 0 + for a in range(1,n): + for b in range(a+1,n): + if (a * a + b * b + m) % (a*b) == 0: + ct += 1 + + print(ct) diff --git a/solution/data_structure/1021/main.py b/solution/data_structure/1021/main.py new file mode 100644 index 0000000..d888026 --- /dev/null +++ b/solution/data_structure/1021/main.py @@ -0,0 +1,26 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/71a5091026cf4a1b836dc46c812aeaca +import sys +from collections import deque +def input(): + return sys.stdin.readline().rstrip() + +N, M = map(int, input().split()) +arr = list(map(int, input().split())) +queue = deque([i for i in range(1,N+1)]) +ans = 0 +for i in arr: + idx = queue.index(i) + if idx == 0: + queue.popleft() + else: + if idx <= len(queue)//2: + queue.rotate(-idx) + queue.popleft() + ans += idx + else: + queue.rotate(len(queue) - idx) + ans += len(queue) - idx + queue.popleft() +print(ans) \ No newline at end of file diff --git a/solution/data_structure/10799/main.cpp b/solution/data_structure/10799/main.cpp new file mode 100644 index 0000000..d0eca1f --- /dev/null +++ b/solution/data_structure/10799/main.cpp @@ -0,0 +1,39 @@ +// Authored by : tallua_y +// Co-authored by : - +// Link : http://boj.kr/6f2667a520d749d9adcee6ec0591da98 +#include + +using namespace std; + +int main() +{ + ios::sync_with_stdio(false); + cin.tie(nullptr); + + int total = 0; + int pipe_stack = 0; + bool is_opened = true; + + char ch; + while (cin >> ch) { + if (ch == '(') { + // start of pipe + pipe_stack++; + is_opened = true; + } else if (ch == ')' && is_opened) { + // laser + pipe_stack--; + total += pipe_stack; + is_opened = false; + } else if (ch == ')' && !is_opened) { + // end of pipe + pipe_stack--; + total += 1; + is_opened = false; + } + } + + cout << total << '\n'; + + return 0; +} diff --git a/solution/data_structure/10828/Main.java b/solution/data_structure/10828/Main.java new file mode 100644 index 0000000..f1d3d86 --- /dev/null +++ b/solution/data_structure/10828/Main.java @@ -0,0 +1,87 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/011509a1ee6b4edf8c2b2b2630b9822f +import java.lang.*; +import java.util.*; +import java.io.*; + +public class Main{ + static public void main(String[] args) { + FastReader rd = new FastReader(); + + int N = rd.nextInt(); + + Stack stack = new Stack<>(); + + StringBuilder out = new StringBuilder(); + for(int i=0;i + +using namespace std; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + + stack st; + + for(int i=0;i> cmd; + if(cmd == "push") { + int X; cin >> X; + st.push(X); + } + else if(cmd == "pop") { + if(st.empty()) { + cout << -1 << '\n'; + } + else { + cout << st.top() << '\n'; + st.pop(); + } + } + else if(cmd == "size") { + cout << (int)st.size() << '\n'; + } + else if(cmd == "empty") { + cout << st.empty() << '\n'; + } + else if(cmd == "top") { + if(st.empty()) { + cout << -1 << '\n'; + } + else { + cout << st.top() << '\n'; + } + } + } +} diff --git a/solution/data_structure/10828/main.py b/solution/data_structure/10828/main.py new file mode 100644 index 0000000..6e26004 --- /dev/null +++ b/solution/data_structure/10828/main.py @@ -0,0 +1,36 @@ +# Authored by : tony9402 +# Co-authored by : - +# Link : http://boj.kr/ab416f0794fc41cabc3d9ed46db29f60 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) + +stack = [] + +for i in range(N): + cmd = input().split() + X = 0 + if len(cmd) == 2: + X = cmd[1] + cmd = cmd[0] + + if cmd == "push": + stack.append(X) + elif cmd == "pop": + if len(stack) == 0: + print(-1) + else: + print(stack[-1]) + stack.pop(-1) + elif cmd == "size": + print(len(stack)) + elif cmd == "empty": + print(0 if len(stack) else 1) + elif cmd == "top": + if len(stack) == 0: + print(-1) + else: + print(stack[-1]) diff --git a/solution/data_structure/10845/main.py b/solution/data_structure/10845/main.py new file mode 100644 index 0000000..b70e60e --- /dev/null +++ b/solution/data_structure/10845/main.py @@ -0,0 +1,37 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/89f5e4e54afb441bbf218b5e68a4160d +import sys +from collections import deque + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +queue = deque() +for i in range(N): + command = input().split() + if command[0] == "push": + queue.append(command[1]) + elif command[0] == "pop": + if queue: + print(queue.popleft()) + else: + print(-1) + elif command[0] == "size": + print(len(queue)) + elif command[0] == "empty": + if not queue: + print(1) + else: + print(0) + elif command[0] == "front": + if queue: + print(queue[0]) + else: + print(-1) + elif command[0] == "back": + if queue: + print(queue[-1]) + else: + print(-1) \ No newline at end of file diff --git a/solution/data_structure/10866/main.cpp b/solution/data_structure/10866/main.cpp new file mode 100644 index 0000000..eb74762 --- /dev/null +++ b/solution/data_structure/10866/main.cpp @@ -0,0 +1,55 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/29a0795cb69c4aefa644a07f7019bbb9 +#include + +using namespace std; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + deque dq; + for(int i=0;i> cmd; + if(cmd == "push_front") { + int X; cin >> X; + dq.push_front(X); + } + else if(cmd == "push_back") { + int X; cin >> X; + dq.push_back(X); + } + else if(cmd == "pop_front") { + if(dq.empty()) cout << -1 << '\n'; + else { + cout << dq.front() << '\n'; + dq.pop_front(); + } + } + else if(cmd == "pop_back") { + if(dq.empty()) cout << -1 << '\n'; + else { + cout << dq.back() << '\n'; + dq.pop_back(); + } + } + else if(cmd == "size") { + cout << (int)dq.size() << '\n'; + } + else if(cmd == "empty") { + cout << dq.empty() << '\n'; + } + else if(cmd == "front") { + if(dq.empty()) cout << -1 << '\n'; + else cout << dq.front() << '\n'; + } + else if(cmd == "back") { + if(dq.empty()) cout << -1 << '\n'; + else cout << dq.back() << '\n'; + } + } + + return 0; +} diff --git a/solution/data_structure/10866/main.py b/solution/data_structure/10866/main.py new file mode 100644 index 0000000..f8e2c3d --- /dev/null +++ b/solution/data_structure/10866/main.py @@ -0,0 +1,44 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/1cf1ea352dba44daa9768b67c7f109e9 +import sys +from collections import deque + +def input(): + return sys.stdin.readline().rstrip() + +queue = deque() +N = int(input()) +for i in range(N): + command = input().split() + if command[0] == 'push_front': + queue.appendleft(command[1]) + elif command[0] == 'push_back': + queue.append(command[1]) + elif command[0] == 'pop_front': + if queue: + print(queue.popleft()) + else: + print(-1) + elif command[0] == 'pop_back': + if queue: + print(queue.pop()) + else: + print(-1) + elif command[0] == 'size': + print(len(queue)) + elif command[0] == 'empty': + if not queue: + print(1) + else: + print(0) + elif command[0] == 'front': + if queue: + print(queue[0]) + else: + print(-1) + elif command[0] == 'back': + if queue: + print(queue[-1]) + else: + print(-1) \ No newline at end of file diff --git a/solution/data_structure/1158/main.cpp b/solution/data_structure/1158/main.cpp new file mode 100644 index 0000000..a4437c2 --- /dev/null +++ b/solution/data_structure/1158/main.cpp @@ -0,0 +1,28 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/d29720a15b49470bb1ec3f405e4decdb +#include + +using namespace std; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N, K; cin >> N >> K; + queue Q; + for(int i=1;i<=N;i++) Q.push(i); + cout << "<"; + while(true) { + for(int i=1;i"; + + return 0; +} diff --git a/solution/data_structure/1158/main.py b/solution/data_structure/1158/main.py new file mode 100644 index 0000000..f6ff278 --- /dev/null +++ b/solution/data_structure/1158/main.py @@ -0,0 +1,18 @@ +# Authored by : klm03025 +# Co-authored by : - +# Link : http://boj.kr/1306fa8a1c5a4f4cab631f833d92636a +import sys +from collections import deque + +def input(): + return sys.stdin.readline().rstrip() + +N, K = map(int, input().split()) +_list = [] +q = deque([i + 1 for i in range(N)]) + +while len(q) != 0: + q.rotate(-K) + _list.append(q.pop()) + +print('<' + ', '.join(map(str, _list)) + '>') \ No newline at end of file diff --git a/solution/data_structure/18258/main.cpp b/solution/data_structure/18258/main.cpp new file mode 100644 index 0000000..41f76c1 --- /dev/null +++ b/solution/data_structure/18258/main.cpp @@ -0,0 +1,44 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/9bc206242acc4800a1f1df61d2b1b062 +#include + +using namespace std; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int T; cin >> T; + queue Q; + while(T--) { + string cmd; cin >> cmd; + if(cmd == "push") { + int X; cin >> X; + Q.push(X); + } + else if(cmd == "pop") { + if(Q.empty()) cout << -1 << '\n'; + else { + cout << Q.front() << '\n'; + Q.pop(); + } + } + else if(cmd == "size") { + cout << (int)Q.size() << '\n'; + } + else if(cmd == "empty") { + cout << Q.empty() << '\n'; + } + else if(cmd == "front") { + if(Q.empty()) cout << -1 << '\n'; + else cout << Q.front() << '\n'; + } + else if(cmd == "back") { + if(Q.empty()) cout << -1 << '\n'; + else cout << Q.back() << '\n'; + } + } + + return 0; +} diff --git a/solution/data_structure/18258/main.py b/solution/data_structure/18258/main.py new file mode 100644 index 0000000..e450d52 --- /dev/null +++ b/solution/data_structure/18258/main.py @@ -0,0 +1,37 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/6bf4491116ff480fab750a65591c134e + +import sys +from collections import deque +def input(): + return sys.stdin.readline().rstrip() + +queue = deque() +N = int(input()) +for i in range(N): + com = input().split() + if com[0] == 'push': + queue.append(com[1]) + elif com[0] == 'pop': + if queue: + print(queue.popleft()) + else: + print(-1) + elif com[0] == 'size': + print(len(queue)) + elif com[0] == 'front': + if queue: + print(queue[0]) + else: + print(-1) + elif com[0] == 'back': + if queue: + print(queue[-1]) + else: + print(-1) + elif com[0] == 'empty': + if not queue: + print(1) + else: + print(0) \ No newline at end of file diff --git a/solution/data_structure/1874/main.cpp b/solution/data_structure/1874/main.cpp new file mode 100644 index 0000000..6adcdef --- /dev/null +++ b/solution/data_structure/1874/main.cpp @@ -0,0 +1,51 @@ +// Authored by : tallua_y +// Co-authored by : +// Link : http://boj.kr/98f5daa8e3a3430cb4a5998327fd56cf +#include + +using namespace std; + +int main(int argc, char** argv) +{ + ios::sync_with_stdio(false); + cin.tie(nullptr); + + int N; + cin >> N; + + int remain = 1; + vector stack; + stack.reserve(N); + + vector answer; + answer.reserve(2 * N + 1); + + for (int n = 0; n < N; ++n) { + int current; + cin >> current; + + while (remain <= current) { + stack.push_back(remain++); + answer.push_back('+'); + answer.push_back('\n'); + } + + if (!stack.empty() && stack.back() == current) { + stack.pop_back(); + answer.push_back('-'); + answer.push_back('\n'); + } else { + answer.clear(); + answer.push_back('N'); + answer.push_back('O'); + answer.push_back('\n'); + break; + } + } + + // make c string + answer.push_back(0); + cout << answer.data(); + + return 0; +} \ No newline at end of file diff --git a/solution/data_structure/1918/main.cpp b/solution/data_structure/1918/main.cpp new file mode 100644 index 0000000..370ef3e --- /dev/null +++ b/solution/data_structure/1918/main.cpp @@ -0,0 +1,50 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/1bff0abd9f2646ceb07d7fdb4b5ace97 +#include + +using namespace std; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + string s; cin >> s; + stack st; + string answer = ""; + for(auto &ch: s) { + if('A' <= ch && ch <= 'Z') answer += ch; + else { + if(ch == '(') st.push(ch); + else if(ch == ')') { + while(!st.empty() && st.top() != '(') { + answer += st.top(); + st.pop(); + } + st.pop(); + } + else if(ch == '*' || ch == '/') { + while(!st.empty() && (st.top() == '*' || st.top() == '/')) { + answer += st.top(); + st.pop(); + } + st.push(ch); + } + else if(ch == '+' || ch == '-') { + while(!st.empty() && st.top() != '(') { + answer += st.top(); + st.pop(); + } + st.push(ch); + } + } + } + while(!st.empty()) { + answer += st.top(); + st.pop(); + } + cout << answer; + + return 0; +} + diff --git a/solution/data_structure/1935/main.py b/solution/data_structure/1935/main.py new file mode 100644 index 0000000..029df1e --- /dev/null +++ b/solution/data_structure/1935/main.py @@ -0,0 +1,45 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/db333837b5af4d84a2a5ba1dc83d2086 +import sys +from collections import deque + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +arr = input() +oper = '+-*/' +dic = {} +stack = [] +num = deque() + +for i in range(N): + num.append(int(input())) + +for i in arr: + if i not in dic and i not in oper: + dic[i] = num.popleft() + +for i in arr: + if i not in oper: + stack.append(dic[i]) + else: + if i == '+': + a = stack.pop() + b = stack.pop() + stack.append(b+a) + elif i == '-': + a = stack.pop() + b = stack.pop() + stack.append(b-a) + elif i == '*': + a = stack.pop() + b = stack.pop() + stack.append(b*a) + else: + a = stack.pop() + b = stack.pop() + stack.append(b/a) + +print(f"{stack[0]:.2f}") diff --git a/solution/data_structure/1966/main.py b/solution/data_structure/1966/main.py new file mode 100644 index 0000000..d26f441 --- /dev/null +++ b/solution/data_structure/1966/main.py @@ -0,0 +1,31 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/74b1e7adb56b425aa6644b3d2ea726e0 +import sys +from collections import deque + +def input(): + return sys.stdin.readline().rstrip() + +T = int(input()) +for i in range(T): + queue = deque() + queue2 = deque() + ct = 1 + N,M = map(int, input().split()) + arr = list(map(int, input().split())) + for j in range(len(arr)): + queue.append(arr[j]) + queue2.append(j) + while True: + if queue[0] == max(queue): + if queue2[0] == M: + print(ct) + break + else: + queue.popleft() + queue2.popleft() + ct += 1 + else: + queue.rotate(-1) + queue2.rotate(-1) \ No newline at end of file diff --git a/solution/data_structure/2164/main.cpp b/solution/data_structure/2164/main.cpp new file mode 100644 index 0000000..b2c1106 --- /dev/null +++ b/solution/data_structure/2164/main.cpp @@ -0,0 +1,23 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/cb5c5740111745b0b9f0fb6582da5bdd +#include + +using namespace std; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + queue Q; + for(int i=1;i<=N;i++) Q.push(i); + while((int)Q.size() > 1) { + Q.pop(); + Q.push(Q.front()); + Q.pop(); + } + cout << Q.front(); + + return 0; +} diff --git a/solution/data_structure/2164/main.py b/solution/data_structure/2164/main.py new file mode 100644 index 0000000..add2b7e --- /dev/null +++ b/solution/data_structure/2164/main.py @@ -0,0 +1,21 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/3ad1b45ad3db4bf7b1bfc5227e1acd12 +import sys +from collections import deque + +def input(): + return sys.stdin.readline().rstrip() + +queue = deque() +N = int(input()) +for i in range(1,N+1): + queue.append(i) + +while True: + a = queue.popleft() + if not queue: + print(a) + break + b = queue.popleft() + queue.append(b) \ No newline at end of file diff --git a/solution/data_structure/22942/main.cpp b/solution/data_structure/22942/main.cpp new file mode 100644 index 0000000..e0b57c7 --- /dev/null +++ b/solution/data_structure/22942/main.cpp @@ -0,0 +1,59 @@ +// Authored by : tallua_y +// Co-authored by : +// Link : http://boj.kr/7637094ad3f24a62939ad2b4811c9f77 +#include + +using namespace std; + +struct circle_t { + int begin; + int end; +}; + +int main(int argc, char** argv) { + ios::sync_with_stdio(false); + cin.tie(nullptr); + + size_t N; + cin >> N; + + vector circles(N); + while (N--) { + int x, r; + cin >> x >> r; + + const int begin = x - r; + const int end = x + r; + + circles[N] = {begin, end}; + } + + sort(circles.begin(), circles.end(), [](circle_t const& lhs, circle_t const& rhs) { + return lhs.begin != rhs.begin ? lhs.begin < rhs.begin : lhs.end < rhs.end; + }); + + bool is_valid = true; + vector end_stack; + for (auto const& circle : circles) { + // prune circle not ended + while (!end_stack.empty() && end_stack.back() < circle.begin) { + end_stack.pop_back(); + } + + // circle should not exist between other circle + if (!end_stack.empty() && circle.begin <= end_stack.back() && end_stack.back() <= circle.end) { + is_valid = false; + break; + } + + end_stack.push_back(circle.end); + } + + if (is_valid) { + cout << "YES\n"; + } else { + cout << "NO\n"; + } + + return 0; +} diff --git a/solution/data_structure/2346/main.py b/solution/data_structure/2346/main.py new file mode 100644 index 0000000..b03fbda --- /dev/null +++ b/solution/data_structure/2346/main.py @@ -0,0 +1,23 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/71af42c3664749e48f8f0272c3c04fd2 +import sys +from collections import deque +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +queue = deque(list(map(int, input().split()))) +queue2 = deque([i for i in range(1,N+1)]) +while queue: + q = queue[0] + if q > 0: + queue.popleft() + queue.rotate(-q+1) + print(queue2.popleft()) + queue2.rotate(-q+1) + else: + queue.popleft() + queue.rotate(-q) + print(queue2.popleft()) + queue2.rotate(-q) \ No newline at end of file diff --git a/solution/data_structure/2493/Main.java b/solution/data_structure/2493/Main.java new file mode 100644 index 0000000..c224a74 --- /dev/null +++ b/solution/data_structure/2493/Main.java @@ -0,0 +1,94 @@ +//Authored by : suin8 +//Co-authored by : - +//Link : http://boj.kr/183e8c3f134847ccb55fc85f0d072a61 + +import java.util.*; +import java.io.*; + +class Pair { + int x, y; + Pair(int x, int y){ + this.x = x; // x는 건물의 높이를 갖는다. + this.y = y; // y는 건물의 위치를 갖는다. + } + int getX() { + return x; + } + int getY() { + return y; + } +} + +public class Main { + static int[] receive = new int[500010]; //수신받는 건물 위치 저장 + static Stack stack = new Stack<>(); + + public static void main(String[] args) { + FastReader rd = new FastReader(); + + int N = rd.nextInt(); + stack.push(new Pair(rd.nextInt(), 1)); + + for(int i = 2;i <= N;i++) { + int n = rd.nextInt(); + + while(true) { + // 우선 스택이 비어있는지 확인합니다 + // 비어있으면 자신보다 높은 건물은 앞에 존재하지 않으므로 + // receive 값은 0입니다 + if(stack.isEmpty() == true) { + stack.push(new Pair(n, i)); + break; + } + // 자신보다 작은 건물들을 stack에서 pop합니다 + else if(stack.peek().getX() < n) + stack.pop(); + // stack을 보다가 자기보다 높은 건물을 발견하면 + // 그 건물의 위치를 receive에 저장하고 + // stack에 push합니다 + else { + receive[i] = stack.peek().getY(); + stack.push(new Pair(n, i)); + break; + } + } + } + + for(int i = 1;i <= N;i++) { + System.out.print(receive[i] + " "); + } + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} diff --git a/solution/data_structure/2493/main.cpp b/solution/data_structure/2493/main.cpp new file mode 100644 index 0000000..cded36a --- /dev/null +++ b/solution/data_structure/2493/main.cpp @@ -0,0 +1,24 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/b2e3a3c79d3f4e219827c39174c3238f +#include + +using namespace std; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + stack> st; + + st.emplace(100000005, 0); + for(int i=1;i<=N;i++) { + int x; cin >> x; + while(!st.empty() && st.top().first < x) st.pop(); + cout << st.top().second << ' '; + st.emplace(x, i); + } + + return 0; +} diff --git a/solution/data_structure/2504/main.cpp b/solution/data_structure/2504/main.cpp new file mode 100644 index 0000000..49a1186 --- /dev/null +++ b/solution/data_structure/2504/main.cpp @@ -0,0 +1,52 @@ +// Authored by : tallua_y +// Co-authored by : +// Link : http://boj.kr/48252863d9ae4860b54cfceb442110ba +#include + +using namespace std; + +struct Token { + int value; + size_t pos; +}; + +int main(int argc, char** argv) +{ + ios::sync_with_stdio(false); + cin.tie(nullptr); + + string input; + cin >> input; + + vector tokens; + tokens.push_back({ 0, '$' }); + for (size_t head = 0; head < input.size(); ++head) { + if (input[head] == '(' || input[head] == '[') { + tokens.push_back({ 0, head }); + } else { + const auto open_tag = (input[head] == ')' ? '(' : '['); + if (tokens.empty() || input[tokens.back().pos] != open_tag) { + tokens.clear(); + break; + } + + Token token = tokens.back(); + tokens.pop_back(); + + const auto designated_value = (input[head] == ')' ? 2 : 3); + if (token.pos + 1 == head) { + tokens.back().value += designated_value; + } else { + tokens.back().value += token.value * designated_value; + } + } + } + + if (tokens.size() != 1) { + cout << "0\n"; + } else { + cout << tokens.back().value << '\n'; + } + + return 0; +} \ No newline at end of file diff --git a/solution/data_structure/2504/main.py b/solution/data_structure/2504/main.py new file mode 100644 index 0000000..f012a21 --- /dev/null +++ b/solution/data_structure/2504/main.py @@ -0,0 +1,67 @@ +# Authored by : tony9402 +# Co-authored by : - +# Link : http://boj.kr/a35de756ecf642b6b2e116f14ffd6093 + +import sys +def input(): + return sys.stdin.readline().rstrip() + +s = input() +stack = [] + +# Check Bracket +for ch in s: + if ch == '(': + stack.append('(') + elif ch == '[': + stack.append('[') + elif ch == ')': + if stack and stack[-1] == '(': + stack.pop(-1) + else: + print(0) + exit(0) + else: + if stack and stack[-1] == '[': + stack.pop(-1) + else: + print(0) + exit(0) + +if stack: + print(0) + exit(0) + +# [open bracket] + Integer + Integer => [open bracket] + Integer +# compress (add) Integers +def compress(): + # Integer를 하나로 합쳐야 하니깐 길이가 2 이상이어야 함. + while len(stack) > 1: + # 두 개의 값이 무조건 Integer이어야 하므로 + # Integer면 첫번째 원소가 None으로 되어 있음 + a, integer1 = stack[-1] + b, integer2 = stack[-2] + if a or b: + break + stack.pop() + stack.pop() + stack.append((None, integer1 + integer2)) + +for ch in s: + # open bracket -> append ( open bracket, ~ ) + if ch == '(': + stack.append(('(', 2)) + elif ch == '[': + stack.append(('[', 3)) + elif ch == ')' or ch == ']': # Must Be len(stack) ≥ 1 + last1, last2 = stack.pop() + # Case 1 : ~~ open bracket + if last1 != None: + stack.append((None, last2)) + # Case 2 : ~~ open bracket, Integer, + else: + a, b = stack.pop() + stack.append((None, last2 * b)) + compress() + +print(stack[-1][1]) diff --git a/solution/data_structure/2800/Main.java b/solution/data_structure/2800/Main.java new file mode 100644 index 0000000..53f2d2e --- /dev/null +++ b/solution/data_structure/2800/Main.java @@ -0,0 +1,112 @@ +// Authored by : kyj1991719 +// Co-authored by : - +// Link : http://boj.kr/cb80d90792224a2395fc61cfe30f53b6 + +import java.util.*; +import java.lang.*; +import java.io.*; + +public class Main { + private static List bracketList = new ArrayList<>(); + private static List eqList = new ArrayList<>(); + private static String input; + + public static void main(String[] args) { + FastReader rd = new FastReader(); + + input = rd.nextLine(); + Stack startStack = new Stack<>(); + for(int i = 0; i < input.length(); i++) { + if(input.charAt(i) == '(') startStack.add(i); + if(input.charAt(i) == ')') bracketList.add(new Bracket(startStack.pop(), i)); + } + + for(int i = 0; i < bracketList.size(); i++) { + boolean[] removedArr = new boolean[input.length()]; + removedArr[bracketList.get(i).start] = true; + removedArr[bracketList.get(i).end] = true; + solve(i, removedArr); + } + + List distinctList = new ArrayList<>(new HashSet<>(eqList)); + distinctList.sort((o1, o2) -> o1.compareTo(o2)); + StringBuilder sb = new StringBuilder(); + for(String tmp : distinctList) { + sb.append(tmp); + sb.append("\n"); + } + System.out.print(sb.toString()); + } + + private static void solve(int idx, boolean[] removedArr) { + if(idx == bracketList.size()) { + addEq(removedArr); + return; + } + + for(int i = idx+1; i < bracketList.size(); i++) { + Bracket bracket = bracketList.get(i); + + removedArr[bracket.start] = true; + removedArr[bracket.end] = true; + solve(i, removedArr); + removedArr[bracket.start] = false; + removedArr[bracket.end] = false; + } + + solve(idx+1, removedArr); + } + + private static void addEq(boolean[] removedArr) { + StringBuilder sb = new StringBuilder(); + for(int i = 0; i < input.length(); i++) { + if(removedArr[i]) continue; + sb.append(input.charAt(i)); + } + eqList.add(sb.toString()); + } + + + static class Bracket { + int start, end; + public Bracket(int start, int end) { + this.start = start; + this.end = end; + } + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + long nextLong() { return Long.parseLong(next()); } + double nextDouble() { return Double.parseDouble(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} diff --git a/solution/data_structure/2800/main.py b/solution/data_structure/2800/main.py new file mode 100644 index 0000000..fbecdbd --- /dev/null +++ b/solution/data_structure/2800/main.py @@ -0,0 +1,57 @@ +# Authored by : tony9402 +# Co-authored by : - +# Link : http://boj.kr/9908832547364dfd87342eb0a2a873ce +import sys + +def input(): + return sys.stdin.readline().rstrip() + +s = input() +N = len(s) + +index = [ -1 for _ in range(N) ] +stack = [] +current_index = 0 + +# 올바른 괄호만 주어진다. 각 괄호 쌍에 차례대로 index를 붙여주고 기록하자. +for idx, ch in enumerate(s): + if ch == '(': + stack.append(current_index) + index[idx] = current_index + current_index += 1 + elif ch == ')': + index[idx] = stack.pop() + +# 각 괄호에 번호를 기록해놨다. 이제 재귀를 돌아 괄호쌍을 뽑자. +answer = [] # 가능한 모든 것을 저장 후 정렬 후 출력하기 위해 사용 + +# current_index ==> bracket count +choose = [ 0 for _ in range(current_index) ] + +# cnt -> bracket index 번호 +def func(cnt): + if cnt == current_index: + erase_bracket_count = sum(choose) + if erase_bracket_count == 0: + return + + string = "" + for idx, ch in enumerate(s): + # index[idx] == -1 인 경우 (괄호가 아니므로 추가) + # 만약 -1이면 뒤에 조건문이 실행 안됨 + if index[idx] == -1 or choose[index[idx]] == 0: + string += ch + + answer.append(string) + return + + choose[cnt] = 1 # 해당 괄호쌍을 지운 경우 + func(cnt + 1) + choose[cnt] = 0 # 해당 괄호쌍을 지우지 않은 경우 + func(cnt + 1) + +# Run +func(0) +# 정답 중에 중복이 있을 수 있기 때문에 중복 제거 +answer = sorted(set(answer)) +print('\n'.join(answer)) diff --git a/solution/data_structure/3986/main.py b/solution/data_structure/3986/main.py new file mode 100644 index 0000000..2e1d532 --- /dev/null +++ b/solution/data_structure/3986/main.py @@ -0,0 +1,24 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/25fcff12eee34fb6a0f0d4023cac4e4d +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +ans = 0 +for i in range(N): + stack = [] + a = input() + for i in a: + if not stack: + stack.append(i) + else: + if stack[-1] == i: + stack.pop() + else: + stack.append(i) + if not stack: + ans += 1 +print(ans) \ No newline at end of file diff --git a/solution/data_structure/5397/main.py b/solution/data_structure/5397/main.py new file mode 100644 index 0000000..4b8c97d --- /dev/null +++ b/solution/data_structure/5397/main.py @@ -0,0 +1,28 @@ +# // Authored by : chj3748 +# // Co-authored by : - +# // Link : http://boj.kr/471d69f455a544769c6c2fa7199442d1 +import sys +from collections import deque + +def input(): + return sys.stdin.readline().rstrip() + +T = int(input()) +for test in range(T): + answer_l = deque() + answer_r = deque() + for string in input(): + if string == '<': + if answer_l: + temp = answer_l.pop() + answer_r.appendleft(temp) + elif string == '>': + if answer_r: + temp = answer_r.popleft() + answer_l.append(temp) + elif string == '-': + if answer_l: + answer_l.pop() + else: + answer_l.append(string) + print(''.join(answer_l + answer_r)) diff --git a/solution/data_structure/5430/Main.java b/solution/data_structure/5430/Main.java new file mode 100644 index 0000000..5641229 --- /dev/null +++ b/solution/data_structure/5430/Main.java @@ -0,0 +1,137 @@ +//Authored by : suin8 +//Co-authored by : - +//Link : http://boj.kr/fc75d4683aa44fd5be618ed3934ac634 + +/* +시간이 빡빡해서 실제로 뒤집기, 삭제하기를 구현하면 안됩니다. +뒤집기는 실제로 뒤집는 것이 아닌 앞에서 뒤로 읽는걸 뒤에서 앞으로 읽게 하였고 +삭제하기는 실제 삭제가 아닌 front포인터를 하나 증가시키는 식으로 구현했습니다. +출력도 빠른 출력을 해야 시간초과가 나지 않습니다. +*/ + +import java.util.*; +import java.io.*; + +public class Main { + static ArrayList numlist = new ArrayList(); + static boolean reverse = false; + static int front, end; + static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); + + public static void main(String[] args) throws IOException { + FastReader rd = new FastReader(); + + int T = rd.nextInt(); + + for(int i = 0;i < T;i++) { + String p = rd.nextLine(); + int n = rd.nextInt(); + + // inputString => tokenizer로 구분자 제거 후 list에 삽입 + InputString(rd.nextLine()); + + boolean error = false; + for(int j = 0;j < p.length();j++) { + if(p.charAt(j) == 'R') + ReverseList(); // ListReverse => 뒤집기 + + else { + if(front > end) { + // 에러상황 + // front가 end보다 큰 상황은 + // front == end == 1 인 상황(list에 값이 하나)에서 + // 하나를 지운 후 상황이다. 즉 지울 것이 없는 상태 + bw.write("error\n"); + bw.flush(); + error = true; + break; + } + else // 지울 수 있는 문자가 있을 때 + DeleteList(); // DeleteList => 0번 인덱스 삭제 + } + } + if(error == false) OutputList(); + + numlist.clear(); + reverse = false; + } + bw.close(); + } + + static void OutputList() throws IOException{ + bw.write("["); + // reverse가 false면 정상상태 => 앞(front) 뒤(end)방향으로 출력 + if(reverse == false) { + for(int i = front;i <= end;i++) { + if(i == end) bw.write(numlist.get(i)); + else bw.write(numlist.get(i) + ","); + } + } + // reverse가 true면 뒤집힌 상태 => 뒤(end) 앞(front)방향으로 출력 + else { + for(int i = end;i >= front;i--) + if(i == front) bw.write(numlist.get(i)); + else bw.write(numlist.get(i) + ","); + } + bw.write("]\n"); + bw.flush(); + } + + static void DeleteList() { + // 실제로 지우는 것이 아닌 가리키는 인덱스를 증가 또는 감소시킴 + // 정상 상태이면 앞 인덱스를 증가(앞을 삭제하게 되므로) + // 뒤집힌 상태이면 뒤 인덱스를 감소(뒤가 가장 앞이 되므로) + if(reverse == false) front++; + else end--; + } + + static void ReverseList() { + // 실제로 뒤집는 것이 아닌 뒤집혀있는지 아닌지만 판단 + // 후에 출력할때 출력 순서를 바꾼다 + if(reverse == true) reverse = false; + else reverse = true; + } + + static void InputString(String numstr) { + StringTokenizer st = new StringTokenizer(numstr, "[ | , | ]"); + + while(st.hasMoreTokens()) + numlist.add(st.nextToken()); + + front = 0; + end = numlist.size() - 1; + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} diff --git a/solution/data_structure/5430/main.py b/solution/data_structure/5430/main.py new file mode 100644 index 0000000..3aa9e60 --- /dev/null +++ b/solution/data_structure/5430/main.py @@ -0,0 +1,34 @@ +# Authored by : cieske +# Co-authored by : - +# Link : http://boj.kr/cc59c57fb1534ac4831b7f44f87831be + +import sys +def input(): + return sys.stdin.readline().rstrip() + +t = int(input()) +for _ in range(t): + oper = str(input()) + n = int(input()) + lst = str(input())[1:-1].split(',') + if not lst[0].isdigit(): + lst = [] #빈 list가 들어올 경우 따로 처리 + + l_p, r_p, front = 0, len(lst), True + for p in oper: + if p == 'R': #D operation이 일어날 위치 설정 + front = not front + else: #D operation 수행 + if front: #앞에서 제거 + l_p += 1 + else: #뒤에서 제거 + r_p -= 1 + if l_p > r_p: #지울 수 없는데 지운 경우 + print('error') + break + if l_p <= r_p: + if front: + sol = lst[l_p:r_p] + else: + sol = list(reversed(lst[l_p:r_p])) + print('['+','.join(sol)+']') #출력 형식 맞추기 \ No newline at end of file diff --git a/solution/data_structure/9012/main.cpp b/solution/data_structure/9012/main.cpp new file mode 100644 index 0000000..3c9873b --- /dev/null +++ b/solution/data_structure/9012/main.cpp @@ -0,0 +1,33 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/553d0936c1674183a249a58070467343 +#include + +using namespace std; + +string solve(string str) { + stack st; + for(int i=0;i<(int)str.size();i++){ + if(str[i] == '(') st.push('('); + else { + if(st.empty()) return "NO"; + st.pop(); + } + } + + if(st.empty()) return "YES"; + return "NO"; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int T; cin >> T; + while(T--) { + string s; cin >> s; + cout << solve(s) << '\n'; + } + + return 0; +} diff --git a/solution/data_structure/9012/main.py b/solution/data_structure/9012/main.py new file mode 100644 index 0000000..9ced5fe --- /dev/null +++ b/solution/data_structure/9012/main.py @@ -0,0 +1,23 @@ +# Authored by : klm03025 +# Co-authored by : - +# Link : http://boj.kr/b57f1dad96a946e48e0679872d97d024 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +result = "" + +for i in range(N): + testcase = input() + cnt = 0 + for c in testcase: + cnt += 1 if c == '(' else -1 + if cnt < 0: + result += "NO\n" + break + else: + result += "YES\n" if cnt == 0 else "NO\n" + +print(result) \ No newline at end of file diff --git a/solution/data_structure2/10546/main.py b/solution/data_structure2/10546/main.py new file mode 100644 index 0000000..c9388d4 --- /dev/null +++ b/solution/data_structure2/10546/main.py @@ -0,0 +1,21 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/bb59bafb8ef04d69a5ab5ade6d7cfeb9 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +dic = {} +for i in range(N): + name = input() + dic[name] = dic.get(name, 0) + 1 + +for i in range(N-1): + name = input() + dic[name] -= 1 + +dic_list = list(dic.items()) +dic_list.sort(key = lambda x : (-x[1], x[0])) +print(dic_list[0][0]) diff --git a/solution/data_structure2/11279/main.cpp b/solution/data_structure2/11279/main.cpp new file mode 100644 index 0000000..0d96b7f --- /dev/null +++ b/solution/data_structure2/11279/main.cpp @@ -0,0 +1,29 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/53d07a6885b1412d93b53a1fe211e153 +#include + +using namespace std; + +priority_queue pq; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + pq.push(0); + for(int i=0;i> x; + if(x == 0) { + if(pq.empty()) cout << 0 << '\n'; + else { + cout << pq.top() << '\n'; + pq.pop(); + } + } + else pq.push(x); + } + + return 0; +} diff --git a/solution/data_structure2/11279/main.py b/solution/data_structure2/11279/main.py new file mode 100644 index 0000000..d725a5f --- /dev/null +++ b/solution/data_structure2/11279/main.py @@ -0,0 +1,19 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/2b2600bda1c447b7b7f2c2399b167716 +import sys +import heapq + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +heap = [] +for i in range(N): + a = int(input()) + if a == 0: + if heap: + print(-heapq.heappop(heap)) + else: + print(0) + heapq.heappush(heap, -a) \ No newline at end of file diff --git a/solution/data_structure2/11286/main.cpp b/solution/data_structure2/11286/main.cpp new file mode 100644 index 0000000..addcb1d --- /dev/null +++ b/solution/data_structure2/11286/main.cpp @@ -0,0 +1,28 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/3866a743ca954b6fa27922ed08da2b5e +#include + +using namespace std; + +priority_queue, vector>, greater>> pq; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + for(int i=0;i> x; + if(x == 0) { + if(pq.empty()) cout << 0 << '\n'; + else { + cout << pq.top().second << '\n'; + pq.pop(); + } + } + else pq.emplace(abs(x), x); + } + + return 0; +} diff --git a/solution/data_structure2/11286/main.py b/solution/data_structure2/11286/main.py new file mode 100644 index 0000000..4bb9089 --- /dev/null +++ b/solution/data_structure2/11286/main.py @@ -0,0 +1,20 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/29a558ec778348f589fad5c627187638 +import sys +import heapq + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +heap = [] +for i in range(N): + x = int(input()) + if x == 0: + if heap: + print(heapq.heappop(heap)[1]) + else: + print(0) + else: + heapq.heappush(heap, [abs(x), x]) \ No newline at end of file diff --git a/solution/data_structure2/1269/main.py b/solution/data_structure2/1269/main.py new file mode 100644 index 0000000..06cae3d --- /dev/null +++ b/solution/data_structure2/1269/main.py @@ -0,0 +1,23 @@ +# Authored by : chj3748 +# Co-authored by : - +# Link : http://boj.kr/73b320e09628425c8d29b3c81287a865 +import sys +from collections import defaultdict + +def input(): + return sys.stdin.readline().rstrip() + +len_a, len_b = map(int, input().split()) +dict_a = defaultdict(int) + +for number in map(int, input().split()): + dict_a[number] = 1 + +cnt = 0 + +for number in map(int, input().split()): + if dict_a[number]: + cnt += 1 + +answer = (len_a - cnt) + (len_b - cnt) +print(answer) \ No newline at end of file diff --git a/solution/data_structure2/1302/main.py b/solution/data_structure2/1302/main.py new file mode 100644 index 0000000..a1311c3 --- /dev/null +++ b/solution/data_structure2/1302/main.py @@ -0,0 +1,20 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/8adc986ae26b461eadd65abdff3cfba9 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +book = {} +for i in range(N): + name = input() + if name not in book: + book[name] = 1 + else: + book[name] += 1 + +book = list(book.items()) +book.sort(key = lambda x : (-x[1],x[0])) +print(book[0][0]) diff --git a/solution/data_structure2/14425/main.cpp b/solution/data_structure2/14425/main.cpp new file mode 100644 index 0000000..8071a9f --- /dev/null +++ b/solution/data_structure2/14425/main.cpp @@ -0,0 +1,28 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/c8831b4a36e741ddb4ae083cc32902ef +#include + +using namespace std; + +unordered_set st; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N, M; cin >> N >> M; + for(int i=0;i> s; + st.insert(s); + } + + int answer = 0; + for(int i=0;i> s; + if(st.find(s) != st.end()) answer ++; + } + cout << answer; + + return 0; +} diff --git a/solution/data_structure2/14425/main.py b/solution/data_structure2/14425/main.py new file mode 100644 index 0000000..b3ced75 --- /dev/null +++ b/solution/data_structure2/14425/main.py @@ -0,0 +1,20 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/efd53a96cfd04ca9ab21018162c3084d +import sys +from collections import deque + +def input(): + return sys.stdin.readline().rstrip() + +N, M = map(int, input().split()) +ans = 0 +dic = {} +for i in range(N): + a = input() + dic[a] = 1 +for i in range(M): + a = input() + if a in dic: + ans += 1 +print(ans) \ No newline at end of file diff --git a/solution/data_structure2/1620/main.cpp b/solution/data_structure2/1620/main.cpp new file mode 100644 index 0000000..ffac986 --- /dev/null +++ b/solution/data_structure2/1620/main.cpp @@ -0,0 +1,34 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/9289c0621c6f41dabd5bfc2ba190a2ce +#include + +using namespace std; + +unordered_map pokemon; +unordered_map pokemonSeq; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N, Q; cin >> N >> Q; + for(int i=1;i<=N;i++){ + string s; cin >> s; + string idx = to_string(i); + pokemon[s] = idx; + pokemonSeq[idx] = s; + } + + while(Q--) { + string s; cin >> s; + if(isdigit(s[0])) { + cout << pokemonSeq[s] << '\n'; + } + else { + cout << pokemon[s] << '\n'; + } + } + + return 0; +} diff --git a/solution/data_structure2/1927/main.py b/solution/data_structure2/1927/main.py new file mode 100644 index 0000000..e479a03 --- /dev/null +++ b/solution/data_structure2/1927/main.py @@ -0,0 +1,21 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/5d73f6bad59b42a58688435c855b9580 +import sys +import heapq + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +heap = [] + +for i in range(N): + x = int(input()) + if x == 0: + if not heap: + print(0) + else: + print(heapq.heappop(heap)) + else: + heapq.heappush(heap,x) diff --git a/solution/data_structure2/2075/main.cpp b/solution/data_structure2/2075/main.cpp new file mode 100644 index 0000000..025539a --- /dev/null +++ b/solution/data_structure2/2075/main.cpp @@ -0,0 +1,25 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/9d0a68ae0d4349238f376383cbaf13e0 +#include + +using namespace std; + +priority_queue, greater> pq; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + for(int i=0;i> x; + pq.push(x); + if((int)pq.size() > N) pq.pop(); + } + } + cout << pq.top(); + + return 0; +} diff --git a/solution/data_structure2/21939/Main.java b/solution/data_structure2/21939/Main.java new file mode 100644 index 0000000..b7bcfb2 --- /dev/null +++ b/solution/data_structure2/21939/Main.java @@ -0,0 +1,105 @@ +//Authored by : suin8 +//Co-authored by : - +//Link : http://boj.kr/2e98c8f8a8b54b428eb5bc4a00e17491 + +import java.util.*; +import java.io.*; + +class Problem implements Comparable { + int num, level; + Problem(int num, int level){ + this.num = num; + this.level = level; + } + // 난이도로 내림차순 정렬을 먼저 한 뒤 + // 같은 난이도에 대해서는 문제번호로 내림차순 정렬 + @Override + public int compareTo(Problem op) { + if(level < op.level) return 1; + else if(level == op.level) { + if(num < op.num) return 1; + else if(num == op.num) return 0; + else return -1; + } + else return -1; + } +} + +public class Main { + static TreeSet tset = new TreeSet(); + static int[] problem = new int[100010]; + public static void main(String[] args) { + FastReader rd = new FastReader(); + int N = rd.nextInt(); + + // problem 배열에서 문제번호와 난이도를 저장하고 + // TreeSet을 이용하여 난이도, 문제번호 순으로 정렬합니다. + for(int i = 0;i < N;i++) { + int num = rd.nextInt(); + int lev = rd.nextInt(); + tset.add(new Problem(num, lev)); + problem[num] = lev; + } + + int M = rd.nextInt(); + for(int i = 0;i < M;i++) { + String command = rd.next(); + + // "add" 명령시 TreeSet과 problem 배열에 추가 + if(command.equals("add")) { + int num = rd.nextInt(); + int lev = rd.nextInt(); + tset.add(new Problem(num, lev)); + problem[num] = lev; + } + // "solved" 명령시 입력받은 문제번호와 + // 저장해놓은 문제번호의 난이도를 배열에서 찾은 후 + // TreeSet에서 삭제합니다. + else if(command.equals("solved")) { + int num = rd.nextInt(); + tset.remove(new Problem(num, problem[num])); + } + // recommend 1 은 가장 어렵고 큰 번호 이므로 첫 번째 값 + // recommend 2 는 가장 쉽고 작은 번호 이므로 마지막 값 + else { + int n = rd.nextInt(); + if(n == 1) + System.out.println(tset.first().num); + else + System.out.println(tset.last().num); + } + } + } + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} diff --git a/solution/data_structure2/21942/main.py b/solution/data_structure2/21942/main.py new file mode 100644 index 0000000..caf6768 --- /dev/null +++ b/solution/data_structure2/21942/main.py @@ -0,0 +1,59 @@ +# Authored by : yj2221 +# Co-authored by : - +# Link : http://boj.kr/16de6b69c0ca419a908289ee440a407a + +import sys + +def input(): + return sys.stdin.readline().rstrip() + +def calculate_days_per_month(): + month_days = {1: 31, 2: 28, 3: 31, 4: 30, 5: 31, 6: 30, 7: 31, 8: 31, 9: 30, 10: 31, 11: 30, 12: 31} + days = [0] + for month, day in month_days.items(): + days.append(days[month-1] + day) + return days + +month_days = calculate_days_per_month() + +def change_str(_str): + date, time, item, person = _str.split() + _, month, day = map(int, date.split('-')) # 년도 필요없음 + hour, minute = map(int, time.split(':')) + return person, item, (month_days[month-1] + day) * 24 * 60 + hour * 60 + minute + +def solution(info, deadline_time, F): + dic = {} + people = {} # 벌금 낼 사람들 + for data in info: + result = -1 + person, item, time = change_str(data) + if person not in dic: + dic[person] = {} + if item in dic[person]: + result = time - dic[person].pop(item) + else: + dic[person][item] = time + if result > deadline_time: + if person not in people: + people[person] = 0 + people[person] += (result - deadline_time) * F + if people: + people = sorted(people.items(), key = lambda x: x[0]) + for person, pay in people: + print('{} {}'.format(person, pay)) + else: + print(-1) + +N, L, F = input().split() +N, F = int(N), int(F) +day, time = L.split('/') +day = int(day) +hour, minute = map(int, time.split(':')) +deadline_time = day*24*60 + hour*60 + minute +info = [] +for _ in range(N): + _str = input() + info.append(_str) + +solution(info, deadline_time, F) diff --git a/solution/data_structure2/2696/main.cpp b/solution/data_structure2/2696/main.cpp new file mode 100644 index 0000000..9dd7141 --- /dev/null +++ b/solution/data_structure2/2696/main.cpp @@ -0,0 +1,52 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/c5acf6a6a2f24b4ca0c415fbe1947571 +#include + +using namespace std; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int t; cin >> t; + while(t--) { + int n; cin >> n; + priority_queue L; + priority_queue, greater> R; + vector answer; + for(int i=0;i> x; + R.push(x); + + while(L.size() < R.size()) { + L.push(R.top()); + R.pop(); + } + while(L.size() > R.size() + 1) { + R.push(L.top()); + L.pop(); + } + while(!L.empty() || !R.empty()) { + int valueL = L.top(); + int valueR = R.top(); + if(valueL <= valueR) break; + L.pop(); + R.pop(); + L.push(valueR); + R.push(valueL); + } + + if(i % 2 == 0) answer.push_back(L.top()); + } + cout << answer.size() << '\n'; + for(int i=0;i<(int)answer.size();i++) { + cout << answer[i]; + if(i + 1 != (int)answer.size() && (i + 1) % 10 == 0) cout << '\n'; + else cout << ' '; + } + cout << '\n'; + } + + return 0; +} diff --git a/solution/data_structure2/4358/main.cpp b/solution/data_structure2/4358/main.cpp new file mode 100644 index 0000000..2a05f1f --- /dev/null +++ b/solution/data_structure2/4358/main.cpp @@ -0,0 +1,28 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/8af3200059e848aaa9c06901b34bcef7 +#include + +using namespace std; + +map mp; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + string s; + int total = 0; + while(getline(cin, s)) { + mp[s] += 1; + total += 1; + } + + cout.precision(4); + cout << fixed; + for(auto &[k, v]: mp) { + cout << k << ' ' << v * 100.0 / total << '\n'; + } + + return 0; +} diff --git a/solution/data_structure2/7662/main.cpp b/solution/data_structure2/7662/main.cpp new file mode 100644 index 0000000..c15acc0 --- /dev/null +++ b/solution/data_structure2/7662/main.cpp @@ -0,0 +1,48 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/3a213ad379ca457c87e01e73a8ddf8b2 +#include + +using namespace std; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int t; cin >> t; + while(t--) { + map mp; + int n; cin >> n; + for(int i=0;i> cmd; + int x;cin >> x; + + if(cmd == 'I') { + mp[x] += 1; + } + else { + if(mp.empty()) continue; + if(x == -1) { + if(mp.begin()->second == 1) { + mp.erase(mp.begin()->first); + } + else { + mp.begin()->second --; + } + } + else { + if(mp.rbegin()->second == 1) { + mp.erase(mp.rbegin()->first); + } + else { + mp.rbegin()->second --; + } + } + } + } + if(mp.empty()) cout << "EMPTY\n"; + else cout << mp.rbegin()->first << ' ' << mp.begin()->first << '\n'; + } + + return 0; +} diff --git a/solution/data_structure2/7662/main.py b/solution/data_structure2/7662/main.py new file mode 100644 index 0000000..aa2fcc6 --- /dev/null +++ b/solution/data_structure2/7662/main.py @@ -0,0 +1,50 @@ +# Authored by : chj3748 +# Co-authored by : - +# Link : http://boj.kr/2eb814a8afac4ceab99cbb89db78a2c6 +import sys +import heapq +from collections import defaultdict + +def input(): + return sys.stdin.readline().rstrip() + +for T in range(int(input())): + max_q = [] + min_q = [] + total_ele_cnt = 0 + elements_cnt = defaultdict(int) + for _ in range(int(input())): + operator, number = input().split() + if operator == 'I': + number = int(number) + heapq.heappush(max_q, -number) + heapq.heappush(min_q, number) + elements_cnt[number] += 1 + total_ele_cnt += 1 + else: + if total_ele_cnt > 0: + if number == '1': + while True: + del_num = -heapq.heappop(max_q) + if elements_cnt[del_num] != 0: + elements_cnt[del_num] -= 1 + break + else: + while True: + del_num = heapq.heappop(min_q) + if elements_cnt[del_num] != 0: + elements_cnt[del_num] -= 1 + break + total_ele_cnt -= 1 + if total_ele_cnt: + while True: + max_v = -heapq.heappop(max_q) + if elements_cnt[max_v] != 0: + break + while True: + min_v = heapq.heappop(min_q) + if elements_cnt[min_v] != 0: + break + print(max_v, min_v) + else: + print('EMPTY') \ No newline at end of file diff --git a/solution/disjoint_set/1043/main.cpp b/solution/disjoint_set/1043/main.cpp new file mode 100644 index 0000000..d9b4770 --- /dev/null +++ b/solution/disjoint_set/1043/main.cpp @@ -0,0 +1,65 @@ +// Authored by : xhdxhl +// Co-authored by : - +// Link : http://boj.kr/d4f08f292aed46729e98bea45c026da6 + +#include +using namespace std; + +int n, m, k, parent[51]; + +vector know; +vector > v(51); + +int find(int x) { + if (parent[x] == x) return x; + return parent[x] = find(parent[x]); +} + +void merge(int x, int y) { + x = find(x); + y = find(y); + parent[x] = y; +} + +int main(void) { + ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); + + cin >> n >> m >> k; + + while (k--) { + int t; + cin >> t; + know.push_back(t); + } + + for (int i = 1; i <= n; i++) parent[i] = i; + + for (int i = 0; i < m; i++) { + int p, num, prev; + cin >> p; + for (int j = 0; j < p; j++) { + if (j >= 1) { + prev = num; + cin >> num; + merge(prev, num); + } + else cin >> num; + v[i].push_back(num); + } + } + + for (auto& list : v) { + bool flag = false; + for (auto& person : list) { + for (auto& t : know) { + if (find(person) == find(t)) { + flag = true; + break; + } + } + if (flag) break; + } + if(flag) m--; + } + cout << m; +} diff --git a/solution/disjoint_set/10775/main.cpp b/solution/disjoint_set/10775/main.cpp new file mode 100644 index 0000000..c742c33 --- /dev/null +++ b/solution/disjoint_set/10775/main.cpp @@ -0,0 +1,41 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/f71cbcd7b21940189fe6db7f99852f09 +#include + +using namespace std; + +constexpr int MAXN = 100005; +int uf[MAXN]; + +int find(int x) { + if(uf[x] < 0) return x; + return uf[x] = find(uf[x]); +} + +bool merge(int a, int b){ + a = find(a); + b = find(b); + if(a == b)return false; + uf[b] = a; + return true; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N, M; cin >> N >> M; + for(int i=0;i<=N;i++) uf[i] = -1; + int answer = 0; + for(int i=0;i> x; + int cur = find(x); + if(cur == 0) break; + merge(cur - 1, cur); + answer ++; + } + cout << answer; + + return 0; +} diff --git a/solution/disjoint_set/10775/main.py b/solution/disjoint_set/10775/main.py new file mode 100644 index 0000000..00a2981 --- /dev/null +++ b/solution/disjoint_set/10775/main.py @@ -0,0 +1,27 @@ +# Authored by : chj3748 +# Co-authored by : - +# Link : http://boj.kr/30c745d5f3c547c28e95b5c9a76647c1 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +G = int(input()) +P = int(input()) +gates = list(range(G + 1)) + +def find_max(x): + if gates[x] != x: + gates[x] = find_max(gates[x]) + return gates[x] + +answer = 0 +for _ in range(P): + plane = int(input()) + gate_n = find_max(plane) + if gate_n == 0: + print(answer) + sys.exit(0) + answer += 1 + gates[gate_n] = gates[gate_n - 1] +print(answer) diff --git a/solution/disjoint_set/16562/main.cpp b/solution/disjoint_set/16562/main.cpp new file mode 100644 index 0000000..601c76c --- /dev/null +++ b/solution/disjoint_set/16562/main.cpp @@ -0,0 +1,44 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/caef773ebb994d6e854c390d5fe22057 +#include + +using namespace std; + +int uf[10101], arr[10101]; + +int find(int x) { + if(uf[x] < 0) return x; + return uf[x] = find(uf[x]); +} + +bool merge(int a, int b) { + a = find(a); + b = find(b); + if(a == b) return false; + uf[b] = a; + arr[a] = min(arr[a], arr[b]); + arr[b] = 0; + return true; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int n, m, k; cin >> n >> m >> k; + for(int i=1;i<=n;i++) { + uf[i] = -1; + cin >> arr[i]; + } + for(int i=0;i> a >> b; + merge(a, b); + } + int answer = 0; + for(int i=1;i<=n;i++) answer += arr[i]; + if(answer > k) cout << "Oh no"; + else cout << answer; + + return 0; +} diff --git a/solution/disjoint_set/1717/main.cpp b/solution/disjoint_set/1717/main.cpp new file mode 100644 index 0000000..6e5ff20 --- /dev/null +++ b/solution/disjoint_set/1717/main.cpp @@ -0,0 +1,39 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/681761d952b14fd58d55c93eaf11c0ef +#include + +using namespace std; + +int uf[1000005]; + +int find(int x) { + if(uf[x] < 0) return x; + return uf[x] = find(uf[x]); +} + +bool merge(int a, int b) { + a = find(a); + b = find(b); + if(a == b)return false; + uf[b] = a; + return true; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N, M; cin >> N >> M; + for(int i=0;i<=N;i++) uf[i] = -1; + for(int i=0;i> t >> a >> b; + if(t == 1) { + if(find(a) == find(b)) cout << "YES\n"; + else cout << "NO\n"; + } + else merge(a, b); + } + + return 0; +} diff --git a/solution/disjoint_set/1717/main.py b/solution/disjoint_set/1717/main.py new file mode 100644 index 0000000..f3e5181 --- /dev/null +++ b/solution/disjoint_set/1717/main.py @@ -0,0 +1,43 @@ +# Authored by : cieske +# Co-authored by : - +# Link : http://boj.kr/69e732906ee9469bbd233ff0ed09bafb + +import sys +def input(): + return sys.stdin.readline().rstrip() + +n, m = map(int, input().split()) +dis_set = [-1]*(n+1) + +#Disjoint set 관련 함수 +def upward(x, update_lst): + if dis_set[x] < 0: # 해당 disjoint set의 최상단 root를 찾음 + return x + # x가 root가 아니라면 update_lst에 추가하고 root를 찾아감 + update_lst.append(x) + return upward(dis_set[x], update_lst) + +def find(x): + update_lst = [] # x가 속한 disjoint set에서 path compression을 위해 root update가 필요한 node set + root = upward(x, update_lst) # x가 속한 disjoint set의 root + for idx in update_lst: # Path compression + dis_set[idx] = root + return root + +def union(x, y): + x_root = find(x) + y_root = find(y) + if x_root != y_root: #두 node의 root가 다르다면 -> 합쳐야 함 + dis_set[y_root] = x_root + + +for _ in range(m): + oper, x, y = map(int, input().split()) + if oper: # Check + if find(x) == find(y): + print("YES") + else: + print("NO") + + else: # Union + union(x, y) diff --git a/solution/disjoint_set/17352/main.cpp b/solution/disjoint_set/17352/main.cpp new file mode 100644 index 0000000..559df2e --- /dev/null +++ b/solution/disjoint_set/17352/main.cpp @@ -0,0 +1,47 @@ +// Authored by : bakh1 +// Co-authored by : - +// Link : http://boj.kr/a55613bb803d46ce8e3cbc399ac6427d + +#include +using namespace std; +#define SET_SIZE 300010 + +struct DisjointSet{ + int parent[SET_SIZE]; + + int find(int x){ + if(parent[x] == x) return x; + return parent[x] = find(parent[x]); + } + void Union(int x, int y){ + x=find(x); y=find(y); + if(x!=y) parent[y]=x; + } + DisjointSet(){ + for(int i=0; i> N; + for(int i=0; i < N-2; i++) { + cin>>a>>b; + st.Union(a,b); + } + + prev = st.find(1); + + for(int i=1; i<=N; i++){ + if(st.find(i) != prev){ + cout << prev << " " << st.find(i) << "\n"; + break; + } + prev = st.find(i); + } + + return 0; +} diff --git a/solution/disjoint_set/18116/main.cpp b/solution/disjoint_set/18116/main.cpp new file mode 100644 index 0000000..2f466f3 --- /dev/null +++ b/solution/disjoint_set/18116/main.cpp @@ -0,0 +1,47 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/7a6068ec74014cc68c29b63fd59c25ea +#include + +using namespace std; + +const int MAXN = 1000005; +int uf[MAXN], cnt[MAXN]; + +int find(int x) { + if(uf[x] < 0) return x; + return uf[x] = find(uf[x]); +} + +bool merge(int a, int b) { + a = find(a); + b = find(b); + if(a == b)return false; + uf[b] = a; + cnt[a] += cnt[b]; + return true; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + for(int i=0;i> cmd; + if(cmd == 'I') { + int a, b; cin >> a >> b; + merge(a, b); + } + else { + int a; cin >> a; + cout << cnt[find(a)] << '\n'; + } + } + + return 0; +} diff --git a/solution/disjoint_set/1976/main.cpp b/solution/disjoint_set/1976/main.cpp new file mode 100644 index 0000000..a9b3406 --- /dev/null +++ b/solution/disjoint_set/1976/main.cpp @@ -0,0 +1,46 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/18fb3fd9e39e4f0eb7cb530d83a16848 +#include + +using namespace std; + +int uf[40404]; + +int find(int x) { + if(uf[x] < 0) return x; + return uf[x] = find(uf[x]); +} + +bool merge(int a, int b) { + a = find(a); + b = find(b); + if(a == b)return false; + uf[b] = a; + return true; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N, M; cin >> N >> M; + for(int i=0;i<=N;i++)uf[i] = -1; + for(int i=1;i<=N;i++){ + for(int j=1;j<=N;j++) { + int x;cin >> x; + if(x) merge(i, j); + } + } + int pre; cin >> pre; + bool answer = true; + for(int i=1;i> cur; + if(find(pre) != find(cur)) answer = false; + pre = cur; + } + if(answer) cout << "YES"; + else cout << "NO"; + + return 0; +} diff --git a/solution/disjoint_set/1976/main.py b/solution/disjoint_set/1976/main.py new file mode 100644 index 0000000..de3c3c3 --- /dev/null +++ b/solution/disjoint_set/1976/main.py @@ -0,0 +1,45 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/a5ab5f0d45ed4e5584f0444987ba6c9a + +import sys + +def input(): + return sys.stdin.readline().rstrip() + +def union(x,y): + x = find_parent(x) + y = find_parent(y) + if x < y: + parent[y] = x + else: + parent[x] = y + +def find_parent(x): + if parent[x] != x: + parent[x] = find_parent(parent[x]) + return parent[x] + +N = int(input()) +M = int(input()) +parent = [i for i in range(N)] +arr = [] +for i in range(N): + arr.append(list(map(int, input().split()))) +for i in range(N): + for j in range(N): + if arr[i][j] == 1: + a = find_parent(i) + b = find_parent(j) + union(a,b) +ans = list(map(int, input().split())) +flag = 0 +standard = ans[0] - 1 +for i in range(1, len(ans)): + if parent[standard] != parent[ans[i]-1]: + flag = 1 + break +if not flag: + print('YES') +else: + print('NO') \ No newline at end of file diff --git a/solution/disjoint_set/4195/main.cpp b/solution/disjoint_set/4195/main.cpp new file mode 100644 index 0000000..8be6838 --- /dev/null +++ b/solution/disjoint_set/4195/main.cpp @@ -0,0 +1,48 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/03ac57850f3e4b83b42d8300cccc91fb +#include + +using namespace std; + +constexpr int MAXN = 200005; +int uf[MAXN], siz[MAXN]; + +int find(int x) { + if(uf[x] < 0) return x; + return uf[x] = find(uf[x]); +} + +bool merge(int a, int b) { + a = find(a); b = find(b); + if(a == b)return false; + uf[b] = a; + siz[a] += siz[b]; + return true; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int t; cin >> t; + while(t--){ + for(int i=0;i> n; + unordered_map mp; + int idx = 0; + + for(int i=0;i> a >> b; + if(mp.count(a) == 0) mp[a] = idx++; + if(mp.count(b) == 0) mp[b] = idx++; + merge(mp[a], mp[b]); + cout << siz[find(mp[a])] << '\n'; + } + } + + return 0; +} diff --git a/solution/divide_and_conquer/1074/main.cpp b/solution/divide_and_conquer/1074/main.cpp new file mode 100644 index 0000000..36d1a58 --- /dev/null +++ b/solution/divide_and_conquer/1074/main.cpp @@ -0,0 +1,24 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/fba04fa859d540fab6cad5266780f137 +#include + +using namespace std; + +int solve(int y, int x, int s) { + if(s == 2) return 2 * y + x; + s >>= 1; + int ny = y / s, nx = x / s; + int nxt = ny * 2 + nx; + return s * s * nxt + solve(y - ny * s, x - nx * s, s); +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N, R, C; cin >> N >> R >> C; + cout << solve(R, C, 1 << N); + + return 0; +} diff --git a/solution/divide_and_conquer/17829/main.cpp b/solution/divide_and_conquer/17829/main.cpp new file mode 100644 index 0000000..19d4c59 --- /dev/null +++ b/solution/divide_and_conquer/17829/main.cpp @@ -0,0 +1,54 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/aa7f1c4041eb4941a1366dd8229e70a4 +#include + +using namespace std; + +constexpr int MAXN = 1025; +int arr[MAXN][MAXN], tmp[MAXN][MAXN]; + +void f(int y, int x, int s) { + if(s == 2) { + int value[4] = { 0 }; + for(int i=0;i<2;i++){ + for(int j=0;j<2;j++){ + value[i * 2 + j] = arr[y + i][x + j]; + } + } + sort(value, value + 4); + tmp[y / 2][x / 2] = value[2]; + return; + } + + s /= 2; + f(y , x , s); + f(y + s, x , s); + f(y , x + s, s); + f(y + s, x + s, s); +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + for(int i=0;i> arr[i][j]; + } + } + + while(N != 1) { + f(0, 0, N); + N /= 2; + for(int i=0;i + +using namespace std; +typedef long long ll; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + ll N; cin >> N; + ll cnt = 0; + while(N){ + ll cur = 1; + while(cur * 2 < N) cur <<= 1; + N -= cur; + cnt ++; + } + ll ans = ~cnt & 1; + cout << ans; + + return 0; +} + diff --git a/solution/divide_and_conquer/1992/main.cpp b/solution/divide_and_conquer/1992/main.cpp new file mode 100644 index 0000000..3c013ba --- /dev/null +++ b/solution/divide_and_conquer/1992/main.cpp @@ -0,0 +1,40 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/f4a1319fd1af4655b19f5c7cd7872b92 +#include + +using namespace std; + +char arr[66][66]; +string answer; + +void solve(int y, int x, int s) { + bool flag = true; + for(int i=0;i> N; + for(int i=0;i> arr[i]; + solve(0, 0, N); + cout << answer; + + return 0; +} diff --git a/solution/divide_and_conquer/2447/main.cpp b/solution/divide_and_conquer/2447/main.cpp new file mode 100644 index 0000000..d297dd7 --- /dev/null +++ b/solution/divide_and_conquer/2447/main.cpp @@ -0,0 +1,47 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/619d768333f74fce8dd3e0cdd129a675 +#include + +using namespace std; + +bool arr[6666][6666]; + +void solve(int y, int x, int size) { + if(size == 3) { + for(int i=0;i<3;i++) { + for(int j=0;j<3;j++) { + if(i == 1 && j == 1)continue; + arr[y + i][x + j] = true; + } + } + return; + } + size /= 3; + solve(y + 0 * size, x + 0 * size, size); + solve(y + 0 * size, x + 1 * size, size); + solve(y + 0 * size, x + 2 * size, size); + solve(y + 1 * size, x + 0 * size, size); + + solve(y + 1 * size, x + 2 * size, size); + solve(y + 2 * size, x + 0 * size, size); + solve(y + 2 * size, x + 1 * size, size); + solve(y + 2 * size, x + 2 * size, size); +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + solve(0, 0, N); + for(int i=0;i + +using namespace std; + +char stars[3500][6500]; +char DB[3][6] = { + " * ", + " * * ", + "*****" +}; + +void solve(int y, int x, int s) { + if(s == 1) { + for(int i=0;i<3;i++){ + for(int j=0;j<5;j++){ + stars[y + i][x + j] = DB[i][j]; + } + } + return; + } + s /= 2; + solve(y, x + 3 * s, s); + solve(y + 3 * s, x, s); + solve(y + 3 * s, x + 6 * s, s); +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int n; cin >> n; + solve(0, 0, n / 3); + for(int i=0;i + +using namespace std; + +int arr[150][150], answer[2]; + +void solve(int y, int x, int size) { + bool flag = true; + for(int i=0;i> N; + for(int i=0;i> arr[i][j]; + } + } + + solve(0, 0, N); + cout << answer[0] << '\n' << answer[1]; + + return 0; +} diff --git a/solution/divide_and_conquer/4256/main.cpp b/solution/divide_and_conquer/4256/main.cpp new file mode 100644 index 0000000..77d3fba --- /dev/null +++ b/solution/divide_and_conquer/4256/main.cpp @@ -0,0 +1,35 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/320c53a7494341c0b867034b59ec4377 +#include + +using namespace std; + +vector preorder, inorder; +void solve(int L, int R, int L2, int R2) { + if(L > R || L2 > R2) return; + int root = preorder[L]; + int idx = L2; + while(inorder[idx] != root) idx ++; + solve(L + 1, L + idx - L2, L2, idx - 1); + solve(L + idx - L2 + 1, R, idx + 1, R2); + cout << root << ' '; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int t; cin >> t; + while(t--) { + int n; cin >> n; + preorder.clear(); preorder.resize(n); + inorder.clear(); inorder.resize(n); + for(int i=0;i> preorder[i]; + for(int i=0;i> inorder[i]; + solve(0, n - 1, 0, n - 1); + cout << '\n'; + } + + return 0; +} diff --git a/solution/divide_and_conquer/4779/main.cpp b/solution/divide_and_conquer/4779/main.cpp new file mode 100644 index 0000000..e955c62 --- /dev/null +++ b/solution/divide_and_conquer/4779/main.cpp @@ -0,0 +1,36 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/5aee7052f3ee45d5b0294edfb54c92f1 +#include + +using namespace std; + +string answer; + +void dfs(int L, int dis) { + if(dis == 1) { + answer[L] = '-'; + return; + } + + dis /= 3; + dfs(L, dis); + dfs(L + 2 * dis, dis); +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int k; + while(cin >> k) { + int N = 1; + for(int i = 0; i < k; i++) N *= 3; + answer = string(N, ' '); + dfs(0, N); + cout << answer << '\n'; + } + + return 0; +} + diff --git a/solution/dynamic_programming_1/1010/Main.java b/solution/dynamic_programming_1/1010/Main.java new file mode 100644 index 0000000..c4e4b19 --- /dev/null +++ b/solution/dynamic_programming_1/1010/Main.java @@ -0,0 +1,64 @@ +//Authored by : suin8 +//Co-authored by : - +//Link : http://boj.kr/00ddd7d473554b639c5e65eb1e1d8269 + +import java.util.*; +import java.io.*; + +public class Main { + static int[][] dp = new int[30][30]; + + public static void main(String[] args) { + FastReader rd = new FastReader(); + + int T = rd.nextInt(); + + // 조합공식을 이용하여 풀이가능 (M C N) + dp[0][0] = 1; + for(int j = 1;j < 30;j++) { + dp[j][0] = 1; + for(int k = 1;k <= j;k++) + dp[j][k] = dp[j - 1][k - 1] + dp[j - 1][k]; + } + + for(int i = 0;i < T;i++) { + int N = rd.nextInt(); + int M = rd.nextInt(); + + System.out.println(dp[M][N]); + } + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} diff --git a/solution/dynamic_programming_1/1010/main.cpp b/solution/dynamic_programming_1/1010/main.cpp new file mode 100644 index 0000000..5d6aae1 --- /dev/null +++ b/solution/dynamic_programming_1/1010/main.cpp @@ -0,0 +1,29 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/4a2e9c2a7d9a44e7b0c4eda2c2cae10b +#include + +using namespace std; +typedef long long ll; + +ll DP[33][33]; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int T; cin >> T; + DP[0][0] = 1; + for(int i=1;i<=30;i++) { + DP[i][0] = 1; + for(int j=1;j<=30;j++) { + DP[i][j] = DP[i - 1][j] + DP[i - 1][j - 1]; + } + } + while(T--) { + int N, M; cin >> N >> M; + cout << DP[M][N] << '\n'; + } + + return 0; +} diff --git a/solution/dynamic_programming_1/1010/main.py b/solution/dynamic_programming_1/1010/main.py new file mode 100644 index 0000000..2153d9e --- /dev/null +++ b/solution/dynamic_programming_1/1010/main.py @@ -0,0 +1,20 @@ +# Authored by : gkgg123 +# Co-authored by : - +# Link : https://www.acmicpc.net/source/share/6c285d8c7b9c44af971645f45c06d848 +import sys +def input(): + return sys.stdin.readline().rstrip() + +T = int(input()) + +dp = [[0 for _ in range(31)] for _ in range(31)] +dp[0][0] = 1 + +for num in range(1,31): + dp[num][0] = 1 + for pick in range(1,31): + dp[num][pick] = dp[num-1][pick] + dp[num-1][pick-1] + +for _ in range(T): + N, M = map(int,input().split()) + print(dp[M][N]) diff --git a/solution/dynamic_programming_1/10164/main.cpp b/solution/dynamic_programming_1/10164/main.cpp new file mode 100644 index 0000000..494bf08 --- /dev/null +++ b/solution/dynamic_programming_1/10164/main.cpp @@ -0,0 +1,37 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/17e87614b6d540ca996295b147a740d5 +#include + +using namespace std; + +int N, M, K; +int DP[22][22]; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + cin >> N >> M >> K; + int y = N, x = M; + if(K > 0) { + --K; + y = K / M + 1, x = K % M + 1; // 1 - based + } + DP[1][1] = 1; + for(int i=1;i<=y; i++) { + for(int j=1;j<=x;j++) { + if(i == 1 && j == 1) continue; + DP[i][j] = DP[i][j - 1] + DP[i - 1][j]; + } + } + for(int i=y;i<=N;i++){ + for(int j=x;j<=M;j++){ + if(i == y && j == x) continue; + DP[i][j] = DP[i][j - 1] + DP[i - 1][j]; + } + } + cout << DP[N][M]; + + return 0; +} diff --git a/solution/dynamic_programming_1/10870/main.cpp b/solution/dynamic_programming_1/10870/main.cpp new file mode 100644 index 0000000..c011b73 --- /dev/null +++ b/solution/dynamic_programming_1/10870/main.cpp @@ -0,0 +1,22 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/4c48767c6ca14f2fbef014b726303f33 +#include + +using namespace std; + +int DP[25]; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + DP[0] = 0; + DP[1] = 1; + for(int i=2;i<=20;i++){ + DP[i] = DP[i - 1] + DP[i - 2]; + } + + int N; cin >> N; + cout << DP[N]; +} diff --git a/solution/dynamic_programming_1/11048/main.cpp b/solution/dynamic_programming_1/11048/main.cpp new file mode 100644 index 0000000..88726cd --- /dev/null +++ b/solution/dynamic_programming_1/11048/main.cpp @@ -0,0 +1,23 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/4ff69fc575384408beee739a7904de45 +#include + +using namespace std; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N, M; cin >> N >> M; + vector> DP(N + 1, vector(M + 1)); + for(int i=1;i<=N;i++) { + for(int j=1;j<=M;j++) { + int x; cin >> x; + DP[i][j] = max({DP[i-1][j], DP[i][j-1], DP[i-1][j-1]}) + x; + } + } + cout << DP[N][M]; + + return 0; +} diff --git a/solution/dynamic_programming_1/11053/main.cpp b/solution/dynamic_programming_1/11053/main.cpp new file mode 100644 index 0000000..b134995 --- /dev/null +++ b/solution/dynamic_programming_1/11053/main.cpp @@ -0,0 +1,26 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/67f06494af394db6958644f6cb20e8fe +#include + +using namespace std; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + vector V(N), DP(N); + for(auto &i: V) cin >> i; + for(int i=0;i V[j]) { + DP[i] = max(DP[i], DP[j] + 1); + } + } + } + cout << *max_element(DP.begin(), DP.end()); + + return 0; +} diff --git a/solution/dynamic_programming_1/11055/main.cpp b/solution/dynamic_programming_1/11055/main.cpp new file mode 100644 index 0000000..857d10e --- /dev/null +++ b/solution/dynamic_programming_1/11055/main.cpp @@ -0,0 +1,26 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/038f38ed8c6f41149b051350cb3cabd1 +#include + +using namespace std; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + vector V(N), DP(N); + for(auto &i: V) cin >> i; + for(int i=0;i V[j]) { + DP[i] = max(DP[i], DP[j] + V[i]); + } + } + } + cout << *max_element(DP.begin(), DP.end()); + + return 0; +} diff --git a/solution/dynamic_programming_1/1106/Main.java b/solution/dynamic_programming_1/1106/Main.java new file mode 100644 index 0000000..473e60b --- /dev/null +++ b/solution/dynamic_programming_1/1106/Main.java @@ -0,0 +1,83 @@ +//Authored by : suin8 +//Co-authored by : - +//Link : http://boj.kr/f27ceec311074b119fc847208aad7a4a + +import java.util.*; +import java.io.*; + +class Pair{ + private int cost, customer; + Pair(int cost, int customer) { + this.cost = cost; + this.customer = customer; + } + public int getCo() { return cost; } + public int getCu() { return customer; } +} + +public class Main { + // dp[i]는 i의 비용으로 몇명의 고객을 늘릴 수 있는지 + // 최대 : 100원으로 1명의 인원이 늘어날 수 있고 1000명을 모집해야 한다면 + // 100 * 1000 = 100000 만큼 필요 + static Pair[] city = new Pair[30]; // 도시의 수 + static int[] dp = new int[100010]; + + public static void main(String[] args) { + FastReader rd = new FastReader(); + + int C = rd.nextInt(); + int N = rd.nextInt(); + + for(int i = 0;i < N;i++) { + int x = rd.nextInt(); + int y = rd.nextInt(); + city[i] = new Pair(x,y); + } + + // dp[i], 즉 i의 돈으로 홍보 할 수 있는 최대의 인원을 각 도시를 돌면서 확인하여 최대값으로 갱신합니다. + for(int i = 1;i < 100001;i++) { + for(int j = 0;j < N;j++) { + if(city[j].getCo() <= i) + dp[i] = Math.max(dp[i], dp[i - city[j].getCo()] + city[j].getCu()); + } + // dp[i]가 홍보 해야 할 인원을 만족하면 i는 최소비용 + if(dp[i] >= C) { + System.out.println(i); + break; + } + } + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} diff --git a/solution/dynamic_programming_1/11660/main.cpp b/solution/dynamic_programming_1/11660/main.cpp new file mode 100644 index 0000000..fe2b6ab --- /dev/null +++ b/solution/dynamic_programming_1/11660/main.cpp @@ -0,0 +1,28 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/c28a9148cd334f45b6edcbc40ae7ec15 +#include + +using namespace std; + +int arr[1033][1033], dp[1033][1033]; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N, Q; cin >> N >> Q; + for(int i=1;i<=N;i++) { + for(int j=1;j<=N;j++) { + cin >> arr[i][j]; + dp[i][j] = dp[i - 1][j] + dp[i][j - 1] - dp[i - 1][j - 1] + arr[i][j]; + } + } + + for(int i=0;i> x1 >> y1 >> x2 >> y2; + cout << dp[x2][y2] - dp[x1-1][y2] - dp[x2][y1-1] + dp[x1-1][y1-1] << '\n'; + } + + return 0; +} diff --git a/solution/dynamic_programming_1/11722/main.py b/solution/dynamic_programming_1/11722/main.py new file mode 100644 index 0000000..fb90d70 --- /dev/null +++ b/solution/dynamic_programming_1/11722/main.py @@ -0,0 +1,16 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/6b74718335d14780a6213de8a6b33e42 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +arr = list(map(int, input().split())) +dp = [1] * (N+1) +for i in range(N): + for j in range(i+1,N): + if arr[i] > arr[j]: + dp[j] = max(dp[i]+1, dp[j]) +print(max(dp)) \ No newline at end of file diff --git a/solution/dynamic_programming_1/11726/Main.java b/solution/dynamic_programming_1/11726/Main.java new file mode 100644 index 0000000..879ed3e --- /dev/null +++ b/solution/dynamic_programming_1/11726/Main.java @@ -0,0 +1,64 @@ +//Authored by : suin8 +//Co-authored by : - +//Link : http://boj.kr/54a281a936484bbda48800ca4f5f546c + +/* +문제는 1x2 2x1 이라고 주어졌지만 사실은 2x1타일을 쓰는 순간 +밑에도 2x1타일을 써야하기 때문에 2x2타일이라고 생각해도 무방합니다. +따라서 dp[i] = dp[i] = dp[i - 1] + dp[i - 2] 입니다. +현재 타일 경우 = (이전에) 1x2타일을 썼을 때 + 2x2타일을 썼을 때 +*/ + +import java.util.*; +import java.io.*; + +public class Main { + static int[] dp = new int[1010]; + + public static void main(String[] args) { + FastReader rd = new FastReader(); + + int n = rd.nextInt(); + + dp[1] = 1; + dp[2] = 2; + + // dp[i] = dp[i - 1] + dp[i - 2] + for(int i = 3;i <= n;i++) + dp[i] = (dp[i - 1] + dp[i - 2]) % 10007; + System.out.println(dp[n]); + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} diff --git a/solution/dynamic_programming_1/11726/main.py b/solution/dynamic_programming_1/11726/main.py new file mode 100644 index 0000000..2f9a2a5 --- /dev/null +++ b/solution/dynamic_programming_1/11726/main.py @@ -0,0 +1,18 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/120bee5ac7444d88ad6686eecd957cd2 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +MOD = 10007 +N = int(input()) +dp = [0] * (N+2) +dp[1] = 1 +dp[2] = 2 + +for i in range(3,N+1): + dp[i] = (dp[i-1] + dp[i-2]) % MOD + +print(dp[N] % MOD) diff --git a/solution/dynamic_programming_1/11727/main.py b/solution/dynamic_programming_1/11727/main.py new file mode 100644 index 0000000..d297f66 --- /dev/null +++ b/solution/dynamic_programming_1/11727/main.py @@ -0,0 +1,18 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/db4e4b38ee3c4264b672837fa8fff893 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +MOD = 10007 +N = int(input()) +dp = [0] * (N+2) +dp[1] = 1 +dp[2] = 3 + +for i in range(3,N+1): + dp[i] = (dp[i-1] + dp[i-2] * 2) % MOD + +print(dp[N] % MOD) diff --git a/solution/dynamic_programming_1/13699/main.py b/solution/dynamic_programming_1/13699/main.py new file mode 100644 index 0000000..41ddc08 --- /dev/null +++ b/solution/dynamic_programming_1/13699/main.py @@ -0,0 +1,15 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/84dabc0ec83940a9b2ee36e163f602c2 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +n = int(input()) +t = [0] * (n+4) +t[0] = 1 +for i in range(1,n+1): + for j in range(i): + t[i] += t[j] * t[i-1-j] +print(t[n]) \ No newline at end of file diff --git a/solution/dynamic_programming_1/1463/main.cpp b/solution/dynamic_programming_1/1463/main.cpp new file mode 100644 index 0000000..58d2e97 --- /dev/null +++ b/solution/dynamic_programming_1/1463/main.cpp @@ -0,0 +1,32 @@ +// Authored by : tallua_y +// Co-authored by : - +// Link : http://boj.kr/96a171e5da7746c7a51d5d348bc759a8 +#include + +using namespace std; + +int main(int argc, char** argv) +{ + ios::sync_with_stdio(false); + cin.tie(nullptr); + + size_t N; + cin >> N; + + vector count(N + 1); + count[1] = 0; + + for(int i = 2; i < N + 1; ++i) { + count[i] = count[i - 1] + 1; + if (i % 2 == 0) { + count[i] = min(count[i], count[i / 2] + 1); + } + if (i % 3 == 0) { + count[i] = min(count[i], count[i / 3] + 1); + } + } + + cout << count[N] << '\n'; + + return 0; +} diff --git a/solution/dynamic_programming_1/14722/main.cpp b/solution/dynamic_programming_1/14722/main.cpp new file mode 100644 index 0000000..08966d8 --- /dev/null +++ b/solution/dynamic_programming_1/14722/main.cpp @@ -0,0 +1,41 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/9916726bfd8e4ded9c7e4d6295073c1f +#include + +using namespace std; + +const int dy[] = { 1, 0 }; +const int dx[] = { 0, 1 }; +int DP[1002][1002][4], V[1002][1002], N; + +int go(int y, int x, int milk) { + int &ret = DP[y][x][milk + 1]; + if(ret != -1) return ret; + ret = 0; + for(int dir = 0; dir < 2; dir++) { + int ny = y + dy[dir]; + int nx = x + dx[dir]; + if(0 > ny || ny >= N || 0 > nx || nx >= N) continue; + if(V[ny][nx] == (milk + 1) % 3) ret = max(ret, go(ny, nx, (milk + 1) % 3) + 1); + ret = max(ret, go(ny, nx, milk)); + } + return ret; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + cin >> N; + for(int i=0;i> V[i][j]; + } + } + memset(DP, 0xff, sizeof(int) * 1002 * 1002 * 4); + if(V[0][0] == 0) cout << go(0, 0, 0) + 1; + else cout << go(0, 0, -1); + + return 0; +} diff --git a/solution/dynamic_programming_1/15486/Main.java b/solution/dynamic_programming_1/15486/Main.java new file mode 100644 index 0000000..287de53 --- /dev/null +++ b/solution/dynamic_programming_1/15486/Main.java @@ -0,0 +1,64 @@ +// Authored by : smw123123 +// Co-authored by : - +// Link : http://boj.kr/a9b5c6f0b2a443549ae67563af0f5e55 + +import java.util.*; +import java.lang.*; +import java.io.*; + +public class Main { + public static void main(String[] args) { + + FastReader rd = new FastReader(); + int N = rd.nextInt(); + int[] dp = new int[N+1]; + int T, P; + + for(int i = 0; i < N; i++) { + T = rd.nextInt(); + P = rd.nextInt(); + dp[i+1] = Math.max(dp[i], dp[i+1]); + if(i + T <= N) { + dp[i+T] = Math.max(dp[i+T], dp[i] + P); + } + } + System.out.println(dp[N]); + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + long nextLong() { return Long.parseLong(next()); } + double nextDouble() { return Double.parseDouble(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} + +// 설명 링크 : https://github.com/tony9402/baekjoon/pull/249#issue-978163457 diff --git a/solution/dynamic_programming_1/15989/main.cpp b/solution/dynamic_programming_1/15989/main.cpp new file mode 100644 index 0000000..306cb59 --- /dev/null +++ b/solution/dynamic_programming_1/15989/main.cpp @@ -0,0 +1,38 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/7363aaeb37fd489aaa5c0ad142ce8a7a +#include + +using namespace std; +typedef long long ll; + +ll DP[10005][4]; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + for(int i=1;i<=3;i++) { + for(int j=1;j<=i;j++) { + DP[i][j] = 1; + } + } + + for(int i=4;i<=10000;i++) { + for(int j=1;j<=3;j++) { + for(int k=1;k<=j;k++) { + DP[i][j] += DP[i - j][k]; + } + } + } + + int T; cin >> T; + while(T--){ + int n; cin >> n; + ll answer = 0; + for(int i=1;i<=3;i++) answer += DP[n][i]; + cout << answer << '\n'; + } + + return 0; +} diff --git a/solution/dynamic_programming_1/15990/main.cpp b/solution/dynamic_programming_1/15990/main.cpp new file mode 100644 index 0000000..b3ce023 --- /dev/null +++ b/solution/dynamic_programming_1/15990/main.cpp @@ -0,0 +1,32 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/7a8607af45e042df9e44b48962548e1a +#include + +using namespace std; +typedef long long ll; + +ll DP[100005][4]; +const ll MOD = 1e9 + 9; +const int MAXN = 100000; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + for(int i=1;i<=3;i++) DP[i][i] = DP[3][i] = 1; + for(int i=4;i<=MAXN;i++){ + for(int j=1;j<=3;j++){ + for(int k=1;k<=3;k++){ + if(j == k)continue; + DP[i][j] = (DP[i][j] + DP[i - j][k]) % MOD; + } + } + } + int T; cin >> T; + while(T--){ + int n; cin >> n; + cout << (DP[n][1] + DP[n][2] + DP[n][3]) % MOD << '\n'; + } + return 0; +} diff --git a/solution/dynamic_programming_1/17626/main.py b/solution/dynamic_programming_1/17626/main.py new file mode 100644 index 0000000..545b2e7 --- /dev/null +++ b/solution/dynamic_programming_1/17626/main.py @@ -0,0 +1,21 @@ +# Authored by : osy0056 +# Co-authored by : - +# Link : http://boj.kr/49cc21bd78694086b7b2864e8bc6fa69 +import math +import sys + +def input(): + return sys.stdin.readline().rstrip() + +n = int(input()) +dp = [0] * 50001 +INF = float('inf') + +dp[0] = 0 +dp[1] = 1 +for i in range(2, n+1): + min_value = INF + for k in range(1, math.floor(math.sqrt(i)) + 1): + min_value = min(min_value, dp[i - k * k]) + dp[i] = min_value + 1 +print(dp[n]) diff --git a/solution/dynamic_programming_1/1890/main.py b/solution/dynamic_programming_1/1890/main.py new file mode 100644 index 0000000..856a55e --- /dev/null +++ b/solution/dynamic_programming_1/1890/main.py @@ -0,0 +1,28 @@ +# Authored by : cieske +# Co-authored by : - +# Link : http://boj.kr/73b9e168131842dd90aa2b02380cb0fa + +import sys +def input(): + return sys.stdin.readline().rstrip() + +n = int(input()) +lst = [] +for _ in range(n): + lst.append(list(map(int, input().split()))) + +dp = [[0]*n for _ in range(n)] +dp[0][0] = 1 + +for i in range(n): + for j in range(n): + if lst[i][j] == 0: + continue + jump = lst[j][i] + + if j+jump < n: + dp[j+jump][i] += dp[j][i] + if i+jump < n: + dp[j][i+jump] += dp[j][i] + +print(dp[-1][-1]) diff --git a/solution/dynamic_programming_1/1912/Main.java b/solution/dynamic_programming_1/1912/Main.java new file mode 100644 index 0000000..440bed1 --- /dev/null +++ b/solution/dynamic_programming_1/1912/Main.java @@ -0,0 +1,66 @@ +//Authored by : suin8 +//Co-authored by : - +//Link : http://boj.kr/788f5770927f4da79551c4bc06c3351b + +import java.util.*; +import java.io.*; + +public class Main { + + static int[] arr = new int[100010]; + static int[] dp = new int[100010]; + + public static void main(String[] args) { + FastReader rd = new FastReader(); + + int n = rd.nextInt(); + for(int i = 0;i < n;i++) + arr[i] = rd.nextInt(); + + // 초기화 + int max = arr[0]; + dp[0] = arr[0]; + + // dp[i]안에는 arr[0~i]까지의 합 중 최대값을 가진다. + // max는 dp값중 최대값을 가진다.=> 결과값 + for(int i = 1;i < n;i++) { + dp[i] = Math.max(dp[i - 1] + arr[i], arr[i]); + max = Math.max(dp[i], max); + } + + System.out.println(max); + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} diff --git a/solution/dynamic_programming_1/19622/main.py b/solution/dynamic_programming_1/19622/main.py new file mode 100644 index 0000000..536680f --- /dev/null +++ b/solution/dynamic_programming_1/19622/main.py @@ -0,0 +1,23 @@ +# Authored by : chj3748 +# Co-authored by : - +# Link : http://boj.kr/25c02a4ea33e493f9f1320165f1a5f95 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +meetings = [] +for _ in range(N): + meetings.append(list(map(int, input().split()))) +dp = [0] * N + +for i in range(N): + if i == 0: + dp[0] = meetings[0][2] + elif i == 1: + dp[1] = max(meetings[1][2], dp[0]) + else: + dp[i] = max(dp[i-2] + meetings[i][2], dp[i-1]) + +print(dp[N - 1]) \ No newline at end of file diff --git a/solution/dynamic_programming_1/21317/main.cpp b/solution/dynamic_programming_1/21317/main.cpp new file mode 100644 index 0000000..daf9350 --- /dev/null +++ b/solution/dynamic_programming_1/21317/main.cpp @@ -0,0 +1,28 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/7b74ffa836cb49029ffc4ee08767c9db +#include + +using namespace std; + +int DP[105][2], arr[105][2]; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + for(int i=1;i> arr[i][0] >> arr[i][1]; + int k; cin >> k; + for(int i=2;i<105;i++) DP[i][0] = DP[i][1] = INT_MAX; + for(int i=1;ik: + continue + for j in range(i+1, n): + need = (j-i) * (1 + abs(rocks[i]-rocks[j])) + dp[j] = min(dp[j], need) + +if dp[n-1]>k: + print('NO') +else: + print('YES') diff --git a/solution/dynamic_programming_1/2294/main.py b/solution/dynamic_programming_1/2294/main.py new file mode 100644 index 0000000..cf75646 --- /dev/null +++ b/solution/dynamic_programming_1/2294/main.py @@ -0,0 +1,23 @@ +# Authored by : cieske +# Co-authored by : - +# Link : http://boj.kr/4c2449f200e440f39d4ba8e1e71601b6 + +import sys +def input(): + return sys.stdin.readline().rstrip() + +n, k = map(int, input().split()) +coin = set([int(input()) for _ in range(n)]) #중복 동전 제거 +dp = [0]*(k+1) + +for i in range(1, k+1): + possible = [] + for c in coin: + if i-c >= 0 and dp[i-c] >= 0: # i-c원 경우에 c원 동전을 추가해서 i원을 만들 수 있는 경우 + possible.append(dp[i-c]) + if possible: + dp[i] = min(possible) + 1 # optimal 값 + 1 + else: + dp[i] = -1 #불가능! + +print(dp[k]) diff --git a/solution/dynamic_programming_1/2407/Main.java b/solution/dynamic_programming_1/2407/Main.java new file mode 100644 index 0000000..6ebc5d0 --- /dev/null +++ b/solution/dynamic_programming_1/2407/Main.java @@ -0,0 +1,67 @@ +//Authored by : suin8 +//Co-authored by : - +//Link : http://boj.kr/342101ba2b5246bb9801f2d356ea8c56 + +import java.util.*; +import java.io.*; +import java.math.*; + +public class Main { + static BigInteger[][] dp = new BigInteger[110][110]; + + public static void main(String[] args) { + FastReader rd = new FastReader(); + + int n = rd.nextInt(); + int m = rd.nextInt(); + + // 매우매우 큰수가 나오는 조합(n C m), 따라서 biginteger사용 + dp[0][0] = new BigInteger("1"); + + for(int i = 1;i <= n;i++) { + dp[i][0] = new BigInteger("1"); + for(int j = 1;j <= i;j++) { + // biginteger는 string이라서 null로 초기화 되어 있기 때문에 + // 각 예외상황마다 값을 정해주어야 한다. + if(i == j) dp[i][j] = new BigInteger("1"); + else if(i < j) dp[i][j] = new BigInteger("0"); + else dp[i][j] = dp[i - 1][j - 1].add(dp[i - 1][j]); + } + } + + System.out.println(dp[n][m]); + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} diff --git a/solution/dynamic_programming_1/2579/main.py b/solution/dynamic_programming_1/2579/main.py new file mode 100644 index 0000000..3be5d15 --- /dev/null +++ b/solution/dynamic_programming_1/2579/main.py @@ -0,0 +1,20 @@ +# Authored by : cieske +# Co-authored by : - +# Link : http://boj.kr/3d9ff337b9bc420a975cf6783b298212 + +import sys +def input(): + return sys.stdin.readline().rstrip() + +n = int(input()) +lst = [int(input()) for _ in range(n)] + +if n > 3: + dp = [lst[0], lst[0]+lst[1], max(lst[0], lst[1])+lst[2]] # 3번째 칸까지는 먼저 구하기 + for i in range(3, n): + next_max = max(dp[i-2], dp[i-3]+lst[i-1]) # max(2칸 전에서 i번째 경우, 3칸-1칸 전 밟고 i번째 오는 경우) + dp.append(next_max+lst[i]) + print(dp[-1]) +else: + print(sum(lst)) #2칸 이하면 모두 밟는게 최대 + diff --git a/solution/dynamic_programming_1/2748/main.cpp b/solution/dynamic_programming_1/2748/main.cpp new file mode 100644 index 0000000..9398005 --- /dev/null +++ b/solution/dynamic_programming_1/2748/main.cpp @@ -0,0 +1,20 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/b5fdc8a3c2c84784a6b308c98e4aa7e9 +#include + +using namespace std; + +long long DP[99]; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + DP[1] = 1; + for(int i=2;i<=90;i++)DP[i] = DP[i-1] + DP[i-2]; + + int N; cin >> N; + cout << DP[N]; +} + diff --git a/solution/dynamic_programming_1/2839/main.cpp b/solution/dynamic_programming_1/2839/main.cpp new file mode 100644 index 0000000..5aa590e --- /dev/null +++ b/solution/dynamic_programming_1/2839/main.cpp @@ -0,0 +1,23 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/48cb7b8049444c7eb5cdc5752dd5eb66 +#include + +using namespace std; + +int DP[5005]; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + const int INF = 50000; + for(int i=1;i<=5000;i++) DP[i] = INF; + DP[3] = 1; + + for(int i=5;i<=5000;i++) DP[i] = min({ DP[i], DP[i - 3] + 1, DP[i - 5] + 1}); + + int N; cin >> N; + if(DP[N] == INF)DP[N] = -1; + cout << DP[N]; +} diff --git a/solution/dynamic_programming_1/9095/main.py b/solution/dynamic_programming_1/9095/main.py new file mode 100644 index 0000000..b30aa6f --- /dev/null +++ b/solution/dynamic_programming_1/9095/main.py @@ -0,0 +1,21 @@ +# Authored by : osy0056 +# Co-authored by : - +# Link : http://boj.kr/da3d10e3ebc945349d778cb06444ffb1 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +tc = int(input()) + +dp = [0] * 15 +dp[1] = 1 +dp[2] = 2 +dp[3] = 4 +for i in range(4, 12): + dp[i] = dp[i - 3] + dp[i - 2] + dp[i - 1] + +for _ in range(tc): + n = int(input()) + + print(dp[n]) diff --git a/solution/dynamic_programming_1/9461/main.py b/solution/dynamic_programming_1/9461/main.py new file mode 100644 index 0000000..f9ff9de --- /dev/null +++ b/solution/dynamic_programming_1/9461/main.py @@ -0,0 +1,20 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/369118cac2b14c75866029d361c95152 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +def recursion(x): + if x == 1 or x == 2 or x == 3: + return 1 + if dp[x] == 0: + dp[x] = recursion(x-2) + recursion(x-3) + return dp[x] + +T = int(input()) +dp = [0] * 101 +for i in range(T): + N = int(input()) + print(recursion(N)) \ No newline at end of file diff --git a/solution/dynamic_programming_1/9465/main.py b/solution/dynamic_programming_1/9465/main.py new file mode 100644 index 0000000..85378d9 --- /dev/null +++ b/solution/dynamic_programming_1/9465/main.py @@ -0,0 +1,26 @@ +# Authored by : cieske +# Co-authored by : - +# Link : http://boj.kr/39643867e537451a9ae49e16ec4f2f3f + +import sys +def input(): + return sys.stdin.readline().rstrip() + +t = int(input()) +for _ in range(t): + n = int(input()) + lst = [list(map(int, input().split())) for i in range(2)] + # 새로 dp 행렬 만들 필요 없이 스티커 값이 저장된 lst 배열에서 dp 수행 + + if n > 1: + # 경우의 수 오직 1개 + lst[0][1] += lst[1][0] + lst[1][1] += lst[0][0] + + if n > 2: + for i in range(2, n): + #대각선에 있는 스티커를 고를 지, 거기서 한 칸 더 떨어져 있는 스티커를 고를 지 선택 + lst[0][i] += max(lst[1][i-1], lst[1][i-2]) + lst[1][i] += max(lst[0][i-1], lst[0][i-2]) + + print(max(lst[0][-1], lst[1][-1])) diff --git a/solution/dynamic_programming_1/9655/Main.java b/solution/dynamic_programming_1/9655/Main.java new file mode 100644 index 0000000..97f7ce6 --- /dev/null +++ b/solution/dynamic_programming_1/9655/Main.java @@ -0,0 +1,58 @@ +//Authored by : suin8 +//Co-authored by : tony9402 +//Link : http://boj.kr/096e8e82144f450ab19b16bcf62cc83b +import java.util.*; +import java.io.*; + +public class Main { + static int DP[] = new int[1001]; + public static void main(String[] args) { + FastReader rd = new FastReader(); + + // 짝수일때는 창영이가, 홀수일때는 상근이가 이기게 됩니다. + // 반드시 상근이가 먼저 시작하고 1,3 홀수개 만큼 가져가기 때문. + // System.out.println((N % 2 == 0) ? "CY" : "SK"); + + int N = rd.nextInt(); + // 1 : 상근, 2 : 창영 + DP[1] = 1; + for(int i = 1; i < 1000; i++) { + if(DP[i + 1] == 0) DP[i + 1] = 3 - DP[i]; + if(i + 3 <= 1000) DP[i + 3] = 3 - DP[i]; + } + System.out.println((DP[N] % 2 == 0 ? "CY" : "SK")); + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} diff --git a/solution/dynamic_programming_1/9655/main.py b/solution/dynamic_programming_1/9655/main.py new file mode 100644 index 0000000..1d47517 --- /dev/null +++ b/solution/dynamic_programming_1/9655/main.py @@ -0,0 +1,24 @@ +# Authored by : yj2221 +# Co-authored by : - +# Link : http://boj.kr/f4bdc1e4d3f34003a1080645069b0ee7 + +import sys +def input(): + return sys.stdin.readline().rstrip() + +dp = ['' for _ in range(1001)] +dp[1] = 'SK' + +for i in range(1,1000): + if dp[i]=="SK": + if dp[i+1]=='': + dp[i+1] = 'CY' + if i+3<1000: + dp[i+3] = 'CY' + elif dp[i]=='CY': + if dp[i+1]=='': + dp[i+1] = 'SK' + if i+3<1000: + dp[i+3] = 'SK' + +print(dp[int(input())]) \ No newline at end of file diff --git a/solution/dynamic_programming_2/1005/main.cpp b/solution/dynamic_programming_2/1005/main.cpp new file mode 100644 index 0000000..115675b --- /dev/null +++ b/solution/dynamic_programming_2/1005/main.cpp @@ -0,0 +1,45 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/9577f93393b64444a01592dfb1458d97 +#include + +using namespace std; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int T; cin >> T; + while(T--) { + int N, M, W; cin >> N >> M; + vector> graph(N); + vector V(N), DP(N), indegree(N); + for(int i=0;i> V[i]; + for(int i=0;i> a >> b; + graph[--a].emplace_back(--b); + indegree[b]++; + } + cin >> W; + + queue Q; + for(int i=0;i + +using namespace std; + +const int INF = 0x3f3f3f3f; + +int main() { + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + vector> V(N, vector(N)); + vector> DP(N, vector(N, INF)); + DP[0][0]=0; + for(int i=0;i> V[i][j]; + if(j > 0){ + int d = max(0, V[i][j] - V[i][j-1] + 1); + DP[i][j]=min(DP[i][j], DP[i][j-1] + d); + } + if(i > 0){ + int d = max(0, V[i][j] - V[i-1][j] + 1); + DP[i][j] = min(DP[i][j], DP[i-1][j] + d); + } + } + } + cout << DP[N-1][N-1]; + + return 0; +} diff --git a/solution/dynamic_programming_2/11909/main.py b/solution/dynamic_programming_2/11909/main.py new file mode 100644 index 0000000..817c08a --- /dev/null +++ b/solution/dynamic_programming_2/11909/main.py @@ -0,0 +1,32 @@ +# Authored by : chj3748 +# Co-authored by : - +# Link : http://boj.kr/a7949813f6e74a918f1f18b458ea5f8c +import sys +from collections import deque + +def input(): + return sys.stdin.readline().rstrip() + +inf = float('inf') +n = int(input()) +prison = [list(map(int, input().split())) for _ in range(n)] +dp = [[inf] * n for _ in range(n)] +dp[0][0] = 0 +dirx = [1, 0] +diry = [0, 1] + +q = deque() +q.append((0, 0)) +while q: + x, y = q.popleft() + for dx, dy in zip(dirx, diry): + nx, ny = x + dx, y + dy + if 0 <= nx < n and 0 <= ny < n: + cost = prison[nx][ny] - prison[x][y] + 1 + if cost < 1: + cost = 0 + if dp[nx][ny] > dp[x][y] + cost: + q.append((nx, ny)) + dp[nx][ny] = dp[x][y] + cost + +print(dp[n - 1][n - 1]) \ No newline at end of file diff --git a/solution/dynamic_programming_2/11985/main.py b/solution/dynamic_programming_2/11985/main.py new file mode 100644 index 0000000..1f5a19e --- /dev/null +++ b/solution/dynamic_programming_2/11985/main.py @@ -0,0 +1,34 @@ +# Authored by : chj3748 +# Co-authored by : - +# Link : http://boj.kr/f293bc24e6e347dba7b5aa08836171fe +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N, M, K = map(int, input().split()) +oranges = [] +inf = float('inf') +dp = [inf] * N +dp[0] = K +for idx in range(N): + oranges.append(int(input())) + if idx > 0: + max_size = oranges[idx] + min_size = oranges[idx] + for j in range(M): + left_idx = idx - j + if left_idx < 0: + break + if max_size < oranges[left_idx]: + max_size = oranges[left_idx] + if min_size > oranges[left_idx]: + min_size = oranges[left_idx] + if left_idx - 1 >= 0: + temp = dp[left_idx - 1] + K + (max_size - min_size) * (j + 1) + else: + temp = K + (max_size - min_size) * (j + 1) + if dp[idx] > temp: + dp[idx] = temp + +print(dp[N - 1]) diff --git a/solution/dynamic_programming_2/12015/main.cpp b/solution/dynamic_programming_2/12015/main.cpp new file mode 100644 index 0000000..3fac1dc --- /dev/null +++ b/solution/dynamic_programming_2/12015/main.cpp @@ -0,0 +1,23 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/c74669b0329d4d59ad5145504275e7ac +#include + +using namespace std; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + vector V(N), DP; + for(auto &i: V) cin >> i; + for(int i=0;i + +using namespace std; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + vector> graph(N); + vector V(N), DP(N), indegree(N); + for(int i=0;i> V[i]; + while(true) { + int x; cin >> x; + if(x == -1) break; + graph[--x].push_back(i); + indegree[i] ++; + } + } + + queue Q; + for(int i=0;i + +using namespace std; + +int N, M; +int maps[501][501]; +int dp[501][501]; + +int dfs(int n, int m, int val) { + + if (n == N && m == M) return 1; + if (dp[n][m] != -1) return dp[n][m]; + + dp[n][m] = 0; + + if (n + 1 <= N && val > maps[n + 1][m]) dp[n][m] += dfs(n + 1, m, maps[n + 1][m]); + if (n - 1 >= 1 && val > maps[n - 1][m]) dp[n][m] += dfs(n - 1, m, maps[n - 1][m]); + if (m + 1 <= M && val > maps[n][m + 1]) dp[n][m] += dfs(n, m + 1, maps[n][m + 1]); + if (m - 1 >= 1 && val > maps[n][m - 1]) dp[n][m] += dfs(n, m - 1, maps[n][m - 1]); + + return dp[n][m]; +} + +int main() { + ios::sync_with_stdio(false); + cin.tie(NULL); + + cin >> N >> M; + for (int i = 1; i <= N; i++) { + for (int j = 1; j <= M; j++) { + cin >> maps[i][j]; + } + } + + memset(dp, -1, sizeof(dp)); + + cout << dfs(1, 1, maps[1][1]) << '\n'; + + return 0; +} diff --git a/solution/dynamic_programming_2/1520/main.py b/solution/dynamic_programming_2/1520/main.py new file mode 100644 index 0000000..fa0678d --- /dev/null +++ b/solution/dynamic_programming_2/1520/main.py @@ -0,0 +1,31 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/5c0cf17f207745eb899923dfc5881c26 + +import sys + +def input(): + return sys.stdin.readline().rstrip() + +def DFS(x,y): + if x == N-1 and y == M-1: + return 1 + if dp[x][y] == -1: + dp[x][y] = 0 + for i in range(4): + dx = nx[i] + x + dy = ny[i] + y + if dx < 0 or dx >= N or dy < 0 or dy >= M: + continue + if arr[dx][dy] < arr[x][y]: + dp[x][y] += DFS(dx,dy) + return dp[x][y] + +N, M = map(int, input().split()) +arr = [] +nx = [-1, 0, 1, 0] +ny = [0, -1, 0, 1] +dp = [[-1 for i in range(M)] for j in range(N)] +for i in range(N): + arr.append(list(map(int, input().split()))) +print(DFS(0,0)) \ No newline at end of file diff --git a/solution/dynamic_programming_2/17485/main.py b/solution/dynamic_programming_2/17485/main.py new file mode 100644 index 0000000..b144140 --- /dev/null +++ b/solution/dynamic_programming_2/17485/main.py @@ -0,0 +1,27 @@ +# Authored by : yj2221 +# Co-authored by : tony9402 +# Link : http://boj.kr/1b3b764580774cf799a9a9606d12fec0 + +import sys +def input(): + return sys.stdin.readline().rstrip() + +INF = 99999999 +n, m = map(int,input().split()) +board = [list(map(int,input().split())) for i in range(n)] +dp = [[[INF] * m for _ in range(n)] for _ in range(3)] + +for i in range(m): + dp[0][0][i] = board[0][i] + dp[1][0][i] = board[0][i] + dp[2][0][i] = board[0][i] + +for i in range(1, n): + for j in range(m): + dp[0][i][j] = min(dp[1][i-1][j], dp[2][i-1][j]) + board[i][j] + if j!=m-1: + dp[1][i][j] = min(dp[0][i-1][j+1], dp[2][i-1][j+1]) + board[i][j] + if j!=0: + dp[2][i][j] = min(dp[1][i-1][j-1], dp[0][i-1][j-1]) + board[i][j] + +print(min(min(dp[0][n-1]),min(dp[1][n-1]), min(dp[2][n-1]))) diff --git a/solution/dynamic_programming_2/18427/main.py b/solution/dynamic_programming_2/18427/main.py new file mode 100644 index 0000000..0715215 --- /dev/null +++ b/solution/dynamic_programming_2/18427/main.py @@ -0,0 +1,24 @@ +# Authored by : yj2221 +# Co-authored by : tony9402 +# Link : http://boj.kr/069cb935ee08462280976f02691b40ca + +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N, M, H = map(int, input().split()) + +students = [] +for _ in range(N): + students.append(list(map(int, input().split()))) + +dp = [1] + [0] * (H+1) + +for i in range(N): + for j in range(H, -1, -1): + for k in students[i]: + if j - k >= 0: + dp[j] = (dp[j] + dp[j - k]) % 10007 + +print(dp[H]) diff --git a/solution/dynamic_programming_2/21923/main.py b/solution/dynamic_programming_2/21923/main.py new file mode 100644 index 0000000..dab3381 --- /dev/null +++ b/solution/dynamic_programming_2/21923/main.py @@ -0,0 +1,39 @@ +# Authored by : yj2221 +# Co-authored by : - +# Link : http://boj.kr/33f73b2bfd3a443fa03f4e9f240b41a1 + +import sys + +def input(): + return sys.stdin.readline().rstrip() + +n, m = map(int, input().split()) +board = [list(map(int, input().split())) for _ in range(n)] + +INF = 1e10 +dp = [[[-INF] * m for _ in range(n)] for _ in range(2)] + +# up +dp[0][n-1][0] = board[n-1][0] +for y in range(n-1, -1 ,-1): + for x in range(m): + if y+1=0: + dp[0][y][x] = max(dp[0][y][x], dp[0][y][x-1] + board[y][x]) + +# down +dp[1][n-1][m-1] = board[n-1][m-1] +for y in range(n-1, -1 ,-1): + for x in range(m-1, -1, -1): + if y+1 + +using namespace std; + +const string DB[8] = { "0", "0", "1", "7", "4", "2", "0", "8" }; +string minstr[105] = { "0", "0", "1", "7", "4", "2", "6", "8", "10" }; +string maxstr[105]; + +string getMax(int cnt) { + string ans; + while(cnt) { + if(cnt & 1) { + ans += '7'; + cnt -= 3; + } + else { + ans += '1'; + cnt -= 2; + } + } + return ans; +} + +string getMin(const string &a, const string &b) { + if(a.size() > b.size()) return b; + if(a.size() < b.size()) return a; + for(int i=0;i<(int)a.size();i++){ + if(a[i] < b[i]) return a; + if(a[i] > b[i]) return b; + } + return a; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + for(int i=2;i<=100;i++)maxstr[i] = getMax(i); + for(int i=9;i<=100;i++){ + minstr[i] = minstr[i - 2] + DB[2]; + for(int j=3;j<=7;j++) minstr[i] = getMin(minstr[i], minstr[i - j] + DB[j]); + } + int t; cin >> t; + while(t--) { + int n; cin >> n; + cout << minstr[n] << " " << maxstr[n] << '\n'; + } + + return 0; +} diff --git a/solution/dynamic_programming_2/5557/main.py b/solution/dynamic_programming_2/5557/main.py new file mode 100644 index 0000000..8429600 --- /dev/null +++ b/solution/dynamic_programming_2/5557/main.py @@ -0,0 +1,23 @@ +# Authored by : chj3748 +# Co-authored by : - +# Link : http://boj.kr/23af4ad30fe24df4a71cdd3db925087c +import sys +import heapq + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +numbers = list(map(int, input().split())) +dp = [[0] * 21 for _ in range(N - 1)] +dp[0][numbers[0]] = 1 +for i in range(1, N - 1): + for j in range(21): + if dp[i - 1][j] <= 0: + continue + for oper in (1, -1): + temp = j + oper * numbers[i] + if 0 <= temp < 21: + dp[i][temp] += dp[i - 1][j] +answer = dp[N - 2][numbers[N - 1]] +print(answer) diff --git a/solution/dynamic_programming_2/7579/main.cpp b/solution/dynamic_programming_2/7579/main.cpp new file mode 100644 index 0000000..0160e0f --- /dev/null +++ b/solution/dynamic_programming_2/7579/main.cpp @@ -0,0 +1,38 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/7cc3cfd9bda64cfe8af9ff0a99c789a9 +#include + +using namespace std; + +int DP[10001], N, M, mem[101], cost[101]; +int sum_cost; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + cin >> N >> M; + for(int i=0;i> mem[i]; + for(int i=0;i> cost[i]; + sum_cost += cost[i]; + } + for(int i=0;i=0;j--){ + if(j - cost[i] >= 0){ + DP[j] = max(DP[j], DP[j - cost[i]] + mem[i]); + } + } + } + int answer = 0; + for(int i=0;i<=sum_cost;i++) { + if(DP[i] >= M) { + answer = i; + break; + } + } + cout << answer; + + return 0; +} diff --git a/solution/dynamic_programming_2/9251/main.py b/solution/dynamic_programming_2/9251/main.py new file mode 100644 index 0000000..f6a7764 --- /dev/null +++ b/solution/dynamic_programming_2/9251/main.py @@ -0,0 +1,23 @@ +# Authored by : chj3748 +# Co-authored by : - +# Link : http://boj.kr/fa5cc7635c6b497495804944b5696e12 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +string1 = '_' + input() +string2 = '_' + input() +len1 = len(string1) +len2 = len(string2) +dp = [[0] * len2 for _ in range(len1)] + +for i in range(1, len1): + for j in range(1, len2): + if string1[i] == string2[j]: + dp[i][j] = dp[i - 1][j - 1] + 1 + else: + dp[i][j] = max(dp[i][j - 1], dp[i - 1][j]) + +print(dp[len1 - 1][len2 - 1]) + diff --git a/solution/dynamic_programming_on_trees/1135/main.py b/solution/dynamic_programming_on_trees/1135/main.py new file mode 100644 index 0000000..836e942 --- /dev/null +++ b/solution/dynamic_programming_on_trees/1135/main.py @@ -0,0 +1,37 @@ +# Authored by : cieske +# Co-authored by : - +# Link : http://boj.kr/549472cf36d2472cb68fd6a6856bea25 + +import sys + +def input(): + return sys.stdin.readline().rstrip() + +n = int(input()) +t = list(map(int, input().split())) +tree = [[] for _ in range(n)] + +for idx in range(1, n): + tree[t[idx]].append(idx) # 트리 생성 + +# time[v] = v를 root로 하는 subtree에 정보를 모두 전달하는데 걸리는 시간 +time = [False]*n + +def dp(v): + child_t = [] + for nei in tree[v]: + # Leaf까지 내려감 + dp(nei) + # 각 child를 root로 하는 subtree에 정보 전달하는데 걸리는 시간 모음 + child_t.append(time[nei]) + if not tree[v]: + # Child가 없으면 0 + child_t.append(0) + + child_t.sort(reverse=True) + # 시간이 오래 걸리는 쪽부터 먼저 전화를 돌리기 + need_time = [child_t[i] + i + 1 for i in range(len(child_t))] + time[v] = max(need_time) # 그 중에 가장 오래 걸리는 시간을 assign + +dp(0) +print(time[0]-1) # Root node에 정보 전달하는 시간은 없으니 1빼기 diff --git a/solution/dynamic_programming_on_trees/15681/main.cpp b/solution/dynamic_programming_on_trees/15681/main.cpp new file mode 100644 index 0000000..e06256e --- /dev/null +++ b/solution/dynamic_programming_on_trees/15681/main.cpp @@ -0,0 +1,41 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/acc4b75def8e48d995163a01bcc23068 +#include + +using namespace std; + +vector> graph; +vector siz; + +void dfs(int cur, int prv) { + siz[cur] = 1; + + for(auto &nxt: graph[cur]) { + if(nxt == prv) continue; + dfs(nxt, cur); + siz[cur] += siz[nxt]; + } +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N, R, Q; cin >> N >> R >> Q; + graph.resize(N + 1); + siz.resize(N + 1); + for(int i=1;i> a >> b; + graph[a].push_back(b); + graph[b].push_back(a); + } + dfs(R, R); + + while(Q--) { + int x;cin >> x; + cout << siz[x] << '\n'; + } + + return 0; +} diff --git a/solution/dynamic_programming_on_trees/17831/main.py b/solution/dynamic_programming_on_trees/17831/main.py new file mode 100644 index 0000000..96581eb --- /dev/null +++ b/solution/dynamic_programming_on_trees/17831/main.py @@ -0,0 +1,45 @@ +# Authored by : cieske +# Co-authored by : - +# Link : http://boj.kr/3e256d935b4e4fe3a887d16fbcb8abef + +import sys + +def input(): + return sys.stdin.readline().rstrip() + +sys.setrecursionlimit(1000000000) + +n = int(input()) +tree = [[] for _ in range(n+1)] + +mark = list(map(int, input().split())) +for idx in range(len(mark)): + tree[mark[idx]].append(idx+2) + +stat = list(map(int, input().split())) + +# dp_mat[v] = [v 포함, v 미포함] +dp_mat = [[0,0] for _ in range(n+1)] +# print(stat) +def dp(v): + con = 0 + for nei in tree[v]: + dp(nei) + + # Node v를 사용하지 않는 경우 -> max(dp_mat[nei]) 선택 + # nei가 멘토든 아니든 상관 없이 가장 큰 경우만 가져오면 됨 + dp_mat[v][1] += max(dp_mat[nei][0], dp_mat[nei][1]) + + # Node v를 사용하는 경우 -> 취사선택이 필요함! + # 이 경우 nei 중 하나 x를 선택해서 v의 멘티로 삼게 됨 + # x를 제외한 나머지 nei는 max(dp_mat[nei]) 취사선택 + # x를 멘티로 삼는 경우, x가 멘토인 경우와 아닌 경우를 고려해야 함 + # dp_mat[v][1] 연산 시 dp_mat[x][1](x 미포함)을 사용하면 문제 없음 + # 만약 dp_mat[nei][0]을 사용했다면 x의 멘토 관계를 해제하고 v의 멘티로 삼아야 함 + # 이 경우 무조건 dp_mat[x][0] 대신 dp_mat[x][1]을 사용해야 함 + # dp_mat[v][1]에 영향이 가게 됨 -> 이 영향을 con으로 계산, con을 가장 크게 만드는 x 선택 + con = max(con, stat[v-1]*stat[nei-1] - max(dp_mat[nei][0]-dp_mat[nei][1], 0)) + dp_mat[v][0] = dp_mat[v][1]+con + +dp(1) +print(max(dp_mat[1])) diff --git a/solution/dynamic_programming_on_trees/1949/main.cpp b/solution/dynamic_programming_on_trees/1949/main.cpp new file mode 100644 index 0000000..ba0a352 --- /dev/null +++ b/solution/dynamic_programming_on_trees/1949/main.cpp @@ -0,0 +1,39 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/627e3feffb1842298d6d7ce3093e807b +#include + +using namespace std; + +const int MAXN = 10005; +vector graph[MAXN]; +int cost[MAXN], DP[MAXN][2]; + +void dfs(int cur, int prv) { + for(auto &nxt: graph[cur]) { + if(nxt == prv) continue; + dfs(nxt, cur); + DP[cur][0] += max(DP[nxt][0], DP[nxt][1]); + DP[cur][1] += DP[nxt][0]; + } + DP[cur][1] += cost[cur]; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int n; cin >> n; + for(int i=1;i<=n;i++) cin >> cost[i]; + for(int i=1;i< n;i++) { + int a, b; cin >> a >> b; + graph[a].push_back(b); + graph[b].push_back(a); + } + + dfs(1, 1); + cout << max(DP[1][0], DP[1][1]) << '\n'; + + return 0; +} + diff --git a/solution/dynamic_programming_on_trees/2213/main.cpp b/solution/dynamic_programming_on_trees/2213/main.cpp new file mode 100644 index 0000000..50581a2 --- /dev/null +++ b/solution/dynamic_programming_on_trees/2213/main.cpp @@ -0,0 +1,52 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/915dd2a773bc42b0ac94966f6ef852e6 +#include + +using namespace std; + +const int MAXN = 10005; +vector graph[MAXN], answer; +int cost[MAXN], DP[MAXN][2]; +bool used[MAXN]; + +void dfs(int cur, int prv) { + for(auto &nxt: graph[cur]) { + if(nxt == prv) continue; + dfs(nxt, cur); + DP[cur][0] += max(DP[nxt][0], DP[nxt][1]); + DP[cur][1] += DP[nxt][0]; + } + DP[cur][1] += cost[cur]; + used[cur] = DP[cur][1] > DP[cur][0]; +} + +void trace(int cur, int prv) { + if(used[cur]) answer.push_back(cur); + for(auto &nxt: graph[cur]) { + if(nxt == prv)continue; + if(used[cur]) used[nxt] = 0; + trace(nxt, cur); + } +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int n; cin >> n; + for(int i=1;i<=n;i++) cin >> cost[i]; + for(int i=1;i< n;i++) { + int a, b; cin >> a >> b; + graph[a].push_back(b); + graph[b].push_back(a); + } + + dfs(1, 1); + trace(1, 1); + cout << max(DP[1][0], DP[1][1]) << '\n'; + sort(answer.begin(), answer.end()); + for(auto &i: answer)cout << i << ' ' ; + + return 0; +} diff --git a/solution/dynamic_programming_on_trees/2533/main.cpp b/solution/dynamic_programming_on_trees/2533/main.cpp new file mode 100644 index 0000000..2f5692d --- /dev/null +++ b/solution/dynamic_programming_on_trees/2533/main.cpp @@ -0,0 +1,50 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/24e0aea2f2c84d92a8c69035eb07916a +#include + +using namespace std; + +vector> graph, group; +vector DP[2]; + +void dfs(int cur, int prv) { + for(auto &nxt: graph[cur]) { + if(nxt == prv)continue; + group[cur].push_back(nxt); + dfs(nxt, cur); + } +} + +int go(int cur, int toggle) { + int &ret = DP[toggle][cur]; + if(ret != -1)return ret; + ret = toggle; + + for(auto &nxt: group[cur]) { + if(toggle) ret += min(go(nxt, 0), go(nxt, 1)); + else ret += go(nxt, 1); + } + return ret; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int n; cin >> n; + graph.resize(n + 1); + group.resize(n + 1); + DP[0] = DP[1] = vector(n + 1, -1); + + for(int i=1;i> a >> b; + graph[a].emplace_back(b); + graph[b].emplace_back(a); + } + + dfs(1, 1); + cout << min(go(1, 0), go(1, 1)); + + return 0; +} diff --git a/solution/graph_traversal/1012/main.py b/solution/graph_traversal/1012/main.py new file mode 100644 index 0000000..f5d32f8 --- /dev/null +++ b/solution/graph_traversal/1012/main.py @@ -0,0 +1,42 @@ +#Authored by : gkgg123 +#Co-authored by : - +#Link : https://www.acmicpc.net/source/share/061583cd645e449d9936ecd6491016f4 +import sys +from collections import deque + +def input(): + return sys.stdin.readline().rstrip() + +def bfs(x, y): + queue = deque() + queue.append((x, y)) + visited[x][y] = True + while queue: + x,y = queue.popleft() + for i in range(4): + nx = x + dx[i] + ny = y + dy[i] + if not (0<=nx +using namespace std; +int N; +vector> G(100005); +int parent[100005]; + +void dfs(int cur) { + for (const int &nxt : G[cur]) { + if (parent[cur] == nxt) continue; + parent[nxt] = cur; + dfs(nxt); + } +} + +int main() { + cin.tie(nullptr); + ios::sync_with_stdio(false); + cin >> N; + for (int i = 0; i < N - 1; ++i) { + int u, v; + cin >> u >> v; + G[u].push_back(v); + G[v].push_back(u); + } + dfs(1); + for (int i = 2; i <= N; ++i) cout << parent[i] << '\n'; + return 0; +} diff --git a/solution/graph_traversal/1260/main.cpp b/solution/graph_traversal/1260/main.cpp new file mode 100644 index 0000000..47e6971 --- /dev/null +++ b/solution/graph_traversal/1260/main.cpp @@ -0,0 +1,59 @@ +// Authored by : seastar105 +// Co-authored by : - +// Link : http://boj.kr/1b2b0b0081d042e2a24298d188de8ba1 +#include +using namespace std; +int N, M, V; +vector> G(1005); +vector dfs_order, bfs_order; +bool vis[1005]; + +void dfs(int cur) { + vis[cur] = true; + dfs_order.push_back(cur); + for (const int &nxt : G[cur]) { + if (!vis[nxt]) + dfs(nxt); + } +} + +void bfs(int src) { + queue q; + vis[src] = true; + q.push(src); + while (!q.empty()) { + int cur = q.front(); + q.pop(); + bfs_order.push_back(cur); + for (const int &nxt : G[cur]) { + if (!vis[nxt]) { + vis[nxt] = true; + q.push(nxt); + } + } + } +} + +int main() +{ + cin.tie(nullptr); + ios::sync_with_stdio(false); + cin >> N >> M >> V; + for (int i = 0; i < M; ++i) { + int u, v; + cin >> u >> v; + G[u].push_back(v); + G[v].push_back(u); + } + // 번호가 더 빠른 정점을 방문하기 위해서 인접 리스트를 정점 번호순으로 정렬 + for (int i = 1; i <= N; ++i) sort(G[i].begin(), G[i].end()); + memset(vis, false, sizeof(vis)); + dfs(V); + memset(vis, false, sizeof(vis)); + bfs(V); + for (const int &x : dfs_order) cout << x << ' '; + cout << '\n'; + for (const int &x : bfs_order) cout << x << ' '; + cout << '\n'; + return 0; +} diff --git a/solution/graph_traversal/1325/main.cpp b/solution/graph_traversal/1325/main.cpp new file mode 100644 index 0000000..44c7957 --- /dev/null +++ b/solution/graph_traversal/1325/main.cpp @@ -0,0 +1,45 @@ +// Authored by : seastar105 +// Co-authored by : - +// Link : http://boj.kr/1b2b0b0081d042e2a24298d188de8ba1 +#include +using namespace std; +int N, M; +vector> G(100005); +bool vis[100005]; +int comp_cnt; + +void dfs(int cur) { + vis[cur] = true; + ++comp_cnt; + for (const int &nxt : G[cur]) { + if (!vis[nxt]) dfs(nxt); + } +} + +int main() { + cin.tie(nullptr); + ios::sync_with_stdio(false); + cin >> N >> M; + for (int i = 0; i < M; ++i) { + // u v가 주어지면 v가 해킹됐을 때 u도 해킹된다. + int u, v; + cin >> u >> v; + G[v].push_back(u); + } + vector ans; + int max_cnt = -1; + for (int i = 1; i <= N; ++i) { + memset(vis, false, N + 1); + comp_cnt = 0; + dfs(i); + if (max_cnt < comp_cnt) { + max_cnt = comp_cnt; + ans.clear(); + ans.push_back(i); + } + else if (max_cnt == comp_cnt) ans.push_back(i); + } + for (const int &x : ans) cout << x << ' '; + cout << '\n'; + return 0; +} diff --git a/solution/graph_traversal/13549/main.cpp b/solution/graph_traversal/13549/main.cpp new file mode 100644 index 0000000..6e7af18 --- /dev/null +++ b/solution/graph_traversal/13549/main.cpp @@ -0,0 +1,40 @@ +// author : seastar105 +// Co-author : - +// Link : http://boj.kr/08105c2def084cadbdf8ee2e4549d525 +#include +using namespace std; +const int MAX = 100000; +int dist[100005]; +int N, K; + +int main() { + cin.tie(nullptr); ios::sync_with_stdio(false); + cin >> N >> K; + memset(dist, -1, sizeof(dist)); + queue q; + dist[N] = 0; + q.push(N); + while(!q.empty()) { + int cur = q.front(); + q.pop(); + int pw = cur * 2; + while(0 <= pw && pw <= MAX) { + if(dist[pw] == -1) { + dist[pw] = dist[cur]; + q.push(pw); + } + else break; + pw *= 2; + } + if(cur > 0 && dist[cur-1] == -1) { + dist[cur-1] = dist[cur] + 1; + q.push(cur-1); + } + if(cur < MAX && dist[cur+1] == -1) { + dist[cur+1] = dist[cur] + 1; + q.push(cur+1); + } + } + cout << dist[K] << '\n'; + return 0; +} diff --git a/solution/graph_traversal/14502/main.cpp b/solution/graph_traversal/14502/main.cpp new file mode 100644 index 0000000..9cf3746 --- /dev/null +++ b/solution/graph_traversal/14502/main.cpp @@ -0,0 +1,74 @@ +// Authored by : seastar105 +// Co-authored by : - +// Link : http://boj.kr/06e81c4ff5a74105a074835a38318b13 +#include +using namespace std; +int dx[4] = {0, 0, -1, 1}; +int dy[4] = {-1, 1, 0, 0}; +int a[10][10]; +bool vis[10][10]; +int N, M; +vector> empty_cell; +int ans; + +bool valid(int x, int y) { + return 0<=x && x> q; + memset(vis, false, sizeof(vis)); + for(int i=0;i> q; + q.push({i, j}); + vis[i][j] = true; + while(!q.empty()) { + int x = q.front().first; + int y = q.front().second; + q.pop(); + for(int k=0;k<4;++k) { + int nx = x + dx[k]; + int ny = y + dy[k]; + if(!valid(nx, ny) || vis[nx][ny]) continue; + if(a[nx][ny] == 1) continue; + vis[nx][ny] = true; + q.push({nx, ny}); + } + } + } + } + } + int safe = 0; + for(int i=0;i> N >> M; + for(int i=0;i> a[i][j]; + if(a[i][j] == 0) empty_cell.emplace_back(i, j); + } + } + dfs(0, 0); + cout << ans << '\n'; + return 0; +} diff --git a/solution/graph_traversal/14502/main.py b/solution/graph_traversal/14502/main.py new file mode 100644 index 0000000..4acd002 --- /dev/null +++ b/solution/graph_traversal/14502/main.py @@ -0,0 +1,82 @@ +# Authored by : unodostre +# Co-authored by : - +# Link : http://boj.kr/8fcc7b5fbb884f788d0a0ad88803d046 + +import sys +from collections import deque +from itertools import combinations + +input = sys.stdin.readline +direction = [(0, 1), (-1, 0), (0, -1), (1, 0)] + + +def get_pos(): + empty, virus = [], [] + for i in range(n): + for j in range(m): + # 비었다면 empty에 추가 + if arr[i][j] == 0: + empty.append((i, j)) + # 바이러스라면 virus에 추가 + elif arr[i][j] == 2: + virus.append((i, j)) + return empty, virus + + +def set_wall(comb): + for y, x in comb: + arr[y][x] = 1 + + +def collapse_wall(comb): + for y, x in comb: + arr[y][x] = 0 + + +def bfs(virus): + queue = deque(virus) + visited = [[False] * m for _ in range(n)] # 방문 여부 + count = len(virus) # 바이러스 개수 + while queue: + q_size = len(queue) + for _ in range(q_size): + y, x = queue.popleft() + visited[y][x] = True # 방문 처리 + for dy, dx in direction: + ny, nx = y + dy, x + dx + # 지도 내에 있고 + if (0 <= ny < n) and (0 <= nx < m): + # 빈 공간이고 방문하지 않았다면 + if arr[ny][nx] == 0 and not visited[ny][nx]: + visited[ny][nx] = True # 방문 처리 + queue.append((ny, nx)) # 큐에 삽입 + count += 1 # 바이러스 개수 +1 + return count + + +# 입력 +n, m = map(int, input().split()) +arr = [list(map(int, input().split())) for _ in range(n)] + +empty, virus = get_pos() # 빈 위치, 바이러스 위치 +combs = combinations(empty, 3) # 벽을 세울 수 있는 조합 + +count = int(1e9) # 바이러스 개수 +# 모든 조합에 대해서 +for comb in combs: + # 벽 세우기 + set_wall(comb) + + # 바이러스 전염 + temp = bfs(virus) + if temp < count: + count = temp + + # 벽 허물기 + collapse_wall(comb) + +# 벽의 개수 계산 +wall = n * m - (len(empty) + len(virus)) + +# 출력 +print(n * m - (count + wall + 3)) diff --git a/solution/graph_traversal/14716/main.py b/solution/graph_traversal/14716/main.py new file mode 100644 index 0000000..d71101d --- /dev/null +++ b/solution/graph_traversal/14716/main.py @@ -0,0 +1,32 @@ +# Authored by : chj3748 +# Co-authored by : tony9402 +# Link : http://boj.kr/b5d154fcfb1c46e6a99e702c35f4eb26 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +M, N = map(int, input().split()) +banner = [list(map(int, input().split())) for _ in range(M)] +dirx = (1, 0, -1, 0, 1, 1, -1, -1) +diry = (0, 1, 0, -1, 1, -1, 1, -1) + +def find_string(row, col): + stack = [(row, col)] + banner[row][col] = 0 + while stack: + x, y = stack.pop() + for dx, dy in zip(dirx, diry): + nx, ny = x + dx, y + dy + if 0 <= nx < M and 0 <= ny < N and banner[nx][ny]: + stack.append((nx, ny)) + banner[nx][ny] = 0 + return 1 + +string_cnt = 0 +for i in range(M): + for j in range(N): + if banner[i][j]: + string_cnt += find_string(i, j) + +print(string_cnt) diff --git a/solution/graph_traversal/14940/Main.java b/solution/graph_traversal/14940/Main.java new file mode 100644 index 0000000..f40b4f7 --- /dev/null +++ b/solution/graph_traversal/14940/Main.java @@ -0,0 +1,116 @@ +//Authored by : suin8 +//Co-authored by : - +//Link : http://boj.kr/07019ff960d14af3840cf2210023fbf3 + +import java.util.*; +import java.io.*; + +class Pair{ + int x, y; + Pair(int x, int y){ + this.x = x; + this.y = y; + } +} + +public class Main { + static int[][] map, distance; + static int[] dx = {1, 0, -1, 0}; + static int[] dy = {0, 1, 0, -1}; + static int n, m; + static boolean[][] visited; + + public static void main(String[] args) { + FastReader rd = new FastReader(); + + n = rd.nextInt(); + m = rd.nextInt(); + + map = new int[n + 10][m + 10]; + distance = new int[n + 10][m + 10]; + visited = new boolean[n + 10][m + 10]; + + // 목표지점 저장 + int destX = 0, destY = 0; + for(int i = 1;i <= n;i++) { + for(int j = 1;j <= m;j++) { + map[i][j] = rd.nextInt(); + + if(map[i][j] == 2) { + destX = i; + destY = j; + } + } + } + + // 목표지점을 기준으로 bfs를 진행하여 + // 각 위치별로 얼만큼 떨어져 있는지 구한다. + bfs(destX, destY); + + // 거리가 0인데 map값이 1이면 갈 수 없는 좌표이다 따라서 -1 + for(int i = 1;i <= n;i++) { + for(int j = 1;j <= m ;j++) { + if(distance[i][j] == 0 && map[i][j] == 1) + System.out.print("-1 "); + else + System.out.print(distance[i][j] + " "); + } + System.out.print("\n"); + } + } + + static void bfs(int X, int Y) { + Queue q = new LinkedList<>(); + q.add(new Pair(X, Y)); + visited[X][Y] = true; + + while(!q.isEmpty()) { + Pair cur = q.poll(); + + for(int i = 0;i < 4;i++) { + int nextx = cur.x + dx[i]; + int nexty = cur.y + dy[i]; + + if(nextx <= 0 || nexty <= 0 || nextx > n || nexty > m) continue; + if(visited[nextx][nexty] == true || map[nextx][nexty] == 0) continue; + + q.add(new Pair(nextx, nexty)); + distance[nextx][nexty] = distance[cur.x][cur.y] + 1; + visited[nextx][nexty] = true; + } + } + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} diff --git a/solution/graph_traversal/16174/main.py b/solution/graph_traversal/16174/main.py new file mode 100644 index 0000000..cab8d08 --- /dev/null +++ b/solution/graph_traversal/16174/main.py @@ -0,0 +1,30 @@ +# // Authored by : chj3748 +# // Co-authored by : tony9402 +# // Link : http://boj.kr/4d17bddef7af409ebdb384693b3f96d9 +import sys +from collections import deque + +def input(): + return sys.stdin.readline().rstrip() + +dirx = (0, 1) +diry = (1, 0) +N = int(input()) +maps = [list(map(int, input().split())) for _ in range(N)] +inf = float('inf') + +q = deque() +q.append((0, 0)) +while q: + x, y = q.popleft() + if x == N - 1 and y == N - 1: + print('HaruHaru') + exit(0) + + for dx, dy in zip(dirx, diry): + nx, ny = x + dx * maps[x][y], y + dy * maps[x][y] + if 0 <= nx < N and 0 <= ny < N: + q.append((nx, ny)) + maps[x][y] = inf + +print('Hing') diff --git a/solution/graph_traversal/16234/main.cpp b/solution/graph_traversal/16234/main.cpp new file mode 100644 index 0000000..82028db --- /dev/null +++ b/solution/graph_traversal/16234/main.cpp @@ -0,0 +1,75 @@ +// Authored by : seastar105 +// Co-authored by : - +// Link : https://www.acmicpc.net/source/share/628806951c694c76a58fa0c5e510d10f +#include + +using namespace std; + +int dy[4] = {-1, 1, 0, 0}; +int dx[4] = {0, 0, -1, 1}; +int N; +int a[55][55]; +bool vis[55][55]; +int L, R; + +bool valid(int y, int x) { + return 0 <= y && y < N && 0 <= x && x < N; +} + +bool bfs() { + bool flag = false; + queue> q; + vector>> comp; + vector comp_pop; + memset(vis, false, sizeof(vis)); + // bfs + for(int i=0;i> cur; + int sum = 0; + q.emplace(i, j); + vis[i][j] = true; + while(!q.empty()) { + int y = q.front().first; + int x = q.front().second; + q.pop(); + sum += a[y][x]; + cur.emplace_back(y, x); + for(int k=0;k<4;++k) { + int ny = y + dy[k]; + int nx = x + dx[k]; + int diff = abs(a[y][x] - a[ny][nx]); + if(!valid(ny, nx) || vis[ny][nx]) continue; + if(diff > R || diff < L) continue; + flag = true; + vis[ny][nx] = true; + q.emplace(ny, nx); + } + } + comp.push_back(cur); + comp_pop.push_back(sum); + } + } + if(!flag) return false; + // population moving + for(int i=0;i p : comp[i]) a[p.first][p.second] = pop; + } + return true; +} + +int main() { + cin.tie(nullptr); ios::sync_with_stdio(false); + cin >> N >> L >> R; + for(int i=0;i> a[i][j]; + } + } + int ans = 0; + while(bfs()) ++ans; + cout << ans << '\n'; + return 0; +} diff --git a/solution/graph_traversal/16918/main.cpp b/solution/graph_traversal/16918/main.cpp new file mode 100644 index 0000000..ba2a140 --- /dev/null +++ b/solution/graph_traversal/16918/main.cpp @@ -0,0 +1,59 @@ +// Authored by : seastar105 +// Co-authored by : - +// Link : http://boj.kr/f78a96ebfe9a42648e1e0bc67255916a +#include +using namespace std; +int R, C, N; +int dx[4] = {-1, 1, 0, 0}; +int dy[4] = {0, 0, -1, 1}; +vector a(201); +int fire_time[201][201]; + +bool valid(int x, int y) { + return 0<=x && x> R >> C >> N; + for(int i=0;i> a[i]; + for(int j=0;j q = new LinkedList<>(); + q.add(new Point(8, 1)); + + while(!q.isEmpty()) { + int check = q.size(); + + // 현재위치에서 다음 위치로 갈 수 있는 곳을 큐에 집어 넣고 + // 다음 while roop때 큐안의 모든 값들을 검사한 후에 벽을 움직여야 한다. + // 그렇지 않으면 벽만 계속 이동하는 상황이 벌어진다. + for(int i = 0;i < check;i++) { + Point cur = q.poll(); + // 현재 위치가 벽과 같은 위치(즉 벽에 깔린 상황)라면 넘어간다. + if(chess[cur.y][cur.x] == '#') continue; + + // 도착점 이거나 또는 벽이 없어서 반드시 도착점에 도달할 수 있는 상황. + if(cur.y == 1 && cur.x == 8 || wall_count == 0) return true; + + // 8방향 + 제자리 위치까지 총 9방향을 검사하여 큐에 넣는다. + for(int j = 0;j < 9;j++) { + int nexty = cur.y + dy[j]; + int nextx = cur.x + dx[j]; + + if(nextx <= 0 || nexty <= 0 || nextx > 8 || nexty > 8) continue; + if(visited[nexty][nextx] == true || chess[nexty][nextx] == '#') continue; + + visited[nexty][nextx] = true; + q.add(new Point(nexty, nextx)); + } + } + + // 이동하였다가 다시 되돌아 올 수 있기 때문에 초기화. + for(int i = 0;i < 10;i++) + Arrays.fill(visited[i], false); + + // 벽이 남아있을 때 벽을 옮긴다. + if(wall_count > 0) moveWall(); + } + return false; + } + + static void moveWall() { + for(int i = 8;i > 0;i--) { + for(int j = 1;j <= 8;j++) { + if(chess[i][j] != '#') continue; + + int nextwall = i + 1; + if(nextwall <= 8) { + chess[nextwall][j] = '#'; + chess[i][j] = '.'; + } + else { + chess[i][j] = '.'; + wall_count--; + } + } + } + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} diff --git a/solution/graph_traversal/16954/main.cpp b/solution/graph_traversal/16954/main.cpp new file mode 100644 index 0000000..c6f4693 --- /dev/null +++ b/solution/graph_traversal/16954/main.cpp @@ -0,0 +1,92 @@ +//Authored by : suin8 +//Co-authored by : - +//Link : http://boj.kr/1744c1e07a70449ba28fd54faab4b25b +#include + +using namespace std; + +char chess[10][10]; +bool visited[10][10]; +int wall_count = 0; +int dx[] = {1, 0, -1, 0, 1, -1, 1, -1, 0}; +int dy[] = {0, 1, 0, -1, -1, 1, 1, -1, 0}; + +void moveWall() { + for(int i = 8;i > 0;i--) { + for(int j = 1;j <= 8;j++) { + if(chess[i][j] != '#') continue; + + int nextwall = i + 1; + if(nextwall <= 8) { + chess[nextwall][j] = '#'; + chess[i][j] = '.'; + } + else { + chess[i][j] = '.'; + wall_count--; + } + } + } +} + +bool bfs() { + queue> q; + q.push(make_pair(8, 1)); + + // 현재위치에서 다음 위치로 갈 수 있는 곳을 큐에 집어넣고 + // 다음 while roop에서 전에 넣었던 위치를 반드시 다 방문한 후 + // 벽을 움직여야한다. 따라서 check이 queue의 크기를 저장하고 + // check만큼 다 방문한 후에 moveWall()을 실행한다. + // 그래야 갈 수 있는 모든 경우의 수를 확인할 수 있다. + while(!q.empty()) { + int check = q.size(); + + for(int i = 0;i < check;i++) { + pair cur = q.front(); + q.pop(); + + if(chess[cur.first][cur.second] == '#') continue; + + if((cur.first == 1 && cur.second == 8) || wall_count == 0) return true; + + // 8방향 + 제자리 총 9방향을 검사합니다. + for(int j = 0;j < 9;j++) { + int nexty = cur.first + dy[j]; + int nextx = cur.second + dx[j]; + + if(nextx <= 0 || nexty <= 0 || nextx > 8 || nexty > 8) continue; + if(visited[nexty][nextx] == true || chess[nexty][nextx] == '#') continue; + + visited[nexty][nextx] = true; + q.push(make_pair(nexty, nextx)); + } + } + + for(int i = 0;i < 10;i++) + memset(visited[i], false, 10 * sizeof(bool)); + + if(wall_count > 0) moveWall(); + } + + return false; +} + +int main() { + ios::sync_with_stdio(false); + cin.tie(nullptr); + + // 입력과 동시에 벽 개수를 카운트 합니다. + for(int i = 1;i <= 8;i++) { + string str; + cin >> str; + for(int j = 1;j <= 8;j++) { + chess[i][j] = str[j - 1]; + if(chess[i][j] == '#') wall_count++; + } + } + + if(bfs() == true) cout << "1"; + else cout << "0"; + + return 0; +} diff --git a/solution/graph_traversal/16954/main.py b/solution/graph_traversal/16954/main.py new file mode 100644 index 0000000..acef628 --- /dev/null +++ b/solution/graph_traversal/16954/main.py @@ -0,0 +1,37 @@ +# Authored by : yj2221 +# Co-authored by : - +# Link : http://boj.kr/d903976eaa454c208a0a75092a20d1c6 + +from collections import deque +import sys +def input(): + return sys.stdin.readline().rstrip() + +board = [list(input()) for _ in range(8)] + +def bfs(board): + end = (0,7) + que = deque() + que.append((7,0,0)) + visit = [[[False] * 8 for _ in range(8)] for _ in range(9)] + visit[0][7][0] = True + dy = [0,0,0,-1,1,-1,1,-1,1] + dx = [0,-1,1,0,0,-1,1,1,-1] + result = 0 + while que: + y,x,time = que.popleft() + if y==end[0] and x==end[1]: + result = 1 + break + for i in range(9): + ny, nx = y + dy[i], x + dx[i] + ntime = min(time + 1, 8) + if ny<0 or ny>=8 or nx<0 or nx>=8: continue + if ny-time>=0 and board[ny-time][nx]=='#': continue + if ny-ntime>=0 and board[ny-ntime][nx]=='#': continue + if visit[ntime][ny][nx]: continue + visit[ntime][ny][nx] = True + que.append((ny,nx,ntime)) + return result + +print(bfs(board)) diff --git a/solution/graph_traversal/1707/main.py b/solution/graph_traversal/1707/main.py new file mode 100644 index 0000000..caa426a --- /dev/null +++ b/solution/graph_traversal/1707/main.py @@ -0,0 +1,42 @@ +# Authored by : cieske +# Co-authored by : - +# Link : http://boj.kr/314d8f401cf149b3a24d0daf8e0a3637 +import sys +def input(): + return sys.stdin.readline().rstrip() +sys.setrecursionlimit(1000000) + +def dfs(cur): + flag = True + visited[cur] = True + for nei in graph[cur]: + if visited[nei]: + if label[cur] == label[nei]: #만약 neighbor node와 label이 같다면? + return False # Bipartite graph가 아니다! + else: + label[nei] = 3 - label[cur] # 현재 node와 다른 label 저장 + flag &= dfs(nei) + return flag + + +k = int(input()) +for _ in range(k): + v, e = map(int, input().split()) + graph = [[] for i in range(v+1)] + for i in range(e): # Graph 생성, Node 번호는 1번부터 저장 + x, y = map(int, input().split()) + graph[x].append(y) + graph[y].append(x) + + visited = [True] + [False]*v + label = [0]*(v+1) # 모든 node의 label을 1 또는 2로 저장할 것임 + bipartite = True + for i in range(1, v+1): # 주어지는 모든 node가 하나의 connected graph에 없을 수 있음 + if not visited[i]: + label[i] = i + bipartite &= dfs(i) # 각 graph마다 최소 한 번씩 dfs를 돌려야 함 + if not bipartite: break # 그 중 하나라도 bipartite가 아니면 중지 + if bipartite: + print("YES") + else: + print("NO") diff --git a/solution/graph_traversal/1726/main.py b/solution/graph_traversal/1726/main.py new file mode 100644 index 0000000..6443348 --- /dev/null +++ b/solution/graph_traversal/1726/main.py @@ -0,0 +1,62 @@ +# Authored by : yj2221 +# Co-authored by : - +# Link : http://boj.kr/c707bb0afebf42d3adaad7fee180a45a + +import sys +from collections import deque +def input(): + return sys.stdin.readline().rstrip() + +m, n = map(int,input().split()) +board = [list(map(int,input().split())) for _ in range(m)] +start = list(map(int,input().split())) +start[0]-=1 +start[1]-=1 +end = list(map(int,input().split())) +end[0]-=1 +end[1]-=1 + +def move(dir): + if dir==1: + return 0, 1 + if dir==2: + return 0, -1 + if dir==3: + return 1, 0 + if dir==4: + return -1, 0 + +def bfs(): + y, x, dir = start + visit = [[[False] * n for _ in range(m)] for _ in range(5)] + visit[dir][y][x] = True + q = deque() + q.append((y, x, dir, 0)) + result = 0 + while q: + y, x, dir, cnt = q.popleft() + if y==end[0] and x==end[1] and dir==end[2]: + result = cnt + break + for i in range(1, 4): + dy,dx = move(dir) + ny = y + dy * i + nx = x + dx * i + if ny<0 or ny>=m or nx<0 or nx>=n: break + if board[ny][nx]==1: break + if visit[dir][ny][nx]: continue + visit[dir][ny][nx] = True + q.append((ny, nx, dir, cnt+1)) + + for next_dir in range(1, 5): + if dir==next_dir: continue + if visit[next_dir][y][x]: continue + visit[next_dir][y][x] = True + if (dir==1 and next_dir==2) : q.append((y, x, next_dir, cnt+2)) + elif (dir==2 and next_dir==1) : q.append((y, x, next_dir, cnt+2)) + elif (dir==3 and next_dir==4) : q.append((y, x, next_dir, cnt+2)) + elif (dir==4 and next_dir==3) : q.append((y, x, next_dir, cnt+2)) + else: q.append((y, x, next_dir, cnt+1)) + return result + +print(bfs()) diff --git a/solution/graph_traversal/17836/Main.java b/solution/graph_traversal/17836/Main.java new file mode 100644 index 0000000..840791d --- /dev/null +++ b/solution/graph_traversal/17836/Main.java @@ -0,0 +1,116 @@ +//Authored by : suin8 +//Co-authored by : - +//Link : http://boj.kr/d70329d0bfa74ad692b57abcff5fc0b3 + +import java.util.*; +import java.io.*; + +class Point { + int x, y; + Point(int x, int y){ + this.x = x; + this.y = y; + } +} + +public class Main { + static int N, M, T; + static int[][] castle, distance; + static int[] dx = {1, 0, -1, 0}; + static int[] dy = {0, 1, 0, -1}; + static boolean[][] visited; + static Point sword; + + public static void main(String[] args) { + FastReader rd = new FastReader(); + + N = rd.nextInt(); + M = rd.nextInt(); + T = rd.nextInt(); + + castle = new int[N + 10][M + 10]; + distance = new int[N + 10][M + 10]; + visited = new boolean[N + 10][M + 10]; + + for(int i = 1;i <= N;i++) { + for(int j = 1;j <= M;j++) { + castle[i][j] = rd.nextInt(); + if(castle[i][j] == 2) + sword = new Point(i, j); + } + } + + // bfs로 각 지점까지 거리를 구해놓는다. + bfs(); + + int use_sword = Integer.MAX_VALUE, not_use_sword = Integer.MAX_VALUE; + + // 검을 사용했을 때 걸리는 시간. 구하지 못하는 경우는 int형 최대값 + if(distance[sword.x][sword.y] != 0) + use_sword = distance[sword.x][sword.y] + (N - sword.x) + (M - sword.y); + + // 검을 사용하지 않고 걸리는 시간. 구하지 못하는 경우는 int형 최대값 + if(distance[N][M] != 0) + not_use_sword = distance[N][M]; + + // 둘 중 작은 값을 T보다 작을때만 출력, 그 외는 Fail출력 + if(Math.min(use_sword, not_use_sword) > T) + System.out.println("Fail"); + else System.out.println(Math.min(use_sword, not_use_sword)); + } + + static void bfs() { + Queue q = new LinkedList<>(); + q.add(new Point(1, 1)); + visited[1][1] = true; + + while(!q.isEmpty()) { + Point cur = q.poll(); + + for(int i = 0;i < 4;i++) { + int nextx = cur.x + dx[i]; + int nexty = cur.y + dy[i]; + + if(nextx <= 0 || nexty <= 0 || nextx > N || nexty > M) continue; + if(visited[nextx][nexty] == true || castle[nextx][nexty] == 1) continue; + + q.add(new Point(nextx, nexty)); + visited[nextx][nexty] = true; + distance[nextx][nexty] = distance[cur.x][cur.y] + 1; + } + } + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} diff --git a/solution/graph_traversal/17836/main.cpp b/solution/graph_traversal/17836/main.cpp new file mode 100644 index 0000000..fd1c886 --- /dev/null +++ b/solution/graph_traversal/17836/main.cpp @@ -0,0 +1,72 @@ +//Authored by : suin8 +//Co-authored by : - +//Link : http://boj.kr/9d2150583b8f404997ceb816aca057ac + +#include + +using namespace std; + +int castle[110][110], dist[110][110]; +int N, M, T; +int dx[] = {1, 0, -1, 0}; +int dy[] = {0, 1, 0, -1}; +bool visited[110][110]; +pair sword; + +void bfs() { + queue> q; + q.push(make_pair(1, 1)); + visited[1][1] = true; + + while(!q.empty()) { + pair cur = q.front(); + q.pop(); + + for(int i = 0;i < 4;i++) { + int nextx = cur.first + dx[i]; + int nexty = cur.second + dy[i]; + + if(nextx <= 0 || nexty <= 0 || nextx > N || nexty > M) continue; + if(visited[nextx][nexty] == true || castle[nextx][nexty] == 1) continue; + + q.push(make_pair(nextx, nexty)); + visited[nextx][nexty] = true; + dist[nextx][nexty] = dist[cur.first][cur.second] + 1; + } + } +} + +int main() { + ios::sync_with_stdio(false); + cin.tie(nullptr); + + cin >> N >> M >> T; + + for(int i = 1;i <= N;i++) { + for(int j = 1;j <= M;j++) { + cin >> castle[i][j]; + if(castle[i][j] == 2) + sword = make_pair(i, j); + } + } + + bfs(); + + int use_sword = INT_MAX, not_use_sword = INT_MAX; + + // 검을 사용했을 때 걸리는 시간. 구하지 못하는 경우는 int형 최대값 + if(dist[sword.first][sword.second] != 0) + use_sword = dist[sword.first][sword.second] + (N - sword.first) + (M - sword.second); + + //검을 사용하지 않고 걸리는 시간. 구하지 못하는 경우는 int형 최대값 + if(dist[N][M] != 0) + not_use_sword = dist[N][M]; + + //둘 중 작은 값을 T보다 작을때만 출력, 그 외는 Fail출력 + int answer = min(use_sword, not_use_sword); + if(answer > T) + cout << "Fail"; + else cout << answer; + + return 0; +} diff --git a/solution/graph_traversal/18513/main.cpp b/solution/graph_traversal/18513/main.cpp new file mode 100644 index 0000000..efce892 --- /dev/null +++ b/solution/graph_traversal/18513/main.cpp @@ -0,0 +1,48 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/5bf67529d3a7434d9c53943021aff0ff +#include + +using namespace std; + +unordered_set st; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N, K; cin >> N >> K; + queue> Q; + vector V; + for(int i=0;i> x; + V.push_back(x); + st.insert(x); + } + for(auto x: V){ + if(st.count(x - 1) == 0) { + Q.emplace(x, x - 1); + st.insert(x - 1); + } + if(st.count(x + 1) == 0) { + Q.emplace(x, x + 1); + st.insert(x + 1); + } + } + long long answer = 0; + while(K--) { + auto [city, cur] = Q.front(); Q.pop(); + answer += abs(city - cur); + if(st.count(cur - 1) == 0) { + st.insert(cur - 1); + Q.emplace(city, cur - 1); + } + if(st.count(cur + 1) == 0) { + st.insert(cur + 1); + Q.emplace(city, cur + 1); + } + } + cout << answer; + + return 0; +} diff --git a/solution/graph_traversal/20924/main.py b/solution/graph_traversal/20924/main.py new file mode 100644 index 0000000..316458b --- /dev/null +++ b/solution/graph_traversal/20924/main.py @@ -0,0 +1,51 @@ +# Authored by : kis03160 +# Co-authored by : tony9402 +# Link : http://boj.kr/2cb5e18deb964794bec3e960225ad83e +from collections import deque +import sys + +def input(): + return sys.stdin.readline().rstrip() + +def answer(G, r): + is_giga_find = False + longest = 0 + body = 0 + visited = [False for _ in range(len(G))] + q = deque() + q.append((0, r)) + visited[r] = True + + while q: + dist, node = q.popleft() + + if dist > longest: + longest = dist + + # 기가 가지가 아직 안나왔고, 2개 이상 연결되어있을 때 + # or V자 + if not is_giga_find and len(G[node]) > 2 \ + or (node == r and len(G[node]) >= 2): + is_giga_find = True + body = dist + + for branch in G[node]: + if not visited[branch]: + visited[branch] = True + q.append((dist + G[node][branch], branch)) + + # 기가를 못찾았다 -> 가지가 없다. + if not is_giga_find: + body = longest + longest = body + + # 기둥, 가장 긴 가지 길이(루트~해당가지 길이 - 기둥 길이) + return body, longest - body + +n, r = map(int, input().split()) +G = {i: dict() for i in range(n + 1)} +for i in range(n - 1): + a, b, c = map(int, input().split()) + G[a][b] = c + G[b][a] = c +print(*answer(G, r)) diff --git a/solution/graph_traversal/2178/main.cpp b/solution/graph_traversal/2178/main.cpp new file mode 100644 index 0000000..bef8221 --- /dev/null +++ b/solution/graph_traversal/2178/main.cpp @@ -0,0 +1,43 @@ +// Authored by : seastar105 +// Co-authored by : - +// Link : http://boj.kr/f2e32398c22f4d8a8271253eaf590832 +#include +using namespace std; + +int dx[4] = {0, 0, -1, 1}; +int dy[4] = {-1, 1, 0, 0}; +int N, M; +string board[105]; +int dist[105][105]; + +bool valid(int x, int y) { + return 0 <= x && x < N && 0 <= y && y < M; +} + +int main() { + cin.tie(nullptr); + ios::sync_with_stdio(false); + cin >> N >> M; + for (int i = 0; i < N; ++i) cin >> board[i]; + memset(dist, -1, sizeof(dist)); + queue> q; + q.push({0, 0}); + dist[0][0] = 1; + while (!q.empty()) { + pair p = q.front(); + int x = p.first; + int y = p.second; + q.pop(); + for (int i = 0; i < 4; ++i) { + int nx = x + dx[i]; + int ny = y + dy[i]; + if (!valid(nx, ny)) continue; // out of bound + if (board[nx][ny] == '0') continue; // blocked + if (dist[nx][ny] != -1) continue; // already visited + dist[nx][ny] = dist[x][y] + 1; + q.push({nx, ny}); + } + } + cout << dist[N - 1][M - 1] << '\n'; + return 0; +} diff --git a/solution/graph_traversal/2206/main.py b/solution/graph_traversal/2206/main.py new file mode 100644 index 0000000..95504bd --- /dev/null +++ b/solution/graph_traversal/2206/main.py @@ -0,0 +1,69 @@ +# Authored by : kis03160 +# Co-authored by : tony9402 +# Link : http://boj.kr/2cb5e18deb964794bec3e960225ad83e +from collections import deque +import sys + +def input(): + return sys.stdin.readline().rstrip() + +def answer(row, col): + global m, n + + shortest = 10000001 + q = deque() + direction = [(1, 0), (0, 1), (-1, 0), (0, -1)] + visited = [[[0] * 2 for _ in range(m)] for _ in range(n)] + + q.append((row, col, 1)) + visited[row][col][1] = 1 + while q: + r, c, is_able = q.popleft() + for r_, c_ in direction: + drow = r + r_ + dcol = c + c_ + + if drow < 0 or dcol < 0 or drow >= n or dcol >= m: + continue + + if visited[drow][dcol][is_able] == 0 and G[drow][dcol] == '0': + visited[drow][dcol][is_able] = visited[r][c][is_able] + 1 + q.append((drow, dcol, is_able)) + + elif is_able == 1 and G[drow][dcol] == '1': + visited[drow][dcol][0] = visited[r][c][1] + 1 + q.append((drow, dcol, 0)) + + + shortest = visited[n - 1][m - 1] + return_val = None + if shortest[0] == 0 and shortest[1] == 0: + return_val = -1 + else: + if shortest[0] > shortest[1]: + return_val = shortest[1] + if return_val == 0: + return_val = shortest[0] + else: + return_val = shortest[0] + if return_val == 0: + return_val = shortest[1] + + return return_val + +n, m = map(int, input().split()) + +G = [] +walls = [] +for i in range(n): + x = [] + temp = input() + for j in range(m): + if temp[j] == '1': + walls.append((i, j)) + x.append('1') + else: + x.append('0') + G.append(x) + +print(answer(0, 0)) diff --git a/solution/graph_traversal/2589/main.py b/solution/graph_traversal/2589/main.py new file mode 100644 index 0000000..0b5138d --- /dev/null +++ b/solution/graph_traversal/2589/main.py @@ -0,0 +1,42 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/056db524c16f458c9bc7a5beb2c35da8 + +import sys +from collections import deque + +def input(): + return sys.stdin.readline().rstrip() + +def BFS(x,y): + queue = deque() + queue.append((x,y,0)) + visited[x][y] = 1 + while queue: + q = queue.popleft() + for i in range(4): + dx = nx[i] + q[0] + dy = ny[i] + q[1] + if dx < 0 or dx >= L or dy < 0 or dy >= W: + continue + if visited[dx][dy] == 0 and arr[dx][dy] == 'L': + visited[dx][dy] = 1 + queue.append((dx,dy,q[2]+1)) + return q[2] + +L, W = map(int, input().split()) +arr = [] +nx = [-1, 0, 1, 0] +ny = [0, -1, 0, 1] +MIN_CT = 0 + +for i in range(L): + arr.append(input()) + +for i in range(L): + for j in range(W): + if arr[i][j] == 'L': + visited = [[0 for i in range(W)] for j in range(L)] + ct = BFS(i,j) + MIN_CT = max(MIN_CT, ct) +print(MIN_CT) diff --git a/solution/graph_traversal/2606/main.cpp b/solution/graph_traversal/2606/main.cpp new file mode 100644 index 0000000..c1d99f0 --- /dev/null +++ b/solution/graph_traversal/2606/main.cpp @@ -0,0 +1,32 @@ +// Authored by : seastar105 +// Co-authored by : - +// Link : http://boj.kr/f4a2942a69264111a18e39d0c384209e +#include +using namespace std; +vector> G(105); +bool vis[105]; +int N, M; + +void dfs(int cur) { + vis[cur] = true; + for (const int &nxt : G[cur]) { + if (!vis[nxt]) dfs(nxt); + } +} + +int main() { + cin.tie(nullptr); + ios::sync_with_stdio(false); + cin >> N >> M; + for (int i = 0; i < M; ++i) { + int u, v; + cin >> u >> v; + G[u].push_back(v); + G[v].push_back(u); + } + dfs(1); + int ans = 0; + for (int i = 1; i <= N; ++i) ans += vis[i]; + cout << ans - 1 << '\n'; // except vertex 1 + return 0; +} diff --git a/solution/graph_traversal/2636/main.cpp b/solution/graph_traversal/2636/main.cpp new file mode 100644 index 0000000..8370ccb --- /dev/null +++ b/solution/graph_traversal/2636/main.cpp @@ -0,0 +1,65 @@ +// Authored by : bsoomin8734 +// Co-authored by : tony9402 +// Link : http://boj.kr/a7f85eb725a6477a919287e9e506db7b +#include +using namespace std; + +bool visited[101][101]; +int Map[101][101]; +int dir[4][2] = {{0, 1},{1, 0},{-1, 0},{0, -1}}; +int N, M; +queue > q; +int cnt = -1; +int result = 0; + +void init(){ + while(!q.empty()) q.pop(); + q.emplace(0, 0); + memset(visited, 0, sizeof(bool) * 101 * 101); +} + +int BFS(){ + int cur_melt = 0; + while(!q.empty()){ + pair cur = q.front(); + q.pop(); + + for(int i = 0; i < 4; i++){ + int x = cur.first + dir[i][0]; + int y = cur.second + dir[i][1]; + if(0 > x || x >= N || 0 > y || y >= M) continue; + if(visited[x][y]) continue; + if(Map[x][y] == 0){ + visited[x][y] = true; + q.emplace(x, y); + } else if(Map[x][y] == 1){ + visited[x][y] = true; + Map[x][y] = 0; + cur_melt++; + } + } + } + return cur_melt; +} + +int main(void) { + cin.tie(NULL); + ios::sync_with_stdio(false); + + cin >> N >> M; + for(int i = 0; i < N; i++) + for(int j = 0; j < M; j++) + cin >> Map[i][j]; + + while(1){ + init(); + cnt++; + int ret = BFS(); + if(ret == 0) break; + else result = ret; + } + + cout << cnt << '\n' << result << '\n'; + + return 0; +} diff --git a/solution/graph_traversal/2667/main.cpp b/solution/graph_traversal/2667/main.cpp new file mode 100644 index 0000000..a3359d9 --- /dev/null +++ b/solution/graph_traversal/2667/main.cpp @@ -0,0 +1,59 @@ +// Authored by : seastar105 +// Co-authored by : - +// Link : http://boj.kr/64816e87e7c24254ae15748732036df3 +#include +using namespace std; +int dx[4] = {0, 0, -1, 1}; +int dy[4] = {-1, 1, 0, 0}; +int N; +string board[30]; +bool vis[30][30]; + +bool valid(int x, int y) { + return 0 <= x && x < N && 0 <= y && y < N; +} + +int bfs(int src_x, int src_y) { + queue> q; + vis[src_x][src_y] = true; + q.push({src_x, src_y}); + int ret = 0; + while(!q.empty()) { + pair p = q.front(); + int x = p.first; + int y = p.second; + ++ret; + q.pop(); + for(int i=0;i<4;++i) { + int nx = x + dx[i]; + int ny = y + dy[i]; + if(!valid(nx, ny)) continue; + if(vis[nx][ny]) continue; + if(board[nx][ny] == '0') continue; + vis[nx][ny] = true; + q.push({nx, ny}); + } + } + return ret; +} + +int main() { + cin.tie(nullptr); + ios::sync_with_stdio(false); + cin >> N; + for (int i = 0; i < N; ++i) cin >> board[i]; + vector ans; + for (int i = 0; i < N; ++i) { + for (int j = 0; j < N; ++j) { + if (vis[i][j]) continue; + if (board[i][j] == '0') continue; + // BFS start + int cnt = bfs(i, j); + ans.push_back(cnt); + } + } + sort(ans.begin(), ans.end()); + cout << ans.size() << '\n'; + for (int x : ans) cout << x << '\n'; + return 0; +} diff --git a/solution/graph_traversal/4179/main.py b/solution/graph_traversal/4179/main.py new file mode 100644 index 0000000..68a5b57 --- /dev/null +++ b/solution/graph_traversal/4179/main.py @@ -0,0 +1,78 @@ +# Authored by : yj2221 +# Co-authored by : - +# Link : http://boj.kr/bf6009039d6b410291eb253279ce0c8f + +from collections import deque +import sys + +def input(): + return sys.stdin.readline().rstrip() + +r, c = map(int, input().split()) +board = [[-1] * (c+2) for _ in range(r+2)] +visit = [[False] * (c+2) for _ in range(r+2)] +q = deque() +fire_q = deque() +dy = [0, 0, -1, 1] +dx = [-1, 1, 0, 0] + +for i in range(1,r+1): + line = input() + for j in range(1,c+1): + if line[j-1]=='#': board[i][j] = 1 + elif line[j-1]=='.': board[i][j] = 0 + elif line[j-1]=='J': + board[i][j] = 0 + q.append([i,j]) + elif line[j-1]=='F': + board[i][j] = 2 + fire_q.append([i,j]) + +def check(cur, board): + y, x = cur + return board[y][x] == -1 + +def bfs(q, cnt): + global r, c + next_q = deque() + while q: + y, x = q.popleft() + if board[y][x] == 2: continue + for i in range(4): + ny, nx = y + dy[i], x + dx[i] + if ny<0 or ny>=r+2 or nx<0 or nx>=c+2: continue + if board[ny][nx] == 1 or board[ny][nx] == 2: continue + if visit[ny][nx]: continue + if check((ny,nx), board): + return True, next_q + next_q.append([ny, nx]) + visit[ny][nx] = True + return False, next_q + +def fire_bfs(q): + global r, c + next_q = deque() + while q: + y, x = q.popleft() + for i in range(4): + ny, nx = y + dy[i], x + dx[i] + if ny<=0 or ny>=r+1 or nx<=0 or nx>=c+1: continue + if board[ny][nx] == 1 or board[ny][nx] == 2: continue + next_q.append([ny, nx]) + board[ny][nx] = 2 + return next_q + +def solution(): + global q, fire_q + cnt = 0 + while True: + cnt += 1 + chk, q = bfs(q, cnt) + if chk: + return cnt + if not q: + return 'IMPOSSIBLE' + fire_q = fire_bfs(fire_q) + return 'IMPOSSIBLE' + +print(solution()) diff --git a/solution/graph_traversal/4963/main.py b/solution/graph_traversal/4963/main.py new file mode 100644 index 0000000..12f0f6b --- /dev/null +++ b/solution/graph_traversal/4963/main.py @@ -0,0 +1,36 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/27c8f362bf2c4defbe77f079e9eaa89e +import sys +sys.setrecursionlimit(10000) + +def input(): + return sys.stdin.readline().rstrip() + +def DFS(x, y): + arr[x][y] = 0 + for i in range(8): + dx = nx[i] + x + dy = ny[i] + y + if dx < 0 or dx >= h or dy < 0 or dy >= w: + continue + if arr[dx][dy] == 1: + DFS(dx,dy) + +nx = [-1,-1,-1,0,1,1,1,0] +ny = [-1,0,1,1,1,0,-1,-1] + +while True: + w, h = map(int, input().split()) + if w == 0 and h == 0: + break + arr = [] + ct = 0 + for i in range(h): + arr.append(list(map(int, input().split()))) + for i in range(h): + for j in range(w): + if arr[i][j] == 1: + DFS(i,j) + ct += 1 + print(ct) diff --git a/solution/graph_traversal/5547/main.cpp b/solution/graph_traversal/5547/main.cpp new file mode 100644 index 0000000..f45de6f --- /dev/null +++ b/solution/graph_traversal/5547/main.cpp @@ -0,0 +1,57 @@ +// Authored by : seastar105 +// Co-authored by : - +// Link : http://boj.kr/98893b9366134af9a87bd3a182b912ca +#include +using namespace std; +int W, H; +int a[105][105]; +bool vis[105][105]; +int dy[2][6] = { + {-1, 0, 1, 1, 0, -1}, + {-1, 0, 1, 1, 0, -1} +}; // 세로 +int dx[2][6] = { + {0, 1, 0, -1, -1, -1}, + {1, 1, 1, 0, -1, 0} +}; // 가로 + +bool valid(int y, int x) { + return 0<=y && y<=H+1 && 0<=x && x<=W+1; +} + +int main() { + cin.tie(nullptr); ios::sync_with_stdio(false); + cin >> W >> H; + for(int i=1;i<=H;++i) for(int j=1;j<=W;++j) cin >> a[i][j]; + // flood fill from outside with white + queue> q; + vis[0][0] = true; + q.emplace(0, 0); + while(!q.empty()) { + int y = q.front().first; + int x = q.front().second; + q.pop(); + for(int i=0;i<6;++i) { + int ny = y + dy[y%2][i]; + int nx = x + dx[y%2][i]; + if(!valid(ny, nx)) continue; + if(vis[ny][nx] || a[ny][nx]) continue; + vis[ny][nx] = true; + q.emplace(ny, nx); + } + } + // count adjacent edge between filled region for each black node + int ans = 0; + for(int y=1;y<=H;++y) { + for(int x=1;x<=W;++x) { + if(a[y][x] == 0) continue; + for(int i=0;i<6;++i) { + int ny = y + dy[y%2][i]; + int nx = x + dx[y%2][i]; + if(vis[ny][nx]) ++ans; + } + } + } + cout << ans << '\n'; + return 0; +} diff --git a/solution/graph_traversal/7569/main.cpp b/solution/graph_traversal/7569/main.cpp new file mode 100644 index 0000000..7eb9790 --- /dev/null +++ b/solution/graph_traversal/7569/main.cpp @@ -0,0 +1,73 @@ +// Authored by : seastar105 +// Co-authored by : - +// Link : http://boj.kr/391fb64958a448c8afc7082bb219b4af +#include +using namespace std; +int N, M, H; +int dx[6] = {-1,1,0,0,0,0}; +int dy[6] = {0,0,-1,1,0,0}; +int dz[6] = {0,0,0,0,-1,1}; +int arr[105][105][105]; +int dist[105][105][105]; + +struct Node { + int x, y, z; + Node() {}; + Node(int x_, int y_, int z_) : x(x_), y(y_), z(z_) {}; +}; + +bool valid(int x, int y, int z) { + return 0<=x && x> M >> N >> H; + int tot = 0, done = 0; + for(int i=0;i> arr[i][j][k]; + if(arr[i][j][k] >= 0) ++tot; + if(arr[i][j][k] == 1) ++done; + } + } + } + if(done == tot) { + cout << 0 << '\n'; + return 0; + } + memset(dist, -1, sizeof(dist)); + queue q; + for(int i=0;i= N or dy < 0 or dy >= M or dz < 0 or dz >= H: + continue + if arr[dz][dx][dy] == 0: + arr[dz][dx][dy] = 1 + queue.append(((dz,dx,dy), q[1]+1)) + + if checkMap(): + return q[1] + return -1 + +M, N, H = map(int, input().split()) +arr = [] +nx = [-1,0,1,0,0,0] +ny = [0,-1,0,1,0,0] +nz = [0,0,0,0,-1,1] + +queue = deque() +arr = [ [ list(map(int, input().split())) for _ in range(N) ] for _ in range(H) ] + +for z in range(H): + for i in range(N): + for j in range(M): + if arr[z][i][j] == 1: + arr[z][i][j] = 1 + queue.append(((z,i,j),0)) +ans = BFS() +print(ans) diff --git a/solution/graph_traversal/7576/main.cpp b/solution/graph_traversal/7576/main.cpp new file mode 100644 index 0000000..329ae6b --- /dev/null +++ b/solution/graph_traversal/7576/main.cpp @@ -0,0 +1,60 @@ +// Authored by : seastar105 +// Co-authored by : - +// Link : http://boj.kr/b632f242053b45c4bc98739905f01d18 +#include +using namespace std; +int N, M; +int arr[1005][1005]; +int dist[1005][1005]; +int dx[4] = {-1, 1, 0, 0}; +int dy[4] = {0, 0, -1, 1}; + +bool valid(int x, int y) { + return 0<=x && x> M >> N; + int tot = 0, done = 0; + for(int i=0;i> arr[i][j]; + if(arr[i][j] >= 0) ++tot; + if(arr[i][j] == 1) ++done; + } + } + if(tot == done) { + cout << 0 << '\n'; + return 0; + } + memset(dist, -1, sizeof(dist)); + queue> q; + for(int i=0;i +using namespace std; + +struct Coords{ int r, c; }; + +int dr[] = {0,0,-1,1}; +int dc[] = {1,-1,0,0}; +int n, m, testCase, countDoc, ck[101][101]; +char building[101][101]; +map keys; +vector entry; + +//테두리에 있는 출입구 모두 찾아 entry에 push +void pushEntries(){ + for(int col = 0; col < m; col++){ + if(building[0][col] != '*') + entry.push_back({0,col}); + } + for(int row = 1; row < n; row++){ + if(building[row][m-1] != '*') + entry.push_back({row,m-1}); + } + + for(int col = m-2; col >= 0; col--){ + if(building[n-1][col] != '*' ) + entry.push_back({n-1,col}); + } + + for(int row = 1; row < n - 1; row++){ + if(building[row][0] != '*') + entry.push_back({row,0}); + } +} + +int bfs(){ + int isNeedUpdate = 0; + memset(ck,0,sizeof(ck)); + queue q; + + for(auto e : entry) { + if('A' <= building[e.r][e.c] && building[e.r][e.c] <= 'Z'){ + if(keys.count(building[e.r][e.c] -'A' + 'a')) building[e.r][e.c] = '.'; + else continue; + } + if('a' <= building[e.r][e.c] && building[e.r][e.c] <= 'z'){ + keys[building[e.r][e.c]] = 1; + } + q.push({e.r, e.c}); + ck[e.r][e.c] = 1; + if(building[e.r][e.c] == '$') building[e.r][e.c] = '.', countDoc++; + } + + while(!q.empty()){ + int r = q.front().r; + int c = q.front().c; + q.pop(); + for(int i = 0; i < 4; i++){ + int nr = r + dr[i]; + int nc = c + dc[i]; + if(0 > nr || nr >= n || 0 > nc || nc >= m) continue; + if(building[nr][nc] == '*' || ck[nr][nc]) continue; + if('A' <= building[nr][nc] && building[nr][nc] <= 'Z'){ + char key = building[nr][nc] - 'A' + 'a'; + if(keys.count(key) == 0) continue; + isNeedUpdate = 1; + } + + if(building[nr][nc] == '$') countDoc++; + if('a' <= building[nr][nc] && building[nr][nc] <= 'z') { + keys[building[nr][nc]] = 1; + isNeedUpdate = 1; + } + + building[nr][nc] = '.'; + ck[nr][nc] = 1; + q.push({nr,nc}); + } + } + return isNeedUpdate; +} + +int main(){ + ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); + cin >> testCase; + while(testCase--){ + keys.clear(); + entry.clear(); + countDoc = 0; + cin >> n >> m; + + for(int i = 0; i < n; i++){ + for(int j = 0; j < m; j++){ + cin >> building[i][j]; + } + } + + string keyInPossession; + cin >> keyInPossession; + + for(auto k : keyInPossession) keys[k] = 1; + + pushEntries(); + while(bfs()); + cout << countDoc << '\n'; + } +} + +// 설명 : https://github.com/tony9402/baekjoon/pull/255#issue-722190601 diff --git a/solution/greedy/11000/main.py b/solution/greedy/11000/main.py new file mode 100644 index 0000000..bbf5322 --- /dev/null +++ b/solution/greedy/11000/main.py @@ -0,0 +1,24 @@ +# Authored by : chj3748 +# Co-authored by : - +# Link : http://boj.kr/c2436fde865f49fda490c2dcf1c6dba1 +import sys +import heapq + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +lecture = [] +for _ in range(N): + heapq.heappush(lecture, list(map(int, input().split()))) + +end_points = [] +while lecture: + l = heapq.heappop(lecture) + + if end_points: + if l[0] >= end_points[0]: + heapq.heappop(end_points) + heapq.heappush(end_points, l[1]) + +print(len(end_points)) diff --git a/solution/greedy/11399/main.py b/solution/greedy/11399/main.py new file mode 100644 index 0000000..c3c3ee1 --- /dev/null +++ b/solution/greedy/11399/main.py @@ -0,0 +1,19 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/f1c91eae2a2245c599c5d1bbc9cde9f5 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +arr = list(map(int, input().split())) +arr.sort() +total = 0 +waiting = 0 + +for i in range(len(arr)): + total += arr[i] + waiting + waiting += arr[i] + +print(total) \ No newline at end of file diff --git a/solution/greedy/11508/main.py b/solution/greedy/11508/main.py new file mode 100644 index 0000000..aa1b773 --- /dev/null +++ b/solution/greedy/11508/main.py @@ -0,0 +1,28 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/09487b6e14e044f8a477a743e37bce94 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +arr = [] +total = 0 + +for i in range(N): + arr.append(int(input())) + +arr.sort(reverse = True) + +ct = 1 + +for i in range(N): + if ct % 3 == 0: + ct = 1 + continue + + total += arr[i] + ct += 1 + +print(total) \ No newline at end of file diff --git a/solution/greedy/13164/main.py b/solution/greedy/13164/main.py new file mode 100644 index 0000000..7a66823 --- /dev/null +++ b/solution/greedy/13164/main.py @@ -0,0 +1,11 @@ +# Authored by : cieske +# Co-authored by : - +# Link : http://boj.kr/cfb369b6a5134cfa9c0859eab5464c47 +import sys +def input(): + return sys.stdin.readline().rstrip() + +n, k = map(int, input().split()) +lst = list(map(int, input().split())) # 정렬된 상태로 들어옴 +sub = sorted([lst[i+1] - lst[i] for i in range(n-1)]) # 원생 간 키 차이 정렬 +print(sum(sub[:(n-k)])) # Greedy하게 n-k개만 선택 \ No newline at end of file diff --git a/solution/greedy/13305/main.cpp b/solution/greedy/13305/main.cpp new file mode 100644 index 0000000..30b5e3d --- /dev/null +++ b/solution/greedy/13305/main.cpp @@ -0,0 +1,36 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/bdcb1993d67a400c8293683e5c7dbf7d +#include + +using namespace std; +typedef long long ll; + +vector cost, dis, prefix; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + cost.resize(N); + dis.resize(N - 1); + prefix.resize(N); + for(int i=0;i> dis[i]; + for(int i=0;i> cost[i]; + } + int R = 0; + ll answer = 0; + for(int i=0;i= i: + L += 1 +print(L) diff --git a/solution/greedy/1758/main.py b/solution/greedy/1758/main.py new file mode 100644 index 0000000..1a2d973 --- /dev/null +++ b/solution/greedy/1758/main.py @@ -0,0 +1,20 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/c3b5f907db554df093b6d9ea748fed35 + +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +arr = [] +ans = 0 +for i in range(N): + arr.append(int(input())) +arr.sort(key = lambda x : -x) +for i in range(len(arr)): + tip = arr[i] - i + if tip > 0: + ans += tip +print(ans) \ No newline at end of file diff --git a/solution/greedy/1817/main.py b/solution/greedy/1817/main.py new file mode 100644 index 0000000..0bc1868 --- /dev/null +++ b/solution/greedy/1817/main.py @@ -0,0 +1,21 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/b60f3d6809514134b0740ee31eeb763a +import sys +from collections import deque + +def input(): + return sys.stdin.readline().rstrip() + +N, M = map(int, input().split()) +ans = 0 +if N == 0: + print(ans) +else: + queue = deque(list(map(int, input().split()))) + while queue: + weight = 0 + while queue and weight + queue[0] <= M: + weight += queue.popleft() + ans += 1 + print(ans) diff --git a/solution/greedy/1931/main.py b/solution/greedy/1931/main.py new file mode 100644 index 0000000..4a393c3 --- /dev/null +++ b/solution/greedy/1931/main.py @@ -0,0 +1,25 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/7150be3ff485402ebb4c5011fa88ac7d +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +arr = [] +total = 1 + +for i in range(N): + a,b = map(int, input().split()) + arr.append((a,b)) + +arr.sort(key = lambda x : (x[1],x[0])) +end_time = arr[0][1] + +for i in range(1,N): + if arr[i][0] >= end_time: + end_time = arr[i][1] + total += 1 + +print(total) \ No newline at end of file diff --git a/solution/greedy/19598/main.py b/solution/greedy/19598/main.py new file mode 100644 index 0000000..65dda39 --- /dev/null +++ b/solution/greedy/19598/main.py @@ -0,0 +1,19 @@ +# Authored by : cieske +# Co-authored by : - +# Link : http://boj.kr/2b9516c8789c4a42849250efcef845c7 +import heapq +import sys +def input(): + return sys.stdin.readline().rstrip() + +n = int(input()) +lst = sorted([list(map(int, input().split())) for _ in range(n)]) +heap = [lst[0][1]] +for i in range(1, n): + if heap[0] > lst[i][0]: # 새로운 회의실 필요 + heapq.heappush(heap, lst[i][1]) + else: # 기존 회의실 이어서 사용 가능 + heapq.heappop(heap) + heapq.heappush(heap, lst[i][1]) + +print(len(heap)) \ No newline at end of file diff --git a/solution/greedy/20115/main.py b/solution/greedy/20115/main.py new file mode 100644 index 0000000..3665f8a --- /dev/null +++ b/solution/greedy/20115/main.py @@ -0,0 +1,15 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/cd5989ea170a46c9aba0b049b70f4ee6 + +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +arr = list(map(int, input().split())) +arr.sort() +for i in range(len(arr)-1): + arr[-1] += arr[i] / 2 +print(arr[-1]) \ No newline at end of file diff --git a/solution/greedy/20300/main.cpp b/solution/greedy/20300/main.cpp new file mode 100644 index 0000000..3e74219 --- /dev/null +++ b/solution/greedy/20300/main.cpp @@ -0,0 +1,39 @@ +// Authored by : dart +// Co-authored by : - +// Link : http://boj.kr/50c45e2707d946d98571bbeb52348d60 +#include +using namespace std; +typedef long long ll; + +int n; +ll arr[10005]; +ll ans = 0; + +int main() { + ios::sync_with_stdio(false); + cin.tie(nullptr); + cout.tie(nullptr); + + cin >> n; + for (int i = 0; i < n; i++) { + cin >> arr[i]; + } + sort(arr, arr + n); + //최대 원소와 최소 원소가 합쳐지는 게 근손실이 최소이다 + if (n % 2 == 0) { + for (int i = 0; i < n / 2; i++) { + ans = max(ans, arr[i] + arr[n - i - 1]); + } + } + //홀수일 때는 마지막 하나의 운동기구가 남는다 + else { + for (int i = 0; i < n / 2; i++) { + ans = max(ans, arr[i] + arr[n - i - 2]); + } + ans = max(ans, arr[n - 1]); + } + cout << ans << "\n"; + + + return 0; +} \ No newline at end of file diff --git a/solution/greedy/20365/main.cpp b/solution/greedy/20365/main.cpp new file mode 100644 index 0000000..416dcb2 --- /dev/null +++ b/solution/greedy/20365/main.cpp @@ -0,0 +1,33 @@ +// Authored by : dart +// Co-authored by : - +// Link : http://boj.kr/50c45e2707d946d98571bbeb52348d60 +#include +using namespace std; +typedef long long ll; + +int n; +string word; +int red = 0, blue = 0; + +int main() { + ios::sync_with_stdio(false); + cin.tie(nullptr); + cout.tie(nullptr); + + cin >> n >> word; + + for (int i = 0; i < n; i++) { + if (i == 0) { + if (word[i] == 'B') { blue++; } + if (word[i] == 'R') { red++; } + } + else { + if (word[i] == 'B' && word[i - 1] == 'R') { blue++; } + if (word[i] == 'R' && word[i - 1] == 'B') { red++; } + } + } + cout << min(red, blue) + 1 << "\n"; + + + return 0; +} \ No newline at end of file diff --git a/solution/greedy/2141/main.py b/solution/greedy/2141/main.py new file mode 100644 index 0000000..2ef4452 --- /dev/null +++ b/solution/greedy/2141/main.py @@ -0,0 +1,31 @@ +# Authored by : cieske +# Co-authored by : - +# Link : http://boj.kr/8be8b254ebe24830805a22953bdb3fcc +import sys +def input(): + return sys.stdin.readline().rstrip() + +n = int(input()) +lst = [list(map(int, input().split())) for _ in range(n)] +lst.sort() # 마을 위치 따라 먼저 정렬 + +dist = 0 +r_man, l_man = 0, 0 +for i in range(n): + tmp = lst[i][0] - lst[0][0] + dist += tmp*lst[i][1] # (최초 마을 ~ i번째 마을 거리) * 사람 수 + r_man += lst[i][1] #현재 위치보다 오른똑에 있는 사람 수 + +min_dist = dist +sol = lst[0][0] +for i in range(1, n): + tmp = lst[i][0] - lst[i-1][0] + l_man += lst[i-1][1] # 이동 시 왼쪽에 있게 될 사람 추가 + r_man -= lst[i-1][1] # 이동 시 더 이상 오른쪽에 있지 않는 사람 제거 + dist = dist + (l_man - r_man)*tmp # 거리 계산 + + if min_dist > dist: #업데이트 + min_dist = dist + sol = lst[i][0] + +print(sol) diff --git a/solution/greedy/21758/main.cpp b/solution/greedy/21758/main.cpp new file mode 100644 index 0000000..d46e098 --- /dev/null +++ b/solution/greedy/21758/main.cpp @@ -0,0 +1,35 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/ba24cf477f634be3b516d7475296bf67 +#include + +using namespace std; +typedef long long ll; + +const int MAXN = 100000; +ll arr[MAXN + 5], prefix[MAXN + 5]; + +ll psum(int l, int r) { + return prefix[r] - prefix[l - 1]; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + for(int i = 1; i <= N; i++) { + cin >> arr[i]; + prefix[i] = prefix[i - 1] + arr[i]; + } + + ll answer = 0; + for(int i = 2; i < N; i++ ){ + answer = max(answer, psum(2, i) + psum(i, N - 1)); + answer = max(answer, psum(2, N) + psum(i + 1, N) - arr[i]); + answer = max(answer, psum(1, N - 1) + psum(1, i - 1) - arr[i]); + } + cout << answer; + + return 0; +} diff --git a/solution/greedy/2212/main.py b/solution/greedy/2212/main.py new file mode 100644 index 0000000..dab30a4 --- /dev/null +++ b/solution/greedy/2212/main.py @@ -0,0 +1,12 @@ +# Authored by : cieske +# Co-authored by : - +# Link : http://boj.kr/2b4e1797973e4e16a3b38ff778023e3e +import sys +def input(): + return sys.stdin.readline().rstrip() + +n = int(input()) +k = int(input()) +lst = sorted(list(set(map(int, input().split())))) # 중복 제거 후 정렬 +distance = sorted([lst[i]-lst[i-1] for i in range(1, len(lst))]) # 센서 사이 거리 계산 후 정렬 +print(sum(distance[:(len(lst)-k)])) # 그리디하게 최장 거리 k개 제외한 게 정답 diff --git a/solution/greedy/2217/Main.java b/solution/greedy/2217/Main.java new file mode 100644 index 0000000..d7decda --- /dev/null +++ b/solution/greedy/2217/Main.java @@ -0,0 +1,63 @@ +//Authored by : suin8 +//Co-authored by : - +//Link : http://boj.kr/a334ac368b9b42b9a9cb34e313c6cd3b + +import java.util.*; +import java.io.*; + +public class Main { + static Vector rope = new Vector(); + + public static void main(String[] args) { + FastReader rd = new FastReader(); + + int N = rd.nextInt(); + for(int i = 0;i < N; i++) + rope.add(rd.nextInt()); + + // 오름차순으로 정렬 + Collections.sort(rope); + + // 기본값을 가장 작은 무게 * N개 로 지정하고 + // 1개씩 rope를 줄여가며 더 많이 들 수 있는 경우를 본다. + int weight = rope.get(0) * N; + for(int i = 1;i < N;i++) { + if(rope.get(i) * (N - i) > weight) + weight = rope.get(i) * (N - i); + } + System.out.print(weight); + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} diff --git a/solution/greedy/2812/main.py b/solution/greedy/2812/main.py new file mode 100644 index 0000000..2bb810b --- /dev/null +++ b/solution/greedy/2812/main.py @@ -0,0 +1,22 @@ +# Authored by : cieske +# Co-authored by : - +# Link : http://boj.kr/632e2f63fb4a44caacbddb53207f2279 +import sys +def input(): + return sys.stdin.readline().rstrip() + +n, k = map(int, input().split()) +t = k # 미래를 위해 저장 +num = list(input()) +stack = [] # 정답 저장 및 지울 후보 저장 + +for i in range(n): + while k>0 and stack: # 지울 수 있는 숫자가 있을 때 + if stack[-1] < num[i]: # 지우는 게 이득이면 + stack.pop() + k -= 1 + else: + break + stack.append(num[i]) + +print(*stack[:(n-t)], sep='') #남아있는 숫자는 n-(최초 k) => t를 여기서 사용 \ No newline at end of file diff --git a/solution/implementation/10994/main.cpp b/solution/implementation/10994/main.cpp new file mode 100644 index 0000000..0816ef6 --- /dev/null +++ b/solution/implementation/10994/main.cpp @@ -0,0 +1,31 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/67887b7c21504d718bfffa859b209589 +#include + +using namespace std; + +char stars[444][444]; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int n; cin >> n; + int N = 4 * (n - 1) + 1; + for(int k=0;k<=N/2;k+=2){ + int L = N - k * 2; + for(int i=0;i + +using namespace std; + +string convert(char s, bool fillzero=false){ + int n = s - 48; + string ret = ""; + while(n){ + ret += (n % 2) + '0'; + n /= 2; + } + while(fillzero && (int)ret.size() < 3) ret += '0'; + reverse(ret.begin(), ret.end()); + return ret; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + string s;cin >> s; + if(s == "0") { + cout << 0; + return 0; + } + string ans=""; + for(int i=0;i<(int)s.size();i++){ + ans += convert(s[i], i != 0); + } + cout << ans; + + return 0; +} + diff --git a/solution/implementation/1212/main.py b/solution/implementation/1212/main.py new file mode 100644 index 0000000..7762c2f --- /dev/null +++ b/solution/implementation/1212/main.py @@ -0,0 +1,27 @@ +# Authored by : tony9402 +# Co-authored by : - +# Link : http://boj.kr/7d0d2bcb568d4c3d86770e520838ef65 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +def change(num, first = False): + ret = '' + while num: + ret += chr(num % 2 + 48) + num //= 2 + while len(ret) < 3: + ret += '0' + + idx = 3 + if first: + while idx > 1 and ret[idx - 1] == '0': + idx -= 1 + return ret[:idx][::-1] + +N = input() +isFirst = True +for i in range(len(N)): + print(change(int(N[i]), isFirst),end='') + isFirst = False diff --git a/solution/implementation/1244/main.cpp b/solution/implementation/1244/main.cpp new file mode 100644 index 0000000..a506cbc --- /dev/null +++ b/solution/implementation/1244/main.cpp @@ -0,0 +1,35 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/f13978d7e3b8455c846f5825c6eca041 +#include + +using namespace std; + +int arr[105]; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int n; cin >> n; + for(int i=1;i<=n;i++) cin >> arr[i]; + int query; cin >> query; + while(query--){ + int type, idx; cin >> type >> idx; + if(type == 1){ + for(int i=idx;i<=n;i+=idx) arr[i] ^= 1; + } + else { + int w = 0; + while(1 <= idx - w - 1 && idx + w + 1 <= n && arr[idx - w - 1] == arr[idx + w + 1]) w++; + for(int i=idx-w;i<=idx+w;i++) arr[i] ^= 1; + } + } + for(int i=1;i<=n;i++) { + cout << arr[i]; + if(i % 20 == 0) cout << '\n'; + else cout << " "; + } + + return 0; +} diff --git a/solution/implementation/12933/main.cpp b/solution/implementation/12933/main.cpp new file mode 100644 index 0000000..210bded --- /dev/null +++ b/solution/implementation/12933/main.cpp @@ -0,0 +1,39 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/542de8e26b06406182f52af66cda1fc8 +#include + +using namespace std; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + string s; cin >> s; + const string DB = "quack"; + int n = s.size(); + vector used(n), cnt(n); + bool result = true; + for(int i=0;i + +using namespace std; + +int used[105]; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + for(int i=0;i<=100;i++) used[i] = -1; + + int n; cin >> n; + int answer = 0; + for(int i=0;i> num >> loc; + + if(used[num] < 0) used[num] = loc; + else if(used[num] != loc){ + used[num] = loc; + answer ++; + } + } + cout << answer; + + return 0; +} diff --git a/solution/implementation/14719/main.py b/solution/implementation/14719/main.py new file mode 100644 index 0000000..bd6f875 --- /dev/null +++ b/solution/implementation/14719/main.py @@ -0,0 +1,30 @@ +# Authored by : cieske +# Co-authored by : - +# Link : http://boj.kr/5af0f7388d84485db221c368ce306c4b + +import sys +def input(): + return sys.stdin.readline().rstrip() + +h, w = map(int, input().split()) +wall = list(map(int, input().split())) + +# Numpy 없이 argmax +def argmax(a): + return max(range(len(a)), key=lambda x: a[x]) +max_idx = argmax(wall) + +sol, tmp_max = 0, 0 +# 가장 높은 벽 기준 왼쪽부터 벽+채울 수 있는 물 합한 면적 더하기 +for i in range(max_idx+1): + tmp_max = max(tmp_max, wall[i]) + sol += tmp_max + +tmp_max = 0 +# 가장 높은 벽 기준 오른쪽부터 벽+채울 수 있는 물 합한 면적 더하기 +for i in range(w-1, max_idx, -1): + tmp_max = max(tmp_max, wall[i]) + sol += tmp_max + +#벽이 차지하는 면적 빼주면 정답 +print(sol-sum(wall)) \ No newline at end of file diff --git a/solution/implementation/15787/main.py b/solution/implementation/15787/main.py new file mode 100644 index 0000000..ed83da5 --- /dev/null +++ b/solution/implementation/15787/main.py @@ -0,0 +1,30 @@ +# Authored by : yj2221 +# Co-authored by : - +# Link : http://boj.kr/a636cadadf8d444180ee022a5af9353a + +import sys + +def input(): + return sys.stdin.readline().rstrip() + +n, m = map(int,input().split()) +trains= [0] * (n+1) +commands = [list(map(int, input().split())) for _ in range(m)] + +for command in commands: + if command[0] == 1: + _, i, x = command + trains[i] |= (1 << (x-1)) + elif command[0] == 2: + _, i, x = command + trains[i] &= ~(1 << (x-1)) + elif command[0] == 3: + _, i = command + trains[i] = trains[i] << 1 + trains[i] &= ((1 << 20) - 1) + elif command[0] == 4: + _, i = command + trains[i] = trains[i] >> 1 + +result = set(trains[1:]) +print(len(result)) diff --git a/solution/implementation/15806/main.py b/solution/implementation/15806/main.py new file mode 100644 index 0000000..8693c34 --- /dev/null +++ b/solution/implementation/15806/main.py @@ -0,0 +1,59 @@ +# Authored by : yj2221 +# Co-authored by : - +# Link : http://boj.kr/211883f3485445669772b7b6bce7dbeb + +from collections import deque +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N, M, K, t = map(int, input().split()) +board = [[0]*N for _ in range(N)] + +molds, cleans = [], [] +for _ in range(M): + x, y = map(int, input().split()) + y -= 1 + x -= 1 + board[y][x] = 1 + molds.append([y, x]) + +for _ in range(K): + x, y = map(int, input().split()) + y -= 1 + x -= 1 + cleans.append([y, x]) + +visit = [[[False]*N for _ in range(N)] for _ in range(2)] + +def bfs(molds, t): + next_molds = deque() + + dy = [-2,-2,-1,-1,1,1,2,2] + dx = [-1,1,-2,2,-2,2,-1,1] + while molds: + y, x = molds.popleft() + + for i in range(8): + ny, nx = y + dy[i], x + dx[i] + if ny>=N or ny<0 or nx>=N or nx<0: continue + if visit[(t+1)%2][ny][nx]: continue + visit[(t+1)%2][ny][nx] = True + next_molds.append([ny,nx]) + return next_molds + + +def solution(cleans, molds): + global board, visit + molds = deque(molds) + for _t in range(t): + molds = bfs(molds, _t) + for clean in cleans: + y, x = clean + if visit[(_t+1)%2][y][x]==1: + return True + return False + +result = solution(cleans, molds) +print('YES' if result else 'NO') diff --git a/solution/implementation/16926/main.cpp b/solution/implementation/16926/main.cpp new file mode 100644 index 0000000..46243bb --- /dev/null +++ b/solution/implementation/16926/main.cpp @@ -0,0 +1,63 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/b4aa5eb711ac44259b6e1d3b8a03ca59 +#include + +using namespace std; + +const int dy[] = {1,0,-1,0}; +const int dx[] = {0,1,0,-1}; +int arr[333][333]; +bool used[333][333], used2[333][333]; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N, M, R; cin >> N >> M >> R; + for(int i=0;i> arr[i][j]; + + for(int i=0;i cur; + cur.push_back(arr[y][x]); + used[y][x] = true; + while(dir < 4){ + int qy = y + dy[dir]; + int qx = x + dx[dir]; + if(0 > qy || qy >= N || 0 > qx || qx >= M || used[qy][qx]){ + dir++; + continue; + } + y = qy, x = qx; + used[y][x] = true; + cur.push_back(arr[y][x]); + } + int L = cur.size(); + int idx = (L - R % L) % L; + y = i, x = i, dir = 0; + used2[y][x] = true; + arr[y][x] = cur[idx]; + if(++idx == (int)cur.size()) idx = 0; + while(dir < 4){ + int qy = y + dy[dir]; + int qx = x + dx[dir]; + if(0 > qy || qy >= N || 0 > qx || qx >= M || used2[qy][qx]){ + dir++; + continue; + } + y = qy, x = qx; + used2[y][x] = true; + arr[y][x] = cur[idx]; + if(++idx == (int)cur.size()) idx = 0; + } + } + for(int i=0;i= h_cn: + temp[row][col] = arr[row][col - h_cn] + elif row >= h_rn and col < h_cn: + temp[row][col] = arr[row][col + h_cn] + elif row >= h_rn and col >= h_cn: + temp[row][col] = arr[row - h_rn][col] + return temp + +# 서브 그룹 왼쪽90 회전 +def fun6(arr): + r_num = len(arr) + c_num = len(arr[0]) + h_rn = r_num // 2 + h_cn = c_num // 2 + temp = [[0] * c_num for _ in range(r_num)] + for row in range(r_num): + for col in range(c_num): + if row < h_rn and col < h_cn: + temp[row][col] = arr[row][col + h_cn] + elif row < h_rn and col >= h_cn: + temp[row][col] = arr[row + h_rn][col] + elif row >= h_rn and col < h_cn: + temp[row][col] = arr[row - h_rn][col] + elif row >= h_rn and col >= h_cn: + temp[row][col] = arr[row][col - h_cn] + return temp + + +N, M, R = map(int, input().split()) +array = [input().split() for _ in range(N)] +for operator in input().split(): + array = locals()['fun' + operator](array) + +for row in array: + print(' '.join(row)) \ No newline at end of file diff --git a/solution/implementation/17413/main.cpp b/solution/implementation/17413/main.cpp new file mode 100644 index 0000000..41026f8 --- /dev/null +++ b/solution/implementation/17413/main.cpp @@ -0,0 +1,35 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/fe8c559fa57643e4a5b072a35a619f89 +#include + +using namespace std; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + string s; + getline(cin, s); + int n = s.size(); + + for(int i=0;i': + inParen = False + + if inParen and data[i] == '<' : + if temp: + answer += ''.join(temp[::-1])+'<' + temp=[] + else: + answer +='<' + elif inParen and data[i] != '<': + answer += data[i] + + elif not inParen and data[i] =='>': + answer += data[i] + + elif not inParen and data[i]!= ' ': + temp.append(data[i]) + elif not inParen and data[i]== ' ': + answer += ''.join(temp[::-1])+' ' + temp=[] + +if temp: + answer+= ''.join(temp[::-1]) +print(answer) \ No newline at end of file diff --git a/solution/implementation/1913/main.cpp b/solution/implementation/1913/main.cpp new file mode 100644 index 0000000..2e3f9e6 --- /dev/null +++ b/solution/implementation/1913/main.cpp @@ -0,0 +1,47 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/9270997d7a5549b28187cb244dc0c62b +#include + +using namespace std; + +int arr[1001][1001]; +const int dy[] = {1, 0, -1, 0}; +const int dx[] = {0, 1, 0, -1}; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int n, k; cin >> n >> k; + int s = n * n; + int y = -1, x = 0, dir = 0; + int ansy = 0, ansx = 0; + function inrange = [&](int y, int x) -> bool { + return 0 <= y && y < n && 0 <= x && x < n; + }; + while(s > 0){ + int qy = y + dy[dir]; + int qx = x + dx[dir]; + if(!inrange(qy, qx) || arr[qy][qx] != 0) { + dir = (dir + 1) % 4; + continue; + } + y = qy; x = qx; + arr[y][x] = s; + if(s == k){ + ansy = y + 1; + ansx = x + 1; + } + s--; + } + for(int i=0;i + +using namespace std; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int t; cin >> t; + while(t--){ + int n; cin >> n; + int max_value = -1000001, min_value = 1000001; + for(int i=0;i> x; + if(max_value < x) max_value = x; + if(min_value > x) min_value = x; + } + cout << min_value << ' ' << max_value << '\n'; + } + + return 0; +} + diff --git a/solution/implementation/20207/main.cpp b/solution/implementation/20207/main.cpp new file mode 100644 index 0000000..e4b0a30 --- /dev/null +++ b/solution/implementation/20207/main.cpp @@ -0,0 +1,30 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/495000f668564c6c9a71fa59b0380aae +#include + +using namespace std; +int prefix[444]; + +int main(){ + ios::sync_with_stdio(false); cin.tie(0); + + int n; cin >> n; + for(int i=1;i<=n;i++){ + int a, b; cin >> a >> b; + prefix[a]++; prefix[b+1]--; + } + int mx = 0, ans = 0, prv = -1; + for(int i=1;i<=366;i++){ + prefix[i]+=prefix[i-1]; + mx=max(mx,prefix[i]); + if(!prefix[i]){ + ans += (i - prv) * mx; + mx = 0; prv = -1; + } + else if(!~prv)prv = i; + } + cout << ans; + + return 0; +} diff --git a/solution/implementation/20291/main.cpp b/solution/implementation/20291/main.cpp new file mode 100644 index 0000000..6434182 --- /dev/null +++ b/solution/implementation/20291/main.cpp @@ -0,0 +1,28 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/76369f4f8225439084adb5f553cecae8 +#include + +using namespace std; + +vector file; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int n; cin >> n; + for(int i=0;i> s; + file.emplace_back(s.substr(s.find(".") + 1)); + } + sort(file.begin(), file.end()); + for(int i=0;i + +using namespace std; + +const string qwerty[3] = {"qwertyuiop", "asdfghjkl", "zxcvbnm"}; +const string OnlyLeft = "qwertasdfgzxcv"; +int X[33], Y[33]; + +bool isLeft(char x){ return OnlyLeft.find(x) != string::npos; } +int dist(char a, char b){return abs(Y[a-'a']-Y[b-'a']) + abs(X[a-'a']-X[b-'a']); } + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + for(int i=0;i<3;i++){ + for(int j=0;j<(int)qwerty[i].size();j++){ + Y[qwerty[i][j] - 'a'] = i; + X[qwerty[i][j] - 'a'] = j; + } + } + + char L, R; cin >> L >> R; + string word; cin >> word; + + int answer = 0; + for(auto &w: word){ + if(isLeft(w)) { + answer += dist(L, w) + 1; + L = w; + } + else { + answer += dist(R, w) + 1; + R = w; + } + } + cout << answer; + + return 0; +} + diff --git a/solution/implementation/20546/main.cpp b/solution/implementation/20546/main.cpp new file mode 100644 index 0000000..81d00e3 --- /dev/null +++ b/solution/implementation/20546/main.cpp @@ -0,0 +1,58 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/a30111114ee042f983774cf658e84fb9 +#include + +using namespace std; + +int info[14]; + +int MachineJ(int money){ + int cnt = 0; + for(int i=0;i<14;i++){ + if(info[i] > money) continue; + cnt = money / info[i]; + money %= info[i]; + } + return money + cnt * info[13]; +} + +int MachineS(int money){ + int cnt = 0; + int downCnt = 0; + int upCnt = 0; + for(int i=1;i<14;i++){ + if(info[i-1] > info[i]){ + downCnt ++; + upCnt = 0; + } + else if(info[i-1] < info[i]){ + downCnt = 0; + upCnt++; + } + else downCnt = upCnt = 0; + + if(info[i] <= money && downCnt >= 3){ + cnt += money / info[i]; + money %= info[i]; + } + } + return money + cnt * info[13]; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int money; cin >> money; + for(int i=0;i<14;i++) cin >> info[i]; + + int BNP = MachineJ(money); + int TIMING = MachineS(money); + + if(BNP > TIMING)cout << "BNP"; + else if(BNP < TIMING)cout << "TIMING"; + else cout << "SAMESAME"; + + return 0; +} diff --git a/solution/implementation/21608/main.py b/solution/implementation/21608/main.py new file mode 100644 index 0000000..1009c05 --- /dev/null +++ b/solution/implementation/21608/main.py @@ -0,0 +1,64 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/178ebc4de06c4c1fb718d3038ec42d50 + +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +total = 0 +nx = [-1, 0, 1, 0] +ny = [0, -1, 0, 1] +stu = [] +feel = [[0 for i in range(N)] for j in range(N)] +arr = [[0 for i in range(N)] for j in range(N)] +save = [[] for i in range(N**2+1)] +for i in range(N**2): + a = list(map(int, input().split())) + stu.append(a) + save[a[0]].append(a[1:]) +for i in range(N**2): + temp = [] + for x in range(N): + for y in range(N): + if arr[x][y] != 0: + continue + like = 0 + empty = 0 + for z in range(4): + dx = x + nx[z] + dy = y + ny[z] + if dx < 0 or dx >= N or dy < 0 or dy >= N: + continue + if arr[dx][dy] in stu[i][1:]: + like += 1 + if arr[dx][dy] == 0: + empty += 1 + temp.append((like, empty, (x,y))) + temp.sort(key = lambda x : (-x[0], -x[1], x[2])) + arr[temp[0][2][0]][temp[0][2][1]] = stu[i][0] +for i in range(N): + for j in range(N): + now = arr[i][j] + near = 0 + for z in range(4): + dx = i + nx[z] + dy = j + ny[z] + if dx < 0 or dx >= N or dy < 0 or dy >= N: + continue + if arr[dx][dy] in save[now][0]: + near += 1 + feel[i][j] = near +for i in range(N): + for j in range(N): + if feel[i][j] == 1: + total += 1 + elif feel[i][j] == 2: + total += 10 + elif feel[i][j] == 3: + total += 100 + elif feel[i][j] == 4: + total += 1000 +print(total) \ No newline at end of file diff --git a/solution/implementation/21756/main.cpp b/solution/implementation/21756/main.cpp new file mode 100644 index 0000000..fb7137b --- /dev/null +++ b/solution/implementation/21756/main.cpp @@ -0,0 +1,26 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/6fabfcca5d6b483c9f24b81bfabf2124 +#include + +using namespace std; + +int arr[105], tmp[105]; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + for(int i=1;i<=N;i++) arr[i] = i; + + while(N != 1) { + int idx = 1; + for(int i=2;i<=N;i+=2) tmp[idx++] = arr[i]; + N = idx - 1; + for(int i=1;i<=N;i++) arr[i] = tmp[i]; + } + cout << arr[1]; + + return 0; +} diff --git a/solution/implementation/21918/main.py b/solution/implementation/21918/main.py new file mode 100644 index 0000000..8c0c0cd --- /dev/null +++ b/solution/implementation/21918/main.py @@ -0,0 +1,33 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/04ffe7467c0542c386a2ff3fc95f0b6b +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N, M = map(int, input().split()) +arr = list(map(int, input().split())) + +for i in range(M): + a,b,c = map(int, input().split()) + + if a == 1: + arr[b-1] = c + + elif a == 2: + for j in range(b-1,c): + if arr[j] == 0: + arr[j] = 1 + else: + arr[j] = 0 + + elif a == 3: + for j in range(b-1,c): + arr[j] = 0 + + else: + for j in range(b-1,c): + arr[j] = 1 + +print(*arr) \ No newline at end of file diff --git a/solution/implementation/2578/main.cpp b/solution/implementation/2578/main.cpp new file mode 100644 index 0000000..e20325c --- /dev/null +++ b/solution/implementation/2578/main.cpp @@ -0,0 +1,75 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/6a874bc16cbc470eb3338e2ec945f180 +#include + +using namespace std; + +int board[5][5]; +bool used[5][5]; + +bool bingo() { + int line = 0; + + bool bingo = true; + for(int i=0;i<5;i++){ + bingo = true; + for(int j=0;j<5;j++){ + bingo &= used[i][j]; + } + if(bingo) line ++; + + bingo = true; + for(int j=0;j<5;j++){ + bingo &= used[j][i]; + } + if(bingo) line ++; + } + + bingo = true; + for(int i=0;i<5;i++){ + bingo &= used[i][i]; + } + if(bingo) line++; + + bingo = true; + for(int i=0;i<5;i++){ + bingo &= used[4-i][i]; + } + if(bingo) line++; + + return line >= 3; +} + +void marking(int number){ + for(int i=0;i<5;i++){ + for(int j=0;j<5;j++){ + if(board[i][j] == number) { + used[i][j] = true; + return; + } + } + } +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + for(int i=0;i<5;i++){ + for(int j=0;j<5;j++){ + cin >> board[i][j]; + } + } + + for(int i=1;i<=25;i++){ + int x;cin >> x; + marking(x); + if(bingo()){ + cout << i; + return 0; + } + } + + return 0; +} diff --git a/solution/implementation/2729/main.py b/solution/implementation/2729/main.py new file mode 100644 index 0000000..b1d58dd --- /dev/null +++ b/solution/implementation/2729/main.py @@ -0,0 +1,12 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/fd10df28858644eebc6b4ffd042c2d83 +import sys +def input(): + return sys.stdin.readline().rstrip() + +T = int(input()) +for i in range(T): + a,b = input().split() + total = int(a,2) + int(b,2) + print(bin(total)[2:]) \ No newline at end of file diff --git a/solution/implementation/2753/main.cpp b/solution/implementation/2753/main.cpp new file mode 100644 index 0000000..7f3da2e --- /dev/null +++ b/solution/implementation/2753/main.cpp @@ -0,0 +1,21 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/a5fabcbae0604daabb17802f9323c69f +#include + +using namespace std; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int n; cin >> n; + if(n % 4 == 0 && (n % 100 != 0 || n % 400 == 0)){ + cout << 1; + } + else { + cout << 0; + } + + return 0; +} diff --git a/solution/implementation/4396/main.cpp b/solution/implementation/4396/main.cpp new file mode 100644 index 0000000..99aeea9 --- /dev/null +++ b/solution/implementation/4396/main.cpp @@ -0,0 +1,51 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/a6ba32f17093473f9e0f5f3dee9f7ced +#include + +using namespace std; + +vector board, push; +const int dy[] = {0,0,-1,1,-1,-1,1,1}; +const int dx[] = {-1,1,0,0,-1,1,-1,1}; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int n; cin >> n; + board.resize(n); push.resize(n); + for(int i=0;i> board[i]; + for(int i=0;i> push[i]; + + bool pushed_mine = false; + for(int i=0;i qy || qy >= n || 0 > qx || qx >= n) continue; + if(board[qy][qx] == '*') mine ++; + } + push[i][j] = (char)(mine + '0'); + } + } + + if(pushed_mine){ + for(int i=0;i + +using namespace std; + +bool chk[33]; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + for(int i=0;i<28;i++){ + int x;cin >> x; + chk[x] = true; + } + for(int i=1;i<=30;i++){ + if(chk[i] == false)cout << i << '\n'; + } + + return 0; +} + diff --git a/solution/implementation/5597/main.py b/solution/implementation/5597/main.py new file mode 100644 index 0000000..393bbbe --- /dev/null +++ b/solution/implementation/5597/main.py @@ -0,0 +1,22 @@ +# Authored by : samuel95 +# Co-authored by : - +# Link : http://boj.kr/5229a16593bd45beb68eefd6224ef63b +import sys + +def input(): + return sys.stdin.readline().rstrip() + +numbers = [False for _ in range(31)] + +for _ in range(28): + n = int(input()) + numbers[n] = True + +ans = [] + +for i in range(1, 31): + if not numbers[i]: + ans.append(i) + +print(ans[0]) +print(ans[1]) diff --git a/solution/math/1110/main.cpp b/solution/math/1110/main.cpp new file mode 100644 index 0000000..f7ff41c --- /dev/null +++ b/solution/math/1110/main.cpp @@ -0,0 +1,34 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/29790baf467142729acef15a2815b478 +#include + +using namespace std; + +int getNext(int x) { + int tmp = x, ret = 0; + while(x) { + ret += x % 10; + x /= 10; + } + return tmp % 10 * 10 + ret % 10; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + int start = N; + int cur = start; + int ans = 0; + + while(true) { + cur = getNext(cur); + ans ++; + if(start == cur) break; + } + cout << ans; + + return 0; +} diff --git a/solution/math/11653/main.cpp b/solution/math/11653/main.cpp new file mode 100644 index 0000000..581a6ac --- /dev/null +++ b/solution/math/11653/main.cpp @@ -0,0 +1,23 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/ee2e1b1327414b35ad963676aae23a8b +#include + +using namespace std; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + int tmp = N; + for(int i=2;i*i<=N;i++){ + while(tmp % i == 0) { + cout << i << '\n'; + tmp /= i; + } + } + if(tmp != 1) cout << tmp; + + return 0; +} diff --git a/solution/math/11653/main.py b/solution/math/11653/main.py new file mode 100644 index 0000000..99b0477 --- /dev/null +++ b/solution/math/11653/main.py @@ -0,0 +1,16 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/ebf75b738a784d6dad28494e18113b31 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +X = N +for i in range(2, N + 1): + if X == 1: + break + while X % i == 0: + X //= i + print(i) diff --git a/solution/math/1747/main.cpp b/solution/math/1747/main.cpp new file mode 100644 index 0000000..279fded --- /dev/null +++ b/solution/math/1747/main.cpp @@ -0,0 +1,38 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/b94e3339437045b3adbc71d22ec88114 +#include + +using namespace std; + +bool isPrime(int x) { + if(x <= 1) return false; + for(int i=2;i*i<=x;i++){ + if(x % i == 0) return false; + } + return true; +} + +bool isPalindrome(int x) { + int origin = x; + int rev = 0; + while(x) { + rev = rev * 10 + x % 10; + x /= 10; + } + return origin == rev; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int n; cin >> n; + while(true) { + if(isPalindrome(n) && isPrime(n)) break; + n ++; + } + cout << n; + + return 0; +} diff --git a/solution/math/1934/main.cpp b/solution/math/1934/main.cpp new file mode 100644 index 0000000..f6be74c --- /dev/null +++ b/solution/math/1934/main.cpp @@ -0,0 +1,27 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/ad01b7a316c54d36b65058fd4909173b +#include + +using namespace std; + +int gcd(int a, int b) { + if(b == 0)return a; + return gcd(b, a % b); +} +int lcm(int a, int b) { + return a / gcd(a, b) * b; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int t; cin >> t; + while(t--){ + int a, b; cin >> a >> b; + cout << lcm(a, b) << '\n'; + } + + return 0; +} diff --git a/solution/math/1978/main.cpp b/solution/math/1978/main.cpp new file mode 100644 index 0000000..7cd6851 --- /dev/null +++ b/solution/math/1978/main.cpp @@ -0,0 +1,29 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/0b2168e810154d6e916497d012aa7daa +#include + +using namespace std; + +bool isPrime(int x) { + if(x <= 1) return false; + for(int i=2;i*i<=x;i++) { + if(x % i == 0) return false; + } + return true; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int n; cin >> n; + int answer = 0; + for(int i=0;i> x; + if(isPrime(x)) answer ++; + } + cout << answer; + + return 0; +} diff --git a/solution/math/1978/main.py b/solution/math/1978/main.py new file mode 100644 index 0000000..40976fe --- /dev/null +++ b/solution/math/1978/main.py @@ -0,0 +1,23 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/fba2f023d5c346aa826b3c6922fb0a27 +import sys +from math import sqrt + +def input(): + return sys.stdin.readline().rstrip() + +prime = [1] * 1005 +prime[0] = 0 +prime[1] = 0 +ct = 0 +N = int(input()) +arr = list(map(int, input().split())) +for i in range(2, int(sqrt(1005))+1): + for j in range(i+i, 1005, i): + if prime[j] == 1: + prime[j] = 0 +for i in arr: + if prime[i]: + ct += 1 +print(ct) diff --git a/solution/math/1990/Main.java b/solution/math/1990/Main.java new file mode 100644 index 0000000..93918ad --- /dev/null +++ b/solution/math/1990/Main.java @@ -0,0 +1,87 @@ +//Authored by : suin8 +//Co-authored by : - +//Link : http://boj.kr/4e4fa5497b7d4fad88ea6b0c69a1852d + +import java.util.*; +import java.io.*; + +public class Main { + static boolean prime_num[]; // false면 소수 (단, 2 이상인 정수) + public static void main(String[] args) { + FastReader rd = new FastReader(); + + int a = rd.nextInt(); + int b = rd.nextInt(); + + prime_num = new boolean[b + 1]; + + check_prime(b); + palindrome(a, b); + } + + // 소수 판별 에라토스테네스의 체 + // 소수인 수의 배수들을 지우는 방식 + // 배수를 지울 때 끝 수(b)의 제곱근 이하 수 까지만 확인한다 + static void check_prime(int b) { + for(int i = 2;i <= Math.sqrt(b);i++) { + if(prime_num[i] == true) continue; + for(int j = 2;i * j <= b;j++) + prime_num[i * j] = true; + } + } + + // 팰린드롬 판별 + static void palindrome(int a, int b) { + for(int i = a;i <= b;i++) { + if(prime_num[i] == false) { // 소수에 대해서만 확인 + // 펠린드롬 판별하고 하는 수를 문자열로 변환 + String str = Integer.toString(i); + // 문자열로 변환한 수의 양 끝부터 중앙으로 같은지 검사 + int begin = 0; + int end = str.length() - 1; + boolean flag = true; + for(;begin < end;begin++, end--) { + if(str.charAt(begin) != str.charAt(end)) { + flag = false; + break; + } + } + if(flag == true) System.out.println(i); + } + } + System.out.println("-1"); + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} diff --git a/solution/math/21275/main.cpp b/solution/math/21275/main.cpp new file mode 100644 index 0000000..b33334f --- /dev/null +++ b/solution/math/21275/main.cpp @@ -0,0 +1,59 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/d63334103898471cb0d15ee6027d1abc +#include + +using namespace std; +typedef long long ll; + +const ll B = 1000000000; // 1e9 -> 1e9 * 1e9 <= LLONG_MAX (9 * 1e18) +pair LLONG_MX = pair(LLONG_MAX / B, LLONG_MAX % B); + +int convert(char x){ + if(x <= '9')return x - 48; + return x - 'a' + 10; +} + +ll convert(const string &s, int base) { + ll hi = 0, lo = 0; + for(auto &i: s){ + ll cur = convert(i); + if(cur >= base)return -1; + hi = hi * base; + lo = lo * base; + lo += cur; + hi += lo / B; + lo %= B; + if(hi * LLONG_MX.second > lo * LLONG_MX.first) return -1; + } + return hi * B + lo; +} +vector> v; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + string a, b; cin >> a >> b; + for(int i=2;i<=36;i++){ + for(int j=2;j<=36;j++){ + if(i == j)continue; + ll L = convert(a, i), R = convert(b, j); + if(!~L || !~R)continue; + if(L == R) v.emplace_back(L, i, j); + } + } + + if(v.empty()) { + cout << "Impossible"; + } + else if((int)v.size() == 1){ + auto [a, b, c] = v[0]; + cout << a << ' ' << b << ' ' << c; + } + else { + cout << "Multiple"; + } + + return 0; +} diff --git a/solution/math/21312/main.py b/solution/math/21312/main.py new file mode 100644 index 0000000..fbca75c --- /dev/null +++ b/solution/math/21312/main.py @@ -0,0 +1,26 @@ +# // Authored by : chj3748 +# // Co-authored by : - +# // Link : http://boj.kr/21536cc8d28a4570aca6c9b48fc41e26 + +import sys + +def input(): + return sys.stdin.readline().rstrip() + +odd_num = -1 +even_num = -1 +for number in map(int, input().split()): + if number % 2: + if odd_num == -1: + odd_num = number + else: + odd_num *= number + else: + if even_num == -1: + even_num = number + else: + even_num *= number +if odd_num != -1: + print(odd_num) +else: + print(even_num) diff --git a/solution/math/21919/main.py b/solution/math/21919/main.py new file mode 100644 index 0000000..7d3d27a --- /dev/null +++ b/solution/math/21919/main.py @@ -0,0 +1,36 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/e59d5d5d486b44ba93000175e5118406 +import sys +from math import sqrt + +def input(): + return sys.stdin.readline().rstrip() + +def GCD(x,y): + if y == 0: + return x + else: + return GCD(y, x%y) + +arr = [0] * 1000003 +for i in range(2,int(sqrt(1000003))+1): + for j in range(i+i, 1000003, i): + if arr[j] == 0: + arr[j] = 1 +arr[0] = 1 +arr[1] = 1 +LCM = 1 +N = int(input()) +A = list(map(int, input().split())) +ans = [] +for i in A: + if not arr[i]: + ans.append(i) +if not ans: + print(-1) +else: + LCM = ans[0] + for i in range(1,len(ans)): + LCM = ans[i] * LCM // GCD(ans[i], LCM) + print(LCM) \ No newline at end of file diff --git a/solution/math/21920/main.py b/solution/math/21920/main.py new file mode 100644 index 0000000..6ef5e65 --- /dev/null +++ b/solution/math/21920/main.py @@ -0,0 +1,22 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/9824ccd807974698b94586b14edbb348 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +def GCD(x,y): + if y == 0: + return x + else: + return GCD(y, x%y) + +N = int(input()) +A = list(map(int, input().split())) +X = int(input()) +ans = [] +for i in A: + if GCD(X,i) == 1: + ans.append(i) +print(sum(ans)/len(ans)) diff --git a/solution/math/22864/Main.java b/solution/math/22864/Main.java new file mode 100644 index 0000000..00200df --- /dev/null +++ b/solution/math/22864/Main.java @@ -0,0 +1,72 @@ +//Authored by : suin8 +//Co-authored by : - +//Link : http://boj.kr/9e22093a088c4facb197d261767247ba + +import java.util.*; +import java.io.*; + +public class Main { + public static void main(String[] args) { + FastReader rd = new FastReader(); + + int A = rd.nextInt(); + int B = rd.nextInt(); + int C = rd.nextInt(); + int M = rd.nextInt(); + + int time = 0; + int tired = 0; // 피로도 + int work = 0; + + while(time < 24) { // 24시간 동안 일 + if(can_work(A, tired, M)) { // 일을 할 수 있을 때 + work += B; + tired += A; + } + else { // 일을 할 수 없을 때 => 쉰다. + tired -= C; + if(tired < 0) tired = 0; // 피로도가 0보다 작아지지 않게 + } + time++; + } + System.out.print(work); + } + + static boolean can_work(int A, int tired, int M) { + if(tired + A <= M) return true; + else return false; + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} diff --git a/solution/math/2581/main.cpp b/solution/math/2581/main.cpp new file mode 100644 index 0000000..68116db --- /dev/null +++ b/solution/math/2581/main.cpp @@ -0,0 +1,37 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/f3c6407dc6ab4ad38ebb74b1ea3a9c8e +#include + +using namespace std; + +bool isPrime(int x) { + if(x <= 1) return false; + for(int i=2;i*i<=x;i++) { + if(x % i == 0) return false; + } + return true; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int sum = 0, minimum = 10001; + int l, r; cin >> l >> r; + for(int i=l;i<=r;i++){ + if(isPrime(i)) { + sum += i; + minimum = min(minimum, i); + } + } + if(sum) { + cout << sum << '\n'; + cout << minimum; + } + else { + cout << -1; + } + return 0; +} + diff --git a/solution/math/2609/main.cpp b/solution/math/2609/main.cpp new file mode 100644 index 0000000..90c301b --- /dev/null +++ b/solution/math/2609/main.cpp @@ -0,0 +1,24 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/054bab418a2c441a99982acfa1ba2b27 +#include + +using namespace std; + +int gcd(int a, int b) { + if(b == 0)return a; + return gcd(b, a % b); +} +int lcm(int a, int b){ + return a / gcd(a, b) * b; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int a, b; cin >> a >> b; + cout << gcd(a, b) << '\n' << lcm(a, b); + + return 0; +} diff --git a/solution/math/2745/Main.java b/solution/math/2745/Main.java new file mode 100644 index 0000000..f4394cc --- /dev/null +++ b/solution/math/2745/Main.java @@ -0,0 +1,63 @@ +//Authored by : suin8 +//Co-authored by : - +//Link : http://boj.kr/31dab421076b458aac0065580a31cbe2 +import java.util.*; +import java.io.*; + +public class Main { + public static void main(String[] args) { + FastReader rd = new FastReader(); + + String N = rd.next(); + int B = rd.nextInt(); + + int num = 0; + int digit = 0; + + // 문자 A~Z int형 변환 시(65~90) 따라서 -55를 하면 + // A는 10 B는 11 ... 이런식으로 나오게 된다. + // 문자 0~9 int형 변환 시(48~57) 따라서 -48을 하면 + // 0 ~ 9가 나온다. + for(int i = N.length() - 1; i >= 0; i--) { + if(N.charAt(i) >= 65) + num += (N.charAt(i) - 55) * Math.pow(B, digit); + else + num += (N.charAt(i) - 48) * Math.pow(B, digit); + digit++; + } + System.out.print(num); + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} diff --git a/solution/math/2745/main.cpp b/solution/math/2745/main.cpp new file mode 100644 index 0000000..ea8b6bc --- /dev/null +++ b/solution/math/2745/main.cpp @@ -0,0 +1,27 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/6f8324f145664e3890bd12301389737d +#include + +using namespace std; + +int getValue(char x) { + if(x <= '9') return x - '0'; + return x - 'A' + 10; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + string s; cin >> s; + int base; cin >> base; + + int answer = 0; + for(int i=0;i<(int)s.size();i++) { + answer = answer * base + getValue(s[i]); + } + cout << answer; + + return 0; +} diff --git a/solution/math/2753/main.py b/solution/math/2753/main.py new file mode 100644 index 0000000..e7abdc7 --- /dev/null +++ b/solution/math/2753/main.py @@ -0,0 +1,11 @@ +# Authored by : chj3748 +# Co-authored by : - +# Link : http://boj.kr/8321cffd959748c981d1cb359cccee9d +import sys + +def input(): + return sys.stdin.readline().rstrip() + +year = int(input()) + +print(1 if not year % 4 and (year % 100 or not year % 400) else 0) diff --git a/solution/math/2960/main.cpp b/solution/math/2960/main.cpp new file mode 100644 index 0000000..a6f8a63 --- /dev/null +++ b/solution/math/2960/main.cpp @@ -0,0 +1,25 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/bf53232ebf90497bbcdea9716eade1e8 +#include + +using namespace std; + +bool erased[1005]; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int K, N; cin >> N >> K; + for(int i=2;K && i<=N;i++){ + if(erased[i])continue; + for(int j=i;K && j<=N;j+=i){ + if(erased[j])continue; + erased[j] = true; + if(--K == 0) cout << j; + } + } + + return 0; +} diff --git a/solution/math/4134/main.cpp b/solution/math/4134/main.cpp new file mode 100644 index 0000000..147a4b9 --- /dev/null +++ b/solution/math/4134/main.cpp @@ -0,0 +1,29 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/7269680b194f4af3a6a05b0f88161fb2 +#include + +using namespace std; +typedef long long ll; + +bool isPrime(ll x) { + if(x < 2) return false; + for(ll i=2;i*i<=x;i++){ + if(x % i == 0) return false; + } + return true; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int t; cin >> t; + while(t--){ + ll x; cin >> x; + while(!isPrime(x))x++; + cout << x << '\n'; + } + + return 0; +} diff --git a/solution/math/5347/main.cpp b/solution/math/5347/main.cpp new file mode 100644 index 0000000..c12d975 --- /dev/null +++ b/solution/math/5347/main.cpp @@ -0,0 +1,27 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/3e2183112f164d1f98320d51f1ce2642 +#include + +using namespace std; +typedef long long ll; + +ll gcd(ll a, ll b){ + return b ? gcd(b, a % b) : a; +} +ll lcm(ll a, ll b) { + return a / gcd(a, b) * b; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int t; cin >> t; + while(t--){ + ll a, b; cin >> a >> b; + cout << lcm(a, b) << '\n'; + } + + return 0; +} diff --git a/solution/math/5618/Main.java b/solution/math/5618/Main.java new file mode 100644 index 0000000..9489704 --- /dev/null +++ b/solution/math/5618/Main.java @@ -0,0 +1,59 @@ +//Authored by : suin8 +//Co-authored by : tony9402 +//Link : http://boj.kr/41ff4237225e495ba67f4ae2477eacc9 + +import java.util.*; +import java.io.*; + +public class Main { + public static void main(String[] args) { + FastReader rd = new FastReader(); + + int n = rd.nextInt(); + int num1 = 0, num2 = 0, num3 = 0; + num1 = rd.nextInt(); + num2 = rd.nextInt(); + if(n == 3) { + num3 = rd.nextInt(); + } + + // 1부터 차례대로 2개 또는 3개의 숫자가 모두 + // 나누어지면 공약수 => 출력 + for(int i = 1;i <= num1; i++) { + if(num1 % i == 0 && num2 % i == 0 && num3 % i == 0) + System.out.println(i); + } + } + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} diff --git a/solution/math/5618/main.cpp b/solution/math/5618/main.cpp new file mode 100644 index 0000000..7104531 --- /dev/null +++ b/solution/math/5618/main.cpp @@ -0,0 +1,37 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/1df904530afc47edbe9a9983b130ce19 +#include + +using namespace std; + +int gcd(int a, int b) { + if(b == 0) return a; + return gcd(b, a%b); +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int n; cin >> n; + int a, b; cin >> a >> b; + a = gcd(a, b); + if(n == 3) { + int c; cin >> c; + a = gcd(a, c); + } + + vector ans; + for(int i=1;i*i<=a;i++){ + if(a % i != 0) continue; + ans.push_back(i); + if(i * i != a) ans.push_back(a / i); + } + sort(ans.begin(), ans.end()); + for(int i=0;i<(int)ans.size();i++){ + cout << ans[i] << '\n'; + } + + return 0; +} diff --git a/solution/math/5618/main.py b/solution/math/5618/main.py new file mode 100644 index 0000000..d6ffb39 --- /dev/null +++ b/solution/math/5618/main.py @@ -0,0 +1,32 @@ +# Authored by : gusdn3477 +# Co-authored by : tony9402 +# Link : http://boj.kr/aef57ade1e5c4c6e90f08a159fe96ca2 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +def GCD(x,y): + if y == 0: + return x + else: + return GCD(y, x%y) + +n = int(input()) +arr = list(map(int, input().split())) +outputs = list() + +gcd = arr[0] +for i in range(1, n): + gcd = GCD(gcd, arr[i]) + +x = 1 +while x * x <= gcd: + if gcd % x == 0: + outputs.append(x) + if x * x != gcd: + outputs.append(gcd // x) + x += 1 + +outputs.sort() +print(*outputs) diff --git a/solution/math/9613/main.cpp b/solution/math/9613/main.cpp new file mode 100644 index 0000000..668cd9c --- /dev/null +++ b/solution/math/9613/main.cpp @@ -0,0 +1,33 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/81fae9eae6b04d77bb40a1d3fb340b3c +#include + +using namespace std; +typedef long long ll; + +int gcd(int a, int b){ + if(b == 0)return a; + return gcd(b, a % b); +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int t; cin >> t; + while(t--){ + int n;cin >> n; + vector v(n); + for(int i=0;i> v[i]; + ll ans = 0; + for(int i=0;i + +using namespace std; + +constexpr int MAXN = 10005; +int uf[MAXN]; + +int find(int x) { + if(uf[x] < 0)return x; + return uf[x] = find(uf[x]); +} + +bool merge(int a, int b) { + a = find(a); + b = find(b); + if(a == b)return false; + uf[b] = a; + return true; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + vector> w; + for(int i=0;i> N >> M; + for(int i=0;i> a >> b >> c; + w.emplace_back(c, a, b); + } + sort(w.begin(), w.end()); + + int ans = 0; + for(auto &[c, a, b]: w) { + if(merge(a, b)) ans += c; + } + cout << ans; + + return 0; +} diff --git a/solution/minimum_spanning_tree/1368/main.cpp b/solution/minimum_spanning_tree/1368/main.cpp new file mode 100644 index 0000000..cf16605 --- /dev/null +++ b/solution/minimum_spanning_tree/1368/main.cpp @@ -0,0 +1,51 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/4d85f4e6945642d4abb30eb188480027 +#include + +using namespace std; +typedef long long ll; + +int uf[303]; + +int find(int x) { + if(uf[x] < 0) return x; + return uf[x] = find(uf[x]); +} + +bool merge(int a, int b) { + a = find(a); + b = find(b); + if(a == b)return false; + uf[b] = a; + return true; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + vector> w; + for(int i=0;i<=N;i++) uf[i] = -1; + for(int i=0;i> x; + w.emplace_back(x, i, N); + } + for(int i=0;i> x; + if(i >= j) continue; + w.emplace_back(x, i, j); + } + } + + sort(w.begin(), w.end()); + ll answer = 0; + for(auto &[W, a, b]: w) { + if(merge(a, b)) answer += W; + } + cout << answer; + + return 0; +} diff --git a/solution/minimum_spanning_tree/1368/main.py b/solution/minimum_spanning_tree/1368/main.py new file mode 100644 index 0000000..985ea32 --- /dev/null +++ b/solution/minimum_spanning_tree/1368/main.py @@ -0,0 +1,47 @@ +# Authored by : chj3748 +# Co-authored by : - +# Link : http://boj.kr/aa071582c18b4cb1acaa18950654ff3e +import sys +import heapq + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +dig_costs = [int(input()) for _ in range(N)] +link_costs = [list(map(int, input().split())) for _ in range(N)] +parents = list(range(N + 1)) + +def find_parent(x): + if parents[x] != x: + parents[x] = find_parent(parents[x]) + return parents[x] + +def union_set(a, b): + parent_a = find_parent(a) + parent_b = find_parent(b) + if parent_a < parent_b: + parents[parent_b] = parent_a + else: + parents[parent_a] = parent_b + +edges = [] +for i in range(N): + for j in range(i + 1, N): + heapq.heappush(edges, [link_costs[i][j], i+1, j+1]) + heapq.heappush(edges, [dig_costs[i], 0, i + 1]) + +link_cnt = 0 +total = 0 +while edges: + if link_cnt == N: + break + cost, n1, n2 = heapq.heappop(edges) + p_n1 = find_parent(n1) + p_n2 = find_parent(n2) + if p_n1 != p_n2: + union_set(n1, n2) + total += cost + link_cnt += 1 + +print(total) diff --git a/solution/minimum_spanning_tree/14621/main.cpp b/solution/minimum_spanning_tree/14621/main.cpp new file mode 100644 index 0000000..21fcce9 --- /dev/null +++ b/solution/minimum_spanning_tree/14621/main.cpp @@ -0,0 +1,61 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/a20ee766193d402682304dd53ce97459 +#include + +using namespace std; +typedef long long ll; + +struct Node{ + ll w; + int a, b; + Node(ll w=0, int a=0, int b=0):w(w),a(a),b(b){} + bool operator<(const Node& o) const { return w < o.w; } +}; +vector v; +int uf[1005], group[1005]; + +int find(int x) { + if(uf[x] < 0)return x; + return uf[x] = find(uf[x]); +} + +bool merge(int a, int b){ + a = find(a); + b = find(b); + if(a == b)return false; + uf[b] = a; + return true; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + // Initial + for(int i=0;i<1005;i++) uf[i] = -1; + + int N, M; cin >> N >> M; + for(int i=1;i<=N;i++) { + char x;cin >> x; + group[i] = x == 'M'; + } + for(int i=0;i> a >> b >> c; + if(group[a] == group[b])continue; + v.emplace_back(c, a, b); + } + sort(v.begin(), v.end()); + + ll ans = 0; + for(int i=0;i<(int)v.size();i++){ + if(merge(v[i].a, v[i].b)) ans += v[i].w; + } + for(int i=1;i<=N;i++) { + if(find(1) != find(i)) ans = -1; + } + cout << ans; + + return 0; +} + diff --git a/solution/minimum_spanning_tree/16398/main.cpp b/solution/minimum_spanning_tree/16398/main.cpp new file mode 100644 index 0000000..d8e621b --- /dev/null +++ b/solution/minimum_spanning_tree/16398/main.cpp @@ -0,0 +1,56 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/4e4a00d9c5004014aab885f379b3578f +#include + +using namespace std; +typedef long long ll; + +struct Node{ + ll w; + int a, b; + Node(ll w=0, int a=0, int b=0):w(w),a(a),b(b){} + bool operator<(const Node& o) const { return w < o.w; } +}; +vector v; +int uf[1005]; + +int find(int x) { + if(uf[x] < 0)return x; + return uf[x] = find(uf[x]); +} + +bool merge(int a, int b){ + a = find(a); + b = find(b); + if(a == b)return false; + uf[b] = a; + return true; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + // Initial + for(int i=0;i<1005;i++) uf[i] = -1; + + int N; cin >> N; + for(int i=0;i> x; + if(i >= j)continue; + v.emplace_back(x, i, j); + } + } + sort(v.begin(), v.end()); + + ll ans = 0; + for(int i=0;i<(int)v.size();i++){ + if(merge(v[i].a, v[i].b)) ans += v[i].w; + } + cout << ans; + + return 0; +} + diff --git a/solution/minimum_spanning_tree/1647/main.cpp b/solution/minimum_spanning_tree/1647/main.cpp new file mode 100644 index 0000000..23c6923 --- /dev/null +++ b/solution/minimum_spanning_tree/1647/main.cpp @@ -0,0 +1,51 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/c11a8cc3ac094764bf7e1131ad9939ac +#include + +using namespace std; +typedef long long ll; + +constexpr int MAXN = 100005; +int uf[MAXN]; + +int find(int x) { + if(uf[x] < 0)return x; + return uf[x] = find(uf[x]); +} + +bool merge(int a, int b) { + a = find(a); + b = find(b); + if(a == b)return false; + uf[b] = a; + return true; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + vector> w; + for(int i=0;i> N >> M; + for(int i=0;i> a >> b >> c; + w.emplace_back(c, a, b); + } + sort(w.begin(), w.end()); + + ll ans = 0; + int cnt = 0; + for(auto &[c, a, b]: w) { + if(merge(a, b)) { + ans += c; + if(++cnt == N - 2) break; + } + } + cout << ans; + + return 0; +} + diff --git a/solution/minimum_spanning_tree/1647/main.py b/solution/minimum_spanning_tree/1647/main.py new file mode 100644 index 0000000..4cf6832 --- /dev/null +++ b/solution/minimum_spanning_tree/1647/main.py @@ -0,0 +1,44 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/eca68e03c7f640158b9c6a6841997682 + +import sys + +def input(): + return sys.stdin.readline().rstrip() + +def union(x,y): + x, y = find_parent(x), find_parent(y) + if x < y: + parent[y] = x + else: + parent[x] = y + +def find_parent(x): + if x != parent[x]: + parent[x] = find_parent(parent[x]) + return parent[x] + +N = int(input()) +parent = [i for i in range(N+1)] +arr = [] +ans = [] +total = 0 +ct = 0 +for i in range(N): + arr.append(list(map(int, input().split()))) +for i in range(N): + for j in range(N): + if i == j: + continue + ans.append((i,j,arr[i][j])) +ans.sort(key = lambda x : x[2]) +for i in range(N*(N-1)): + a,b = find_parent(ans[i][0]), find_parent(ans[i][1]) + if a != b: + union(a,b) + total += ans[i][2] + ct += 1 + if ct == N-1: + break +print(total) \ No newline at end of file diff --git a/solution/minimum_spanning_tree/1774/main.cpp b/solution/minimum_spanning_tree/1774/main.cpp new file mode 100644 index 0000000..1f38bef --- /dev/null +++ b/solution/minimum_spanning_tree/1774/main.cpp @@ -0,0 +1,61 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/56c86c3089dd42369ddf2d2277479675 +#include + +using namespace std; +typedef long long ll; + +int uf[1005]; + +int find(int x) { + if(uf[x] < 0) return x; + return uf[x] = find(uf[x]); +} + +bool merge(int a, int b) { + a = find(a); + b = find(b); + if(a == b) return false; + uf[b] = a; + return true; +} + +vector> v; +vector> w; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N, M; cin >> N >> M; + for(int i=0;i> a >> b; + v.emplace_back(a, b); + + uf[i] = -1; + } + for(int i=0;i> a >> b; + merge(--a, --b); + } + + for(int i=0;i + +using namespace std; + +constexpr int MAXN = 1005; +int uf[MAXN]; + +int find(int x) { + if(uf[x] < 0)return x; + return uf[x] = find(uf[x]); +} + +bool merge(int a, int b) { + a = find(a); + b = find(b); + if(a == b)return false; + uf[b] = a; + return true; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + vector> w; + for(int i=0;i> N >> M; + for(int i=0;i> a >> b >> c; + w.emplace_back(c, a, b); + } + sort(w.begin(), w.end()); + + int ans = 0; + for(auto &[c, a, b]: w) { + if(merge(a, b)) ans += c; + } + cout << ans; + + return 0; +} + diff --git a/solution/minimum_spanning_tree/1922/main.py b/solution/minimum_spanning_tree/1922/main.py new file mode 100644 index 0000000..577589a --- /dev/null +++ b/solution/minimum_spanning_tree/1922/main.py @@ -0,0 +1,35 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/e8d47d936e104388916666605df5778d + +import sys + +def input(): + return sys.stdin.readline().rstrip() + +def union(x, y): + x = find_parent(x) + y = find_parent(y) + if x < y: + parent[y] = x + else: + parent[x] = y + +def find_parent(x): + if x != parent[x]: + parent[x] = find_parent(parent[x]) + return parent[x] + +N = int(input()) +M = int(input()) +parent = [i for i in range(N+1)] +arr = [] +ans = 0 +for i in range(M): + arr.append(list(map(int, input().split()))) +arr.sort(key = lambda x : x[2]) +for i in range(M): + if find_parent(arr[i][0]) != find_parent(arr[i][1]): + union(arr[i][0], arr[i][1]) + ans += arr[i][2] +print(ans) \ No newline at end of file diff --git a/solution/minimum_spanning_tree/20010/main.cpp b/solution/minimum_spanning_tree/20010/main.cpp new file mode 100644 index 0000000..a9b1b4c --- /dev/null +++ b/solution/minimum_spanning_tree/20010/main.cpp @@ -0,0 +1,70 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/c8fbfa4f718847b8a169037608c2e8be +#include + +using namespace std; + +int uf[1005], N, K; +vector>> graph; +vector> V; + +int find(int x) { + if(uf[x] < 0)return x; + return uf[x] = find(uf[x]); +} + +bool merge(int a, int b) { + a = find(a); + b = find(b); + if(a == b)return false; + uf[b] = a; + return true; +} + +pair BFS(int s) { + vector visited(N); + queue> Q; + Q.emplace(s, 0); + visited[s] = true; + pair ret = make_pair(0, 0); // [dist, node] + while(!Q.empty()){ + auto [cur, dist] = Q.front(); Q.pop(); + ret = max(ret, make_pair(dist, cur)); + for(auto &[nxt, cost]: graph[cur]) { + if(visited[nxt]) continue; + visited[nxt] = true; + Q.emplace(nxt, dist + cost); + } + } + return ret; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + for(int i=0;i<1000;i++) uf[i] = -1; + + cin >> N >> K; + graph.resize(N); + for(int i=0;i> a >> b >> c; + V.emplace_back(c, a, b); + } + sort(V.begin(), V.end()); + + int answer = 0; + for(auto &[c, a, b]: V){ + if(merge(a, b)) { + answer += c; + graph[a].emplace_back(b, c); + graph[b].emplace_back(a, c); + } + } + + cout << answer << '\n'; + cout << BFS(BFS(0).second).first; + + return 0; +} diff --git a/solution/minimum_spanning_tree/21924/main.py b/solution/minimum_spanning_tree/21924/main.py new file mode 100644 index 0000000..6703a47 --- /dev/null +++ b/solution/minimum_spanning_tree/21924/main.py @@ -0,0 +1,46 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/5be3726ed4ca4231bc7773980ae90a6e + +import sys + +def input(): + return sys.stdin.readline().rstrip() + +def union(x, y): + x = find_parent(parent[x]) + y = find_parent(parent[y]) + if x < y: + parent[y] = x + else: + parent[x] = y + +def find_parent(x): + if x != parent[x]: + parent[x] = find_parent(parent[x]) + return parent[x] + +N, M = map(int, input().split()) +parent = [i for i in range(N+1)] + +total = 0 +total_tree = 0 +arr = [] +for i in range(M): + arr.append(list(map(int, input().split()))) +arr.sort(key = lambda x : x[2]) +for i in range(M): + a = find_parent(arr[i][0]) + b = find_parent(arr[i][1]) + total += arr[i][2] + if a != b: + union(a,b) + total_tree += arr[i][2] + +for i in range(1, N+1): + find_parent(i) + +if parent.count(parent[1]) == N: + print(total - total_tree) +else: + print(-1) diff --git a/solution/minimum_spanning_tree/2887/main.py b/solution/minimum_spanning_tree/2887/main.py new file mode 100644 index 0000000..eff7edd --- /dev/null +++ b/solution/minimum_spanning_tree/2887/main.py @@ -0,0 +1,51 @@ +# Authored by : chj3748 +# Co-authored by : - +# Link : http://boj.kr/2e3dd1e84f754eaa90dfdd6d75692910 +import sys +import heapq + +def input(): + return sys.stdin.readline().rstrip() + +def find_parent(p): + if p_parents[p] != p: + p_parents[p] = find_parent(p_parents[p]) + return p_parents[p] + +def union_planet(p1, p2): + p1_parent = find_parent(p1) + p2_parent = find_parent(p2) + if p1_parent == p2_parent: + return False + if p1_parent < p2_parent: + p_parents[p2_parent] = p1_parent + else: + p_parents[p1_parent] = p2_parent + return True + +N = int(input()) +planets = [] +p_parents = [i for i in range(N)] +edges = [] + +for i in range(N): + p_info = list(map(int, input().split())) + planets.append(p_info+[i]) + +for sort_n in range(3): + planets.sort(key=lambda x: x[sort_n]) + for i in range(N - 1): + p1x, p1 = planets[i][sort_n], planets[i][3] + p2x, p2 = planets[i + 1][sort_n], planets[i + 1][3] + heapq.heappush(edges, [ abs(p1x - p2x), p1, p2 ]) + +answer = 0 +cnt = 0 +while edges: + cost, p1, p2 = heapq.heappop(edges) + if union_planet(p1, p2): + answer += cost + cnt += 1 + if cnt == N - 1: + break +print(answer) diff --git a/solution/minimum_spanning_tree/4386/main.py b/solution/minimum_spanning_tree/4386/main.py new file mode 100644 index 0000000..25818d5 --- /dev/null +++ b/solution/minimum_spanning_tree/4386/main.py @@ -0,0 +1,56 @@ +# Authored by : samuel95 +# Co-authored by : - +# Link : http://boj.kr/56db895ff06047bb8d3cea233a924472 +import sys, math + +def input(): + return sys.stdin.readline().rstrip() + +def find(parent, a): + if parent[a] == a: + return a + parent[a] = find(parent, parent[a]) + return parent[a] + +def union(parent, a, b): + a = find(parent, a) + b = find(parent, b) + if a > b: + parent[a] = b + return True + elif a < b: + parent[b] = a + return True + return False + +n = int(input()) + +# 별들의 좌표를 넣어준다. +stars = [] +for i in range(n): + x,y = map(float,input().split()) + stars.append([x,y]) + +# MST 활용을 위해 (거리,시작,끝)을 만든다. +parent = [i for i in range(n+1)] +edges = [] +for i in range(n-1): + for j in range(i+1,n): + start = stars[i] + end = stars[j] + distance = math.sqrt((start[0]-end[0])**2 + (start[1]-end[1])**2) + edges.append([distance,i,j]) + +edges.sort() + +cnt, ans = 0,0 + +# Union Find +for edge in edges: + if union(parent, edge[1], edge[2]): + ans += edge[0] + cnt += 1 + if cnt == n - 1: + break + +print(round(ans,2)) diff --git a/solution/minimum_spanning_tree/6497/main.py b/solution/minimum_spanning_tree/6497/main.py new file mode 100644 index 0000000..60e380b --- /dev/null +++ b/solution/minimum_spanning_tree/6497/main.py @@ -0,0 +1,62 @@ +# Authored by : cieske +# Co-authored by : - +# Link : http://boj.kr/b650c3b805ac4251a7a125606197836a + +import sys + +def input(): + return sys.stdin.readline().rstrip() + +while True: + n, m = map(int, input().split()) + + if n == 0 and m == 0: + break + + edge = [] + total = 0 + for _ in range(m): + x, y, w = map(int, input().split()) + edge.append([x, y, w]) + total += w + num_edge = 0 + edge.sort(key=lambda x: -x[2]) + + # Disjoint set 구성 + dis_set = [-1 for _ in range(n+1)] + def upward(x, change_lst): + if dis_set[x] < 0: + return x + change_lst.append(x) + return upward(dis_set[x], change_lst) + + def find_root(x): + change_lst = [] + res = upward(x, change_lst) + + for idx in change_lst: + dis_set[idx] = res + return res + + def union(x, y): + x_root = find_root(x) + y_root = find_root(y) + if x_root != y_root: # 두 node의 root가 다르다면? + if dis_set[x_root] < dis_set[y_root]: + dis_set[y_root] = x_root + if dis_set[x_root] > dis_set[y_root]: + dis_set[x_root] = y_root + else: + dis_set[x_root] = -1 + dis_set[y_root] = x_root + + # 크루스칼 시작 + sol = 0 + while num_edge < n-1: + x, y, w = edge.pop() + if find_root(x) != find_root(y): + union(x, y) + sol += w + num_edge += 1 + + print(total - sol) diff --git a/solution/prefix_sum/10986/main.cpp b/solution/prefix_sum/10986/main.cpp new file mode 100644 index 0000000..c12e328 --- /dev/null +++ b/solution/prefix_sum/10986/main.cpp @@ -0,0 +1,31 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/20743d7ff7ab44a3b917f45b8e064f16 +#include + +using namespace std; +typedef long long ll; + +ll mod[1000]; // 0 ~ 999 + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N, M; cin >> N >> M; + ll sum =0; + mod[0] = 1; + for(int i=1;i<=N;i++) { + int x; cin >> x; + x %= M; + sum = (sum + x) % M; + mod[sum] ++; + } + ll answer = 0; + for(int i=0;i + +using namespace std; + +int num[100010], sum[100010]; + +int main() { + ios::sync_with_stdio(false); + cin.tie(nullptr); + + int N, M; cin >> N >> M; + + // 입력과 동시에 누적합을 구해놓습니다. + for(int i = 1;i <= N;i++) { + cin >> num[i]; + sum[i] = sum[i - 1] + num[i]; + } + + // end까지의 합 - begin전 까지의 합 = begin ~ end사이 합 + for(int i = 0;i < M;i++) { + int begin, end; + cin >> begin >> end; + cout << sum[end] - sum[begin - 1] << '\n'; + } + + return 0; +} diff --git a/solution/prefix_sum/11659/main.py b/solution/prefix_sum/11659/main.py new file mode 100644 index 0000000..d4f7806 --- /dev/null +++ b/solution/prefix_sum/11659/main.py @@ -0,0 +1,19 @@ +# Authored by : cieske +# Co-authored by : - +# Link : http://boj.kr/6ada03e306dd451fbea38bfb38db2a74 + +import sys +def input(): + return sys.stdin.readline().rstrip() + +n, m = map(int, input().split()) +lst = list(map(int, input().split())) +prefix_sum = [lst[0]] +for i in range(1, n): # 누적 합 구해두기 + prefix_sum.append(prefix_sum[i-1] + lst[i]) + +for _ in range(m): + x, y = map(int, input().split()) + x -= 1 + if x: print(prefix_sum[y-1] - prefix_sum[x-1]) + else: print(prefix_sum[y-1]) diff --git a/solution/prefix_sum/11660/main.cpp b/solution/prefix_sum/11660/main.cpp new file mode 100644 index 0000000..985034e --- /dev/null +++ b/solution/prefix_sum/11660/main.cpp @@ -0,0 +1,29 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/c28a9148cd334f45b6edcbc40ae7ec15 +#include + +using namespace std; + +int prefix[1030][1030]; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N, Q; cin >> N >> Q; + for(int i=1;i<=N;i++) { + for(int j=1;j<=N;j++) { + cin >> prefix[i][j]; + prefix[i][j] = prefix[i][j] + prefix[i-1][j] + prefix[i][j-1] - prefix[i-1][j-1]; + } + } + + while(Q--){ + int a, b, c, d; cin >> a >> b>> c>>d; + a--; b--; + cout << prefix[c][d] - prefix[a][d] - prefix[c][b] + prefix[a][b] << '\n'; + } + + return 0; +} diff --git a/solution/prefix_sum/14929/main.cpp b/solution/prefix_sum/14929/main.cpp new file mode 100644 index 0000000..8885d2f --- /dev/null +++ b/solution/prefix_sum/14929/main.cpp @@ -0,0 +1,23 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/0351fb8839dd449cbdc10b9e78c47410 +#include + +using namespace std; +typedef long long ll; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + ll sum = 0, square_sum = 0; + for(int i=0;i> x; + sum += x; + square_sum += x * x; + } + cout << (sum * sum - square_sum) / 2; + + return 0; +} diff --git a/solution/prefix_sum/16971/main.cpp b/solution/prefix_sum/16971/main.cpp new file mode 100644 index 0000000..6c973f9 --- /dev/null +++ b/solution/prefix_sum/16971/main.cpp @@ -0,0 +1,40 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/3e340e082d68472b8a8559566398507e +#include + +using namespace std; + +int arr[1005][1005], prefix[1005][2]; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N, M; cin >> N >> M; + int total = 0, answer = 0; + for(int i=1;i<=N;i++) { + for(int j=1;j<=M;j++) { + int &x = arr[i][j]; + cin >> x; + if(1 < j && j < M) x <<= 1; + if(1 < i && i < N) x <<= 1; + total += x; + prefix[i][0] += x; + prefix[j][1] += x; + } + } + answer = total; + + for(int i=2;i + +using namespace std; + +int arr[222][222]; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N, M; cin >> N >> M; + for(int i=1;i<=N;i++) { + for(int j=1;j<=M;j++) { + cin >> arr[i][j]; + arr[i][j] += arr[i-1][j]; + } + } + + int answer = INT_MIN; + for(int i=1;i<=N;i++){ + for(int j=i;j<=N;j++) { + int sum = 0; + for(int k=1;k<=M;k++){ + int cur = arr[j][k] - arr[i - 1][k]; + sum += cur; + if(sum < cur) sum = cur; + answer = max(answer, sum); + } + } + } + cout << answer; + + return 0; +} diff --git a/solution/prefix_sum/2015/main.cpp b/solution/prefix_sum/2015/main.cpp new file mode 100644 index 0000000..a87e1db --- /dev/null +++ b/solution/prefix_sum/2015/main.cpp @@ -0,0 +1,30 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/d46daeae8c194cb080f41f07b383b113 +#include + +using namespace std; +typedef long long ll; + +unordered_map mp; +ll prefix[200002]; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + ll N, K; cin >> N >> K; + ll answer = 0; + for(int i=1;i<=N;i++) { + cin >> prefix[i]; + prefix[i] += prefix[i - 1]; + + if(prefix[i] == K) answer ++; + + if(mp.count(prefix[i] - K)) answer += mp[prefix[i] - K]; + mp[prefix[i]] ++; + } + cout << answer; + + return 0; +} diff --git a/solution/prefix_sum/2015/main.py b/solution/prefix_sum/2015/main.py new file mode 100644 index 0000000..69cfd39 --- /dev/null +++ b/solution/prefix_sum/2015/main.py @@ -0,0 +1,22 @@ +# Authored by : cieske +# Co-authored by : - +# Link : http://boj.kr/c3cc5338e8fa49ae8136e4af174221df +from collections import defaultdict +import sys +def input(): + return sys.stdin.readline().rstrip() + +n, k = map(int, input().split()) +lst = list(map(int, input().split())) +dic = defaultdict(int) # 어떤 값이 기존에 몇 번 나왔는지 저장 + +for i in range(1, n): lst[i] += lst[i-1] # 누적합 inplace로 만들기 + +cnt = 0 +for num in lst: + if num == k: cnt += 1 # 1부터 더한 값 중 k 있으면 cnt += 1 + # O(n) 연산 대신 dictionary에서 찾는 것으로 시간 단축 + cnt += dic[num-k] # 이미 본 누적합 값과 num으로 k 만들 수 있으면 추가 + dic[num] += 1 # num 만들 수 있는 개수 +1 + +print(cnt) \ No newline at end of file diff --git a/solution/prefix_sum/20438/main.cpp b/solution/prefix_sum/20438/main.cpp new file mode 100644 index 0000000..3287088 --- /dev/null +++ b/solution/prefix_sum/20438/main.cpp @@ -0,0 +1,39 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/2d250c49804d4fb6a38cbe6e752cd87d +#include + +using namespace std; + +int prefix[5050], sleep[5050], used[5050]; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N, K, Q, M; cin >> N >> K >> Q >> M; + for(int i=1;i<=K;i++) { + int x;cin >> x; + sleep[x] = 1; + } + for(int i=1;i<=Q;i++) { + int x;cin >> x; + if(sleep[x]) continue; + for(int j=x;j<=N+2;j+=x) { + if(sleep[j]) continue; + used[j] = 1; + } + } + + for(int i=3;i<=N+2;i++) { + prefix[i] = prefix[i-1]; + if(used[i] == 0) prefix[i] ++; + } + + for(int i=1;i<=M;i++){ + int L, R; cin >> L >> R; + cout << prefix[R] - prefix[L - 1] << '\n'; + } + + return 0; +} diff --git a/solution/prefix_sum/20440/main.cpp b/solution/prefix_sum/20440/main.cpp new file mode 100644 index 0000000..d76d35f --- /dev/null +++ b/solution/prefix_sum/20440/main.cpp @@ -0,0 +1,45 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/ded80dcd2d094ee8af7c04ff371b3749 +#include + +using namespace std; +typedef long long ll; + +vector> V; +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + for(int i=0;i> s >> e; + V.emplace_back(s, +1); + V.emplace_back(e, -1); + } + sort(V.begin(),V.end()); + int ansL = -1, ansR = -1; + int sum = 0, mx = 0; + for(int i=0;i<2 * N;i++) { + sum += V[i].second; + mx = max(mx, sum); + } + + for(int i=0;i<2 * N;i++) { + sum += V[i].second; + if(i + 1 < 2 * N && V[i + 1].first == V[i].first) continue; + if(!~ansL) { + if(sum == mx) { + ansL = V[i].first; + } + } + else if(sum != mx) { + ansR = V[i].first; + break; + } + } + cout << mx << '\n'; + cout << ansL << " " << ansR; + + return 0; +} diff --git a/solution/prefix_sum/20543/main.cpp b/solution/prefix_sum/20543/main.cpp new file mode 100644 index 0000000..cebfdce --- /dev/null +++ b/solution/prefix_sum/20543/main.cpp @@ -0,0 +1,33 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/2b018771f61549749df9e0a5a023ba28 +#include + +using namespace std; +typedef long long ll; +ll prefix[4004][4004], V[2002][2002], ans[2002][2002]; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N, M; cin >> N >> M; + + int dx = M / 2; + for(int i=1;i<=N;i++) { + for(int j=1;j<=N;j++) { + cin >> V[i][j]; + prefix[i + M - 1][j + M - 1] = prefix[i + M - 2][j + M - 1] + prefix[i + M - 1][j + M - 2] - prefix[i + M - 2][j + M - 2]; + ans[i + dx][j + dx] = -(V[i][j] + prefix[i + M - 1][j + M - 1] - prefix[i - 1][j + M - 1] - prefix[i + M - 1][j - 1] + prefix[i - 1][j - 1]); + prefix[i + M - 1][j + M - 1] += ans[i + dx][j + dx]; + } + } + for(int i=1;i<=N;i++) { + for(int j=1;j<=N;j++) { + cout << ans[i][j] << " "; + } + cout << '\n'; + } + + return 0; +} diff --git a/solution/prefix_sum/21318/main.cpp b/solution/prefix_sum/21318/main.cpp new file mode 100644 index 0000000..f4f2068 --- /dev/null +++ b/solution/prefix_sum/21318/main.cpp @@ -0,0 +1,29 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/3aaead48f31d48d19a9884356908d293 +#include + +using namespace std; + +int arr[100005], prefix[100005]; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + for(int i=1;i<=N;i++) cin >> arr[i]; + for(int i=1;i<=N;i++) { + if(arr[i] > arr[i + 1]) prefix[i] = 1; + prefix[i] += prefix[i - 1]; + } + + int Q; cin >> Q; + while(Q--){ + int x, y; cin >> x >> y; + --x; --y; + cout << prefix[y] - prefix[x] << '\n'; + } + + return 0; +} diff --git a/solution/prefix_sum/2167/main.cpp b/solution/prefix_sum/2167/main.cpp new file mode 100644 index 0000000..1cc1654 --- /dev/null +++ b/solution/prefix_sum/2167/main.cpp @@ -0,0 +1,28 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/5182387e6c9745238986dcbe9231c45d +#include + +using namespace std; +int prefix[303][303]; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N, M; cin >> N >> M; + for(int i=1;i<=N;i++) { + for(int j=1;j<=M;j++) { + cin >> prefix[i][j]; + prefix[i][j] = prefix[i][j] + prefix[i-1][j] + prefix[i][j-1] - prefix[i-1][j-1]; + } + } + int Q; cin >> Q; + while(Q--) { + int a, b, c, d; cin >> a >> b >> c >> d; + --a; -- b; + cout << prefix[c][d] - prefix[a][d] - prefix[c][b] + prefix[a][b] << '\n'; + } + + return 0; +} diff --git a/solution/prefix_sum/21757/main.cpp b/solution/prefix_sum/21757/main.cpp new file mode 100644 index 0000000..bc34c2d --- /dev/null +++ b/solution/prefix_sum/21757/main.cpp @@ -0,0 +1,40 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/421ce6bb00ca40709c15dc5df958d5f1 +#include + +using namespace std; +typedef long long ll; + +const int MAXN = 100000; +ll prefix[MAXN + 5]; +ll L[MAXN + 5], R[MAXN + 5]; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + for(int i=1;i<=N;i++) { + cin >> prefix[i]; + prefix[i] += prefix[i - 1]; + } + + for(int i = 1; i <= N; i++) { + L[i] = L[i - 1]; + if(prefix[N] == 4 * prefix[i]) L[i] ++; + } + + for(int i = N - 1; i >= 1; i--) { + R[i] = R[i + 1]; + if(prefix[N] * 3 == 4 * prefix[i]) R[i] ++; + } + + ll answer = 0; + for(int i = 2; i < N - 1; i++) { + if(prefix[N] == prefix[i] * 2) answer += L[i - 1] * R[i + 1]; + } + cout << answer; + + return 0; +} diff --git a/solution/shortest_path/10282/main.py b/solution/shortest_path/10282/main.py new file mode 100644 index 0000000..b2f3d6d --- /dev/null +++ b/solution/shortest_path/10282/main.py @@ -0,0 +1,35 @@ +# Authored by : yj2221 +# Co-authored by : tony9402 +# Link : http://boj.kr/b4c107ca25f442e8bef9f8486e248741 + +import sys +import heapq + +def input(): + return sys.stdin.readline().rstrip() + +INF = 99999999 + +def dijkstra(start, dependency): + pq = [[0,start]] + result = [INF for _ in range(n+1)] + result[start] = 0 + while pq: + cur_time, cur = heapq.heappop(pq) + for next_com, next_time in dependency[cur].items(): + time = cur_time + next_time + if result[next_com] > time: + result[next_com] = time + heapq.heappush(pq, [time, next_com]) + return result + +for testcase in range(int(input())): + n, d, c = map(int,input().split()) + dependency = {i:{} for i in range(1,n+1)} + for _ in range(d): + a, b, s = map(int,input().split()) + dependency[b][a] = s + + result = dijkstra(c, dependency) + result = [value for value in result if value != INF] + print(len(result), max(result)) diff --git a/solution/shortest_path/1719/main.py b/solution/shortest_path/1719/main.py new file mode 100644 index 0000000..9be430b --- /dev/null +++ b/solution/shortest_path/1719/main.py @@ -0,0 +1,46 @@ +# Authored by : yj2221 +# Co-authored by : - +# Link : http://boj.kr/480b70b04e3b4f5c8dd567bf3bde859c + +import heapq +import sys + +def input(): + return sys.stdin.readline().rstrip() + +n, m = map(int, input().split()) +graph = {i:{} for i in range(1, n+1)} +for _ in range(m): + a, b, t = map(int, input().split()) + graph[a][b] = min(graph[a][b], t) + graph[b][a] = min(graph[b][a], t) + +INF = 999999 +def dijkstra(start): + dist_result = [INF for _ in range(n+1)] + dist_result[start] = 0 + index_result = [None] * (n+1) + visit = [False] * (n+1) + visit[start] = True + pq = [(0, start, [])] + while pq: + cur_dist, cur, path = heapq.heappop(pq) + for next_node, next_dist in graph[cur].items(): + dist = next_dist + cur_dist + if visit[next_node]: continue + if dist_result[next_node] <= dist: continue + dist_result[next_node] = dist + index_result[next_node] = path + [next_node] + heapq.heappush(pq, (dist, next_node, index_result[next_node])) + return index_result + +for start in range(1, n+1): + result = dijkstra(start) + answer = '' + for i in range(0, n): + if start==i: + answer+='-' + else: + answer+=str(result[i+1][0]) + answer+=' ' + print(answer[:-1]) diff --git a/solution/shortest_path/main.py b/solution/shortest_path/main.py new file mode 100644 index 0000000..7deec72 --- /dev/null +++ b/solution/shortest_path/main.py @@ -0,0 +1,41 @@ +# Authored by : cieske +# Co-authored by : - +# Link : http://boj.kr/6d0558a4848c49098f08a06f655cd86c + +from heapq import heappush, heappop +import sys +def input(): + return sys.stdin.readline().rstrip() + +INF = 10000000 +def dijkstra(road, start): + dp = [INF]*(n+1) + dp[start] = 0 + heap = [] + heappush(heap, [0, start]) + + while heap: + cur_time, cur = heappop(heap) + + if cur_time > dp[cur]: #기존 경로 사용 + continue + + for t, nxt in road[cur]: + new_time = t + cur_time + if new_time < dp[nxt]: + dp[nxt] = new_time + heappush(heap, [new_time, nxt]) + return dp + +n, m, k = map(int, input().split()) +road = [[] for _ in range(n+1)] +road_rev = [[] for _ in range(n+1)] +for _ in range(m): + x, y, t = map(int, input().split()) + road[x].append([t, y]) + road_rev[y].append([t, x]) + +dp = dijkstra(road, k) +dp_rev = dijkstra(road_rev, k) + +print(max([dp[i]+dp_rev[i] for i in range(1, n+1)])) diff --git a/solution/simulation/14499/main.py b/solution/simulation/14499/main.py new file mode 100644 index 0000000..a105044 --- /dev/null +++ b/solution/simulation/14499/main.py @@ -0,0 +1,60 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/075c16a3aae141859d0fc937c689cae6 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N, M, x, y, K = map(int, input().split()) +arr = [] +for i in range(N): + arr.append(list(map(int, input().split()))) +command = list(map(int, input().split())) +w, e, n, s, f, b = 0, 0, 0, 0, 0, 0 + +for i in command: + if i == 1: # 동쪽으로 + dy = y + 1 + if dy >= M: + continue + y += 1 + w, e, n, s, f, b = s, n, w, e, f, b + if arr[x][y] == 0: + arr[x][y] = s + else: + s, arr[x][y] = arr[x][y], 0 + print(n) + elif i == 2: # 서쪽으로 이동 + dy = y - 1 + if dy < 0: + continue + y -= 1 + w, e, n, s, f, b = n, s, e, w, f, b + if arr[x][y] == 0: + arr[x][y] = s + else: + s, arr[x][y] = arr[x][y], 0 + print(n) + elif i == 3: # 북쪽으로 이동 + dx = x - 1 + if dx < 0: + continue + x -= 1 + w, e, n, s, f, b = w, e, b, f, n, s + if arr[x][y] == 0: + arr[x][y] = s + else: + s, arr[x][y] = arr[x][y], 0 + print(n) + elif i == 4: # 남쪽으로 이동 + dx = x + 1 + if dx >= N: + continue + x += 1 + w, e, n, s, f, b = w, e, f, b, s, n + if arr[x][y] == 0: + arr[x][y] = s + else: + s, arr[x][y] = arr[x][y], 0 + print(n) \ No newline at end of file diff --git a/solution/simulation/14891/main.py b/solution/simulation/14891/main.py new file mode 100644 index 0000000..8cd4bf0 --- /dev/null +++ b/solution/simulation/14891/main.py @@ -0,0 +1,40 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/7ce69b01ff0547dd9aa76e858a7bd215 +import sys +from collections import deque + +def input(): + return sys.stdin.readline().rstrip() + +arr = [] +ans = 0 + +for i in range(4): + arr.append(deque(input())) + +K = int(input()) + +for i in range(K): + queue = deque() + a, b = map(int, input().split()) + visited = [0] * 4 + queue.append((a-1,b,arr[a-1][6],arr[a-1][2])) + visited[a-1] = 1 + arr[a-1].rotate(b) + while queue: + n,d,l,r = queue.popleft() + if n-1 >= 0 and arr[n-1][2] != l and visited[n-1] == 0: + visited[n-1] = 1 + queue.append((n-1, -d, arr[n-1][6], arr[n-1][2])) + arr[n-1].rotate(-d) + if n+1 < 4 and arr[n+1][6] != r and visited[n+1] == 0: + visited[n+1] = 1 + queue.append((n+1, -d, arr[n+1][6], arr[n+1][2])) + arr[n+1].rotate(-d) + +for i in range(4): + if arr[i][0] == '1': + ans += 2 ** i + +print(ans) diff --git a/solution/simulation/16234/main.cpp b/solution/simulation/16234/main.cpp new file mode 100644 index 0000000..eaf3cc4 --- /dev/null +++ b/solution/simulation/16234/main.cpp @@ -0,0 +1,75 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/c8a89727dad74664813faf3ff7a4dd9c +#include + +using namespace std; + +queue> Q; +const int dy[] = {-1, 1, 0, 0}; +const int dx[] = { 0, 0,-1, 1}; +int Map[55][55], N, L, R; +bool used[55][55]; + +void BFS(int a, int b) { + if(used[a][b]) return; + int total = 0, cnt = 0; + vector> path; + queue > q; + q.emplace(a, b); + used[a][b] = true; + while(!q.empty()) { + auto [y, x] = q.front(); q.pop(); + total += Map[y][x]; + cnt ++; + path.emplace_back(y, x); + + for(int k=0;k<4;k++) { + int qy = y + dy[k]; + int qx = x + dx[k]; + if(0 > qy || qy >= N || 0 > qx || qx >= N)continue; + if(used[qy][qx]) continue; + int value = abs(Map[qy][qx] - Map[y][x]); + if(L > value || value > R) continue; + used[qy][qx] = true; + q.emplace(qy, qx); + } + } + if(cnt < 2) return; + for(auto &[y, x]: path) { + Map[y][x] = total / cnt; + Q.emplace(y, x); + } +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + cin >> N >> L >> R; + for(int i=0;i> Map[i][j]; + Q.emplace(i, j); + } + } + + int answer = -1; + while(!Q.empty()) { + for(int i=0;i= N or dy < 0 or dy >= N: + continue + if visited[dx][dy] == 1: + continue + if abs(arr[dx][dy] - arr[q[0]][q[1]]) >= L and abs(arr[dx][dy] - arr[q[0]][q[1]]) <= R: + visited[dx][dy] = 1 + flag = 1 + total += arr[dx][dy] + queue.append((dx,dy)) + ans.append((dx,dy)) + +N, L, R = map(int, input().split()) +arr = [] +day = 0 +nx = [-1, 0, 1, 0] +ny = [0, -1, 0, 1] +for i in range(N): + arr.append(list(map(int, input().split()))) +while True: + flag = 0 + visited = [[0 for i in range(N)] for j in range(N)] + for i in range(N): + for j in range(N): + if visited[i][j] == 0: + ans = deque() + total = arr[i][j] + visited[i][j] = 1 + BFS(i,j) + if len(ans) > 1: + aver = total // len(ans) + while ans: + a = ans.popleft() + arr[a[0]][a[1]] = aver + if not flag: + break + day += 1 +print(day) \ No newline at end of file diff --git a/solution/simulation/16236/main.cpp b/solution/simulation/16236/main.cpp new file mode 100644 index 0000000..0d2155f --- /dev/null +++ b/solution/simulation/16236/main.cpp @@ -0,0 +1,76 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/a9ecf254aa654c0f878079eee6e2a275 +#include + +using namespace std; + +constexpr int dy[] = {-1,0,0,1}; +constexpr int dx[] = {0,-1,1,0}; + +int Map[22][22], n; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + cin >> n; + + int sy, sx; + for(int i=0;i> Map[i][j]; + if(Map[i][j] == 9)sy = i, sx = j; + } + } + + bool done = true; + int ate = 2, sharkSize = 2; + int answer = 0; + while(done){ + bool visited[22][22] = { }; + int ny = -1, nx = -1, times = -1; + Map[sy][sx] = 0; + + queue> q; + q.push(pair(sy, sx)); + visited[sy][sx] = true; + + while(!q.empty()){ + int qsize = q.size(); + ++times; + while(qsize--){ + auto [y, x] = q.front(); q.pop(); + if(Map[y][x] && Map[y][x] < sharkSize){ + if(!~ny)ny = y, nx = x; + else { + if(y < ny)ny = y, nx = x; + else if(y == ny && x < nx)nx = x; + } + } + + for(int k=0;k<4;k++){ + int qy = y + dy[k]; + int qx = x + dx[k]; + if(0 > qy || qy >= n || 0 > qx || qx >= n)continue; + if(visited[qy][qx])continue; + visited[qy][qx] = true; + if(Map[qy][qx] > sharkSize)continue; + q.push(pair(qy, qx)); + } + } + if(~ny){ + if(--ate == 0)ate = ++sharkSize; + break; + } + } + + sy = ny, sx = nx; + if(!~ny)done = false; + else answer += times; + } + + cout << answer; + + return 0; +} diff --git a/solution/simulation/17144/main.cpp b/solution/simulation/17144/main.cpp new file mode 100644 index 0000000..e58a24d --- /dev/null +++ b/solution/simulation/17144/main.cpp @@ -0,0 +1,99 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/8c3a1dd56b2b4bb6ba312c9dbd6eff0d +#include + +using namespace std; + +int N, M, T; +const int dy[] = {-1,1,0,0}; // UDLR +const int dx[] = {0,0,-1,1}; +const int UP[] = {0,3,1,2}; +const int DOWN[] = {1,3,0,2}; + +vector> Map; +vector Y; +bool inrange(int y, int x) { return 0 <= y && y < N && 0 <= x && x < M; } + +void input(){ + cin >> N >> M >> T; + Map = vector>(N, vector(M)); + for(int i=0;i> Map[i][j]; + if(Map[i][j] == -1) { + Map[i][j] = 0; + Y.push_back(i); + } + } + } +} + +void spread() { + vector> tmp = Map; + for(int i=0;i> used(N, vector(M)); + int y = Y[0]; + int x = 0; + int dir = 0; + while(dir < 4) { + Map[Y[0]][0] = 0; + int nexty = y + dy[UP[dir]]; + int nextx = x + dx[UP[dir]]; + if(0 <= nexty && nexty <= Y[0] && 0 <= nextx && nextx < M && used[nexty][nextx] == 0) { + used[nexty][nextx] = 1; + Map[y][x] = Map[nexty][nextx]; + y = nexty; + x = nextx; + } + else dir ++; + } + y = Y[1]; + x = 0; + dir = 0; + while(dir < 4) { + Map[Y[1]][0] = 0; + int nexty = y + dy[DOWN[dir]]; + int nextx = x + dx[DOWN[dir]]; + if(Y[1] <= nexty && nexty < N && 0 <= nextx && nextx < M && used[nexty][nextx] == 0) { + used[nexty][nextx] = 1; + Map[y][x] = Map[nexty][nextx]; + y = nexty; + x = nextx; + } + else dir ++; + } +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + input(); + while(T--){ + spread(); + air(); + } + int answer = 0; + for(int i=0;i + +using namespace std; + +int Map[555][555], N; +const int dy [] = {0,1,0,-1}; +const int dx [] = {-1,0,1,0}; +bool inrange(int y, int x) { return 0 <= y && y < N && 0 <= x && x < N; } +int arr[5][5] = { + {0, 0, 2, 0, 0}, + {0,10, 7, 1, 0}, + {5, 0, 0, 0, 0}, + {0,10, 7, 1, 0}, + {0, 0, 2, 0, 0} +}; + +void Turn() { + int tmp[5][5] = { }; + for(int i=0;i<5;i++) for(int j=0;j<5;j++) tmp[i][j] = arr[i][j]; + for(int i=0;i<5;i++) for(int j=0;j<5;j++) arr[4-j][i] = tmp[i][j]; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + cin >> N; + for(int i=0;i> Map[i][j]; + + int y = N / 2, x = N / 2; + int answer = 0, cur = 2, dir = 0; + + bool flag = false; + while(true) { + int cnt = cur / 2; + if(flag) cnt --; + for(int i=0;i + +using namespace std; + +const int dy[] = {-1,1,0,0}; +const int dx[] = {0,0,-1,1}; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int K, Q; cin >> K >> Q; + int N = 1 << K; + vector> Map(N, vector(N)); + for(int i=0;i> Map[i][j]; + } + } + + while(Q--) { + int L; cin >> L; + int M = 1 << L; + vector> tmp = Map; + for(int i=0;i qy || qy >= N || 0 > qx || qx >= N) continue; + if(Map[qy][qx] != 0) cnt ++; + } + if(cnt < 3) tmp[i][j] --; + } + } + Map = tmp; + } + + int total = 0; + int mx = 0; + for(int i=0;i> q; + q.emplace(i, j); + while(!q.empty()) { + auto [y, x] = q.front(); q.pop(); + cnt++; + for(int k=0;k<4;k++){ + int qy = y + dy[k]; + int qx = x + dx[k]; + if(0 > qy || qy >= N || 0 > qx || qx >= N) continue; + if(Map[qy][qx] == 0)continue; + q.emplace(qy, qx); + total += Map[qy][qx]; + Map[qy][qx] = 0; + } + } + mx = max(mx, cnt); + } + } + + cout << total << '\n'; + cout << mx; + + return 0; +} diff --git a/solution/simulation/20058/main.py b/solution/simulation/20058/main.py new file mode 100644 index 0000000..4ed3e14 --- /dev/null +++ b/solution/simulation/20058/main.py @@ -0,0 +1,74 @@ +# Authored by : tony9402 +# Co-authored by : - +# Link : http://boj.kr/f0c88b8e08204d33a7e63a384b5fdc4c +import sys +from copy import deepcopy +from collections import deque + +def input(): + return sys.stdin.readline().rstrip() + +dy = (-1, 1, 0, 0) +dx = ( 0, 0,-1, 1) +K, Q = map(int, input().split()) +N = 1 << K + +arr = list() +for i in range(N): + arr.append(list(map(int, input().split()))) + +CMD = list(map(int, input().split())) + +for _L in CMD: + L = 1 << _L + tmp = deepcopy(arr) + for i in range(0, N, L): + for j in range(0, N, L): + for n in range(0, L): + for m in range(0, L): + arr[i + m][j + L - 1 - n] = tmp[i + n][j + m] + + tmp = deepcopy(arr) + for i in range(N): + for j in range(N): + if arr[i][j] == 0: + continue + cnt = 0 + for k in range(4): + y = i + dy[k] + x = j + dx[k] + if 0 > y or y >= N or 0 > x or x >= N: + continue + if arr[y][x] != 0: + cnt += 1 + + if cnt < 3: + tmp[i][j] -= 1 + arr = deepcopy(tmp) + +total = 0 +mx = 0 + +for i in range(N): + for j in range(N): + if arr[i][j] == 0: + continue + cnt = 0 + que = deque() + que.append((i, j)) + total += arr[i][j] + arr[i][j] = 0 + while len(que) != 0: + cy, cx = que.popleft() + cnt += 1 + for k in range(4): + y = cy + dy[k] + x = cx + dx[k] + if 0 > y or y >= N or 0 > x or x >= N or arr[y][x] == 0: + continue + que.append((y, x)) + total += arr[y][x] + arr[y][x] = 0 + mx = max(mx, cnt) + +print(f"{total}\n{mx}") diff --git a/solution/simulation/20061/main.cpp b/solution/simulation/20061/main.cpp new file mode 100644 index 0000000..cb89915 --- /dev/null +++ b/solution/simulation/20061/main.cpp @@ -0,0 +1,130 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/22b0ae85671b4e3fb5561ef97c4b4b74 +#include + +using namespace std; + +struct Board { + int N, M; + vector> Map; + Board(int _N=10, int _M=4) : N(_N), M(_M), Map(_N, vector(_M)) { } + bool isrange(int y, int x) { return 0 <= y && y < N && 0 <= x && x < M; } + void put(int type, int x, int y) { + Map[x][y] = 1; + if(type == 2) Map[x][y + 1] = 1; + else if(type == 3) Map[x + 1][y] = 1; + + while(true) { + if(type == 1) { + int nx = x + 1; + int ny = y; + if(!isrange(nx, ny)) break; + if(Map[nx][ny] == 1) break; + Map[nx][ny] = Map[x][y]; + Map[x][y] = 0; + x ++; + } + else if(type == 2) { + int nx1 = x + 1; + int ny1 = y; + int nx2 = x + 1; + int ny2 = y + 1; + if(!isrange(nx1, ny1) || !isrange(nx2, ny2)) break; + if(Map[nx1][ny1] == 1 || Map[nx2][ny2] == 1) break; + Map[nx1][ny1] = Map[x][ny1]; + Map[nx2][ny2] = Map[x][ny2]; + Map[x][ny1] = Map[x][ny2] = 0; + x ++; + } + else { + int nx1 = x + 1; + int ny1 = y; + int nx2 = x + 2; + int ny2 = y; + if(!isrange(nx1, ny1) || !isrange(nx2, ny2)) break; + if(Map[nx2][ny2] == 1) break; + Map[nx2][ny2] = Map[x + 1][ny1]; + Map[nx1][ny1] = Map[x][ny1]; + Map[x][ny1] = 0; + x++; + } + } + } + int checkLine() { + int score = 0; + for(int i=N-1;i>=0;) { + bool line = true; + for(int j=0;j0;L--) { + for(int j=0;j0;i--) { + for(int j=0;j> N; + int answer = 0; + Board Green, Blue; + for(int i=0;i> t >> x >> y; + if(t == 1) { + Green.put(t, x, y); + Blue.put(t, y, x); + } + else { + Green.put(t, x, y); + Blue.put(5-t, y, x); + } + + answer += Green.checkLine(); + answer += Blue.checkLine(); + Green.eraseLine(); + Blue.eraseLine(); + } + cout << answer << '\n'; + cout << Green.getBlocks() + Blue.getBlocks() << '\n'; + + return 0; +} diff --git a/solution/simulation/20165/main.cpp b/solution/simulation/20165/main.cpp new file mode 100644 index 0000000..99a6890 --- /dev/null +++ b/solution/simulation/20165/main.cpp @@ -0,0 +1,81 @@ +// Authored by : klm03025 +// Co-authored by : - +// Link : http://boj.kr/cf1f9691a2bc4d6795218d266c851386 +#include +using namespace std; + +int dm_len[100][100]; +bool dm_alive[100][100]; + +int N, M, R; +int dx[4] = {0, 0, 1, -1}; +int dy[4] = {1, -1, 0, 0}; +int score = 0; + +void offense(int x, int y, char pos) { + int idx; + int dest = 0; + if(pos == 'E') idx = 0; + else if(pos == 'W') idx = 1; + else if(pos == 'S') idx = 2; + else idx = 3; + + if(!dm_alive[x][y]) return; + score++; + dm_alive[x][y] = 0; + dest = dm_len[x][y]; + + while(dest != 1) { + dest--; + x += dx[idx]; + y += dy[idx]; + + if(x == N || x < 0 || y == M || y < 0) break; + + if(dm_alive[x][y]) { + dest = max(dm_len[x][y], dest); + score++; + } + dm_alive[x][y] = 0; + + } +} + +void defense(int x, int y) { + dm_alive[x][y] = 1; +} + +int main() { + ios_base::sync_with_stdio(false); + cin.tie(0); + + cin >> N >> M >> R; + + for(int i = 0; i < N; i++) { + for(int j = 0; j < M; j++) { + cin >> dm_len[i][j]; + dm_alive[i][j] = 1; + } + } + + + for(int i = 0; i < R; i++) { + int x, y; + char pos; + + cin >> x >> y >> pos; + offense(x - 1, y - 1, pos); + + cin >> x >> y; + defense(x - 1, y - 1); + } + + cout << score << '\n'; + for(int i = 0; i < N; i++) { + for(int j = 0; j < M; j++) { + if(dm_alive[i][j]) cout << 'S' << ' '; + else cout << 'F' << ' '; + } + cout << '\n'; + } +} \ No newline at end of file diff --git a/solution/simulation/21610/main.py b/solution/simulation/21610/main.py new file mode 100644 index 0000000..ed6d280 --- /dev/null +++ b/solution/simulation/21610/main.py @@ -0,0 +1,98 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/709edf708bcb49e3972565b8fce5a993 + +import sys +from collections import deque +from copy import deepcopy + +def input(): + return sys.stdin.readline().rstrip() + +N, M = map(int, input().split()) +arr = [] +move = [] +visited = [[0 for x in range(N)] for y in range(N)] +storm = [] +nx = [0,-1,-1,-1,0,1,1,1] +ny = [-1,-1,0,1,1,1,0,-1] + +for i in range(N): + arr.append(list(map(int, input().split()))) + +for i in range(M): + move.append(list(map(int, input().split()))) + +storm.append((N-1, 0)) +storm.append((N-1, 1)) +storm.append((N-2, 0)) +storm.append((N-2, 1)) + +for i in range(M): + d, s = move[i][0]-1, move[i][1] + visited = [[0 for x in range(N)] for y in range(N)] + new_storm = [] + for j in range(len(storm)): + dx = storm[j][0] + nx[d] * s + dy = storm[j][1] + ny[d] * s + if dx < 0: + while True: + new_dx = dx + N + if new_dx >= N: + break + dx += N + elif dx >= N: + while True: + new_dx = dx - N + if new_dx < 0: + break + dx -= N + if dy < 0: + while True: + new_dy = dy + N + if new_dy >= N: + break + dy += N + elif dy >= N: + while True: + new_dy = dy - N + if new_dy < 0: + break + dy -= N + new_storm.append((dx,dy)) + visited[dx][dy] = 1 + + for j in range(len(new_storm)): + arr[new_storm[j][0]][new_storm[j][1]] += 1 + + save = [] + for j in range(len(new_storm)): + ct = 0 + for z in range(1,8,2): + dx = new_storm[j][0] + nx[z] + dy = new_storm[j][1] + ny[z] + if dx < 0 or dx >= N: + continue + if dy < 0 or dy >= N: + continue + if arr[dx][dy] > 0: + ct += 1 + save.append(ct) + + for j in range(len(new_storm)): + arr[new_storm[j][0]][new_storm[j][1]] += save[j] + + storm = [] + for x in range(N): + for y in range(N): + if visited[x][y] == 0 and arr[x][y] >= 2: + arr[x][y] -= 2 + storm.append((x,y)) + +total = 0 +for i in range(N): + for j in range(N): + if arr[i][j] > 0: + total += arr[i][j] + +print(total) diff --git a/solution/simulation/3190/main.py b/solution/simulation/3190/main.py new file mode 100644 index 0000000..c2c1c13 --- /dev/null +++ b/solution/simulation/3190/main.py @@ -0,0 +1,51 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/726b58947cd144afa6fa9abf2b491ac7 +import sys +from collections import deque + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +arr = [[0 for i in range(N)] for j in range(N)] +apple = [0] * 10005 + +K = int(input()) + +for i in range(K): + a,b = map(int, input().split()) + arr[a-1][b-1] = 1 +L = int(input()) +nx = [1,0,-1,0] +ny = [0,1,0,-1] +d = 1 +time = 1 + +queue = deque() +queue.append((0,0)) +for i in range(L): + a,b = input().split() + apple[int(a)] = b + +while True: + x,y = queue.pop() + dx = nx[d] + x + dy = ny[d] + y + if (dx, dy) in queue or dx < 0 or dx >= N or dy < 0 or dy >= N: + break + if arr[dx][dy] == 1: + arr[dx][dy] = 0 + queue.append((x,y)) + queue.append((dx,dy)) + else: + queue.append((x,y)) + queue.append((dx,dy)) + queue.popleft() + if apple[time] == 'L': + d = (d+1) % 4 + elif apple[time] == 'D': + d = (d+3) % 4 + time += 1 + +print(time) diff --git a/solution/simulation/5373/main.cpp b/solution/simulation/5373/main.cpp new file mode 100644 index 0000000..e529cd9 --- /dev/null +++ b/solution/simulation/5373/main.cpp @@ -0,0 +1,73 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/41809c7260ee45f0919c4bd54da18518 +#include + +using namespace std; + +const string INIT = "wgorby"; +const string DB = "ULBFRD"; +string cube = ""; +const int turn[][12] = { + {17, 14, 11, 24, 25, 26, 36, 39, 42, 29, 28, 27}, // U + {18, 21, 24, 0, 3, 6, 27, 30, 33, 53, 50, 47}, // L + { 2, 1, 0, 11, 10, 9, 47, 46, 45, 38, 37, 36}, // B + {15, 16, 17, 6, 7, 8, 42, 43, 44, 51, 52, 53}, // F + {35, 32, 29, 8, 5, 2, 26, 23, 20, 45, 48, 51}, // R + {44, 41, 38, 20, 19, 18, 9, 12, 15, 33, 34, 35} // D +}; + +void init() { + cube = ""; + for(int i=0;i<(int)INIT.size();i++) cube += string(9, INIT[i]); +} + +int getFace(char x) { + for(int i=0;i<(int)DB.size();i++) if(DB[i] == x) return i; + return -1; +} + +void execute(const string &cmd) { + int faceNumber = getFace(cmd[0]); + const int *move = turn[faceNumber]; + bool rev = cmd[1] == '-'; + int executeCount = rev ? 3 : 1; + + for(int k=0;k> T; + while(T--) { + init(); + int Q; cin >> Q; + while(Q--) { + string s; cin >> s; + execute(s); + } + print(0); + } + + return 0; +} diff --git a/solution/string/1032/main.py b/solution/string/1032/main.py new file mode 100644 index 0000000..b87cdcc --- /dev/null +++ b/solution/string/1032/main.py @@ -0,0 +1,23 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/c400c0aa10ea40bc809ad78029ac721d +import sys +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +arr = [] +ans = '' +for i in range(N): + arr.append(input()) +for i in range(len(arr[0])): + ct = 0 + word = arr[0][i] + for j in range(N): + if word == arr[j][i]: + ct += 1 + if ct == N: + ans += word + else: + ans += '?' +print(ans) \ No newline at end of file diff --git a/solution/string/10798/Main.java b/solution/string/10798/Main.java new file mode 100644 index 0000000..2e9510c --- /dev/null +++ b/solution/string/10798/Main.java @@ -0,0 +1,62 @@ +// Authored by : lms0806 +// Co-authored by : - +// Link : http://boj.kr/3c8eb525866b4ac08270094c21906461 +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.StringTokenizer; + +public class Main { + static String[] str = new String[5]; + public static void main(String[] args) throws IOException{ + FastReader rd = new FastReader(); + + for(int i = 0; i < 5; i++) { + str[i] = rd.nextLine(); + } + + StringBuilder sb = new StringBuilder(); + for(int i = 0; i < 15; i++) { + for(int j = 0; j < 5; j++) { + if(str[j].length() > i) { + sb.append(str[j].charAt(i)); + } + } + } + System.out.print(sb); + } + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + long nextLong() { return Long.parseLong(next()); } + double nextDouble() { return Double.parseDouble(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} \ No newline at end of file diff --git a/solution/string/10798/main.py b/solution/string/10798/main.py new file mode 100644 index 0000000..fa2208d --- /dev/null +++ b/solution/string/10798/main.py @@ -0,0 +1,23 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/a1c26275e6af44f5a080d54a61b4c677 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +arr = [] +ans = '' +max_len = 0 +for i in range(5): + a = input() + max_len = max(max_len, len(a)) + arr.append(a) + +for i in range(max_len): + for j in range(5): + if len(arr[j]) <= i: + continue + ans += arr[j][i] + +print(ans) diff --git a/solution/string/11365/Main.java b/solution/string/11365/Main.java new file mode 100644 index 0000000..359b6e8 --- /dev/null +++ b/solution/string/11365/Main.java @@ -0,0 +1,54 @@ +// Authored by : lms0806 +// Co-authored by : - +// Link : http://boj.kr/12a921be6b034acfb845a731e01d8830 +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.StringTokenizer; + +public class Main { + public static void main(String[] args) throws IOException{ + FastReader rd = new FastReader(); + + String str = ""; + StringBuilder sb = new StringBuilder(); + while(!(str = rd.nextLine()).equals("END")) { + sb.append(new StringBuilder(str).reverse().toString()).append("\n"); + } + System.out.print(sb); + } + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + long nextLong() { return Long.parseLong(next()); } + double nextDouble() { return Double.parseDouble(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} \ No newline at end of file diff --git a/solution/string/11365/main.py b/solution/string/11365/main.py new file mode 100644 index 0000000..e1de9e8 --- /dev/null +++ b/solution/string/11365/main.py @@ -0,0 +1,17 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/d59f549a75a84dd28c01a0f9c08eb169 + +import sys + +def input(): + return sys.stdin.readline().rstrip() + +while True: + + password = input() + + if password == 'END': + break + else: + print(password[::-1]) \ No newline at end of file diff --git a/solution/string/1152/main.py b/solution/string/1152/main.py new file mode 100644 index 0000000..839846a --- /dev/null +++ b/solution/string/1152/main.py @@ -0,0 +1,9 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/f95f97c2cdd74f5f9b832c2e394d4123 +import sys +def input(): + return sys.stdin.readline().rstrip() + +word = input().split() +print(len(word)) \ No newline at end of file diff --git a/solution/string/11720/Main.java b/solution/string/11720/Main.java new file mode 100644 index 0000000..6a26d09 --- /dev/null +++ b/solution/string/11720/Main.java @@ -0,0 +1,55 @@ +// Authored by : lms0806 +// Co-authored by : - +// Link : http://boj.kr/f8fc0ab01e70422f82a4a17177fda2cc +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.StringTokenizer; + +public class Main { + public static void main(String[] args) throws IOException{ + FastReader rd = new FastReader(); + + rd.nextLine(); + + int sum = 0; + for(char ch : rd.nextLine().toCharArray()) { + sum += ch - '0'; + } + System.out.print(sum); + } + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + long nextLong() { return Long.parseLong(next()); } + double nextDouble() { return Double.parseDouble(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} \ No newline at end of file diff --git a/solution/string/11720/main.py b/solution/string/11720/main.py new file mode 100644 index 0000000..5687326 --- /dev/null +++ b/solution/string/11720/main.py @@ -0,0 +1,15 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/85503261a5b5492ca153ccbe74adf43d +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +num = input() +total = 0 +for i in num: + total += int(i) + +print(total) diff --git a/solution/string/1181/Main.java b/solution/string/1181/Main.java new file mode 100644 index 0000000..acc92e7 --- /dev/null +++ b/solution/string/1181/Main.java @@ -0,0 +1,73 @@ +// Authored by : lms0806 +// Co-authored by : - +// Link : http://boj.kr/f0278bc8beb34ad08e2fa207bc873406 +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.Arrays; +import java.util.Comparator; +import java.util.StringTokenizer; + +public class Main { + static String[] arr; + public static void main(String[] args) throws IOException{ + FastReader rd = new FastReader(); + + int size = rd.nextInt(); + + arr = new String[size]; + for(int i = 0; i < size; i++) { + arr[i] = rd.nextLine(); + } + + Arrays.sort(arr, new Comparator() { + public int compare(String s1, String s2) { + return s1.length() == s2.length() ? s1.compareTo(s2) : s1.length() - s2.length(); + } + }); + + StringBuilder sb = new StringBuilder(); + sb.append(arr[0]).append("\n"); + for(int i = 1; i < size; i++) { + if(arr[i - 1].equals(arr[i])) { + continue; + } + sb.append(arr[i]).append("\n"); + } + System.out.print(sb); + } + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + long nextLong() { return Long.parseLong(next()); } + double nextDouble() { return Double.parseDouble(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} \ No newline at end of file diff --git a/solution/string/1181/main.py b/solution/string/1181/main.py new file mode 100644 index 0000000..718b2a5 --- /dev/null +++ b/solution/string/1181/main.py @@ -0,0 +1,20 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/c540e6d57a39460eb360903623b90eec + +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +arr = [] + +for i in range(N): + arr.append(input()) + +arr = list(set(arr)) +arr.sort(key = lambda x : (len(x), x)) + +for i in arr: + print(i) \ No newline at end of file diff --git a/solution/string/12871/main.py b/solution/string/12871/main.py new file mode 100644 index 0000000..56a51cc --- /dev/null +++ b/solution/string/12871/main.py @@ -0,0 +1,23 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/7d4da3364b4d4735b5f99d946b785fff +import sys +def input(): + return sys.stdin.readline().rstrip() + +def GCD(x,y): + if y == 0: + return x + else: + return GCD(y, x%y) + +s = input() +t = input() +gcd = GCD(len(s),len(t)) +lcm = len(s) * len(t) // gcd +s = s * (lcm // len(s)) +t = t * (lcm // len(t)) +if s == t: + print(1) +else: + print(0) diff --git a/solution/string/1316/Main.java b/solution/string/1316/Main.java new file mode 100644 index 0000000..96918b9 --- /dev/null +++ b/solution/string/1316/Main.java @@ -0,0 +1,72 @@ +// Authored by : lms0806 +// Co-authored by : - +// Link : http://boj.kr/de995483538e4f32b2e3bacb12a79832 +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.StringTokenizer; + +public class Main { + static boolean[] alpha; + public static void main(String[] args) throws IOException{ + FastReader rd = new FastReader(); + + int size = rd.nextInt(); + + int answer = 0; + while(size --> 0) { + String str = rd.nextLine(); + + alpha = new boolean[26]; + + alpha[str.charAt(0) - 'a'] = true; + boolean istrue = true; + for(int i = 1; i < str.length(); i++) { + char ch = str.charAt(i); + if(alpha[ch - 'a'] && ch != str.charAt(i - 1)) { + istrue = false; + break; + } + if(!alpha[ch - 'a']) { + alpha[ch - 'a'] = true; + } + } + answer += istrue ? 1 : 0; + } + System.out.print(answer); + } + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + long nextLong() { return Long.parseLong(next()); } + double nextDouble() { return Double.parseDouble(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} \ No newline at end of file diff --git a/solution/string/1316/main.py b/solution/string/1316/main.py new file mode 100644 index 0000000..409109e --- /dev/null +++ b/solution/string/1316/main.py @@ -0,0 +1,29 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/1649bc736d5e4692b067d78aa43b2edc +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +ans = N +for i in range(N): + a = input() + dic = {} + while True: + flag = 0 + for j in range(len(a)-1): + if a[j] == a[j+1]: + a = a[:j] + a[j+1:] + flag = 1 + break + if flag == 0: + break + for j in a: + if j not in dic: + dic[j] = 1 + else: + ans -=1 + break +print(ans) \ No newline at end of file diff --git a/solution/string/16171/Main.java b/solution/string/16171/Main.java new file mode 100644 index 0000000..612b026 --- /dev/null +++ b/solution/string/16171/Main.java @@ -0,0 +1,51 @@ +// Authored by : lms0806 +// Co-authored by : - +// Link : http://boj.kr/7d9f90a2441342ea8a37991503da96d1 +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.StringTokenizer; + +public class Main { + public static void main(String[] args) throws IOException{ + FastReader rd = new FastReader(); + + String s = rd.nextLine().replaceAll("[0-9]", ""), k = rd.nextLine(); + + System.out.print(s.indexOf(k) != -1 ? 1 : 0); + } + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + long nextLong() { return Long.parseLong(next()); } + double nextDouble() { return Double.parseDouble(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} \ No newline at end of file diff --git a/solution/string/16171/main.cpp b/solution/string/16171/main.cpp new file mode 100644 index 0000000..bc5140c --- /dev/null +++ b/solution/string/16171/main.cpp @@ -0,0 +1,19 @@ +// Authored by : rlawngus0910 +// Co-authored by : tony9402 +// Link : http://boj.kr/cddf85db4e694c0d8e9a20dddd32e653 +#include +using namespace std; +string input, s, k; +int main() { + cin.sync_with_stdio(0); + cin.tie(0); + cin >> input >> k; + + for (int i = 0; i < (int)input.length(); i++) { + if('0' <= input[i] && input[i] <= '9') continue; + s += input[i]; + } + + if (s.find(k) != string::npos) cout << "1"; + else cout << "0"; +} diff --git a/solution/string/17413/Main.java b/solution/string/17413/Main.java new file mode 100644 index 0000000..3480938 --- /dev/null +++ b/solution/string/17413/Main.java @@ -0,0 +1,78 @@ +// Authored by : lms0806 +// Co-authored by : - +// Link : http://boj.kr/9dc3aac345e548aea4453fef28ff9c26 +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.StringTokenizer; + +public class Main { + public static void main(String[] args) throws IOException{ + FastReader rd = new FastReader(); + + StringBuilder sb = new StringBuilder(), ss = new StringBuilder(); + + boolean istrue = false; + for(char ch : rd.nextLine().toCharArray()) { + if(ch == '<' || ch == ' ') { + sb.append(ss.reverse()); + ss.setLength(0); + sb.append(ch); + if(ch == '<') { + istrue = true; + } + } + else if(ch == '>') { + istrue = false; + sb.append(ch); + } + else { + if(istrue) { + sb.append(ch); + } + else { + ss.append(ch); + } + } + } + if(ss.length() != 0) { + sb.append(ss.reverse()); + } + + System.out.print(sb); + } + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + long nextLong() { return Long.parseLong(next()); } + double nextDouble() { return Double.parseDouble(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} \ No newline at end of file diff --git a/solution/string/17609/main.py b/solution/string/17609/main.py new file mode 100644 index 0000000..7fb8bc5 --- /dev/null +++ b/solution/string/17609/main.py @@ -0,0 +1,24 @@ +# Authored by : chj3748 +# Co-authored by : - +# Link : http://boj.kr/35708a61bb1d4149952929e8154ba152 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +def palin(start, end, del_cnt): + if del_cnt == 2: + return del_cnt + while start <= end: + if string[start] != string[end]: + a = palin(start + 1, end, del_cnt + 1) + b = palin(start, end - 1, del_cnt + 1) + return a if a <= b else b + start += 1 + end -= 1 + else: + return del_cnt + +for T in range(int(input())): + string = input() + print(palin(0, len(string) - 1, 0)) diff --git a/solution/string/1764/Main.java b/solution/string/1764/Main.java new file mode 100644 index 0000000..885c092 --- /dev/null +++ b/solution/string/1764/Main.java @@ -0,0 +1,78 @@ +// Authored by : lms0806 +// Co-authored by : - +// Link : http://boj.kr/7f6347f348fd48a7a0e88ff7aef7e6b7 +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.StringTokenizer; + +public class Main { + public static void main(String[] args) throws IOException{ + FastReader rd = new FastReader(); + + int n = rd.nextInt(), m = rd.nextInt(); + + HashSet strs = new HashSet<>(); + ArrayList strss = new ArrayList<>(); + + while(n --> 0) { + strs.add(rd.nextLine()); + } + + int answer = 0; + String str = ""; + while(m --> 0) { + str = rd.nextLine(); + if(strs.contains(str)) { + strss.add(str); + answer++; + } + } + + Collections.sort(strss); + + StringBuilder sb = new StringBuilder(); + sb.append(answer).append("\n"); + for(String s : strss) { + sb.append(s).append("\n"); + } + System.out.print(sb); + } + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + long nextLong() { return Long.parseLong(next()); } + double nextDouble() { return Double.parseDouble(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} \ No newline at end of file diff --git a/solution/string/20154/Main.java b/solution/string/20154/Main.java new file mode 100644 index 0000000..9706483 --- /dev/null +++ b/solution/string/20154/Main.java @@ -0,0 +1,57 @@ +// Authored by : lms0806 +// Co-authored by : - +// Link : http://boj.kr/6d7b80bed5be4ae5b0b4cd97ebb73990 +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.StringTokenizer; + +public class Main { + static int[] num = {3, 2, 1, 2, 3, 3, 3, 3, 1, 1, 3, 1, 3, 3, 1, 2, 2, 2, 1, 2, 1, 1, 2, 2, 2, 1}; + public static void main(String[] args) throws IOException{ + FastReader rd = new FastReader(); + + int n = 0; + for(char ch : rd.nextLine().toCharArray()) { + n += num[ch - 'A']; + if(n > 9) { + n %= 10; + } + } + System.out.print(n % 2 == 1 ? "I'm a winner!" : "You're the winner?"); + } + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + long nextLong() { return Long.parseLong(next()); } + double nextDouble() { return Double.parseDouble(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} \ No newline at end of file diff --git a/solution/string/20154/main.py b/solution/string/20154/main.py new file mode 100644 index 0000000..06ec3f4 --- /dev/null +++ b/solution/string/20154/main.py @@ -0,0 +1,22 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/ff79a90b0e024c4eb328a8595918b096 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +DB = [3, 2, 1, 2, 3, 3, 3, 3, 1, 1, 3, 1, 3, 3, 1, 2, 2, 2, 1, 2, 1, 1, 2, 2, 2, 1] +dic = {} +for idx, data in enumerate(DB): + dic[chr(idx+65)] = DB[idx] # 'A' : 65 + +total = 0 +a = input() +for i in a: + total += dic[i] +total = total % 10 +if total % 2 == 1: + print("I'm a winner!") +else: + print("You're the winner?") diff --git a/solution/string/20291/Main.java b/solution/string/20291/Main.java new file mode 100644 index 0000000..7519500 --- /dev/null +++ b/solution/string/20291/Main.java @@ -0,0 +1,65 @@ +// Authored by : lms0806 +// Co-authored by : - +// Link : http://boj.kr/a2d39728db0c40a784b657882ee17fc7 +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.StringTokenizer; +import java.util.TreeMap; + +public class Main { + public static void main(String[] args) throws IOException{ + FastReader rd = new FastReader(); + + int size = rd.nextInt(); + + TreeMap map = new TreeMap<>(); + + while(size --> 0) { + String str = rd.nextLine(); + str = str.substring(str.indexOf(".") + 1); + + map.put(str, map.get(str) == null ? 1 : map.get(str) + 1); + } + + StringBuilder sb = new StringBuilder(); + for(String key : map.keySet()) { + sb.append(key).append(" ").append(map.get(key)).append("\n"); + } + System.out.print(sb); + } + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + long nextLong() { return Long.parseLong(next()); } + double nextDouble() { return Double.parseDouble(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} \ No newline at end of file diff --git a/solution/string/20437/Main.java b/solution/string/20437/Main.java new file mode 100644 index 0000000..26a9d0c --- /dev/null +++ b/solution/string/20437/Main.java @@ -0,0 +1,94 @@ +//Authored by : suin8 +//Co-authored by : - +//Link : http://boj.kr/0d345a8508a74a1fbf363c6719797709 + +/* +3. 어떤문자를 정확히 k개 포함하는 가장 짧은 문자열 +== 시작과 끝이 어떤 문자인 가장 짧은 문자열 +4. 어떤문자가 시작과 끝이고 정확히 k개 포함하는 가장 긴 문자열 +== 시작과 끝이 어떤 문자인 가장 긴 문자열 +*/ + +import java.util.*; +import java.io.*; + +public class Main { + static int[] alpha = new int[26]; + + public static void main(String[] args) { + FastReader rd = new FastReader(); + + int T = rd.nextInt(); + + for(int i = 0;i < T;i++) { + + // 초기화 + for(int j = 0;j < 26;j++) + alpha[j] = 0; + + String W = rd.nextLine(); + int K = rd.nextInt(); + + // 각 알파벳이 몇번 나왔는지 센다 + for(int j = 0;j < W.length();j++) + alpha[W.charAt(j) - 'a']++; + + int min = Integer.MAX_VALUE, max = 0; + for(int j = 0;j < W.length();j++) { + if(alpha[W.charAt(j) - 'a'] < K) continue; + + // K보다 크거나 같은 빈도로 나온 문자만 본다 + // 그 문자가 문자열의 시작과 끝 + char ch = W.charAt(j); + int count = 0; + for(int l = j;l < W.length();l++) { + if(ch != W.charAt(l)) continue; + else count++; + + // 정확히 K개가 되는 순간 min, max값 갱신 + if(count == K) { + min = Math.min(min, l - j + 1); + max = Math.max(max, l - j + 1); + break; + } + } + } + + if(min == 10001 || max == 0) System.out.println("-1"); + else System.out.println(min + " " + max); + } + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} diff --git a/solution/string/2204/main.py b/solution/string/2204/main.py new file mode 100644 index 0000000..32f323a --- /dev/null +++ b/solution/string/2204/main.py @@ -0,0 +1,18 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/685c4c3dc1c24c118d3c89ffdefa6679 +import sys +def input(): + return sys.stdin.readline().rstrip() + +while True: + n = int(input()) + if n == 0: + break + arr = [] + for i in range(n): + a = input() + a_lower = a.lower() + arr.append((a,a_lower)) + arr.sort(key = lambda x : x[1]) + print(arr[0][0]) \ No newline at end of file diff --git a/solution/string/2744/main.py b/solution/string/2744/main.py new file mode 100644 index 0000000..775fd7e --- /dev/null +++ b/solution/string/2744/main.py @@ -0,0 +1,15 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/39641966833845ec931ab403fc15026d +import sys +def input(): + return sys.stdin.readline().rstrip() + +word = input() +ans = '' +for i in word: + if i.islower(): + ans += i.upper() + else: + ans += i.lower() +print(ans) \ No newline at end of file diff --git a/solution/string/3029/Main.java b/solution/string/3029/Main.java new file mode 100644 index 0000000..de474e5 --- /dev/null +++ b/solution/string/3029/Main.java @@ -0,0 +1,75 @@ +// Authored by : lms0806 +// Co-authored by : - +// Link : http://boj.kr/91161b29442545bd8335d4e292d0d507 +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.StringTokenizer; + +public class Main { + public static void main(String[] args) throws IOException{ + FastReader rd = new FastReader(); + System.out.print(solve(rd.nextLine(), rd.nextLine())); + } + + public static String solve(String s1, String s2) { + if(s1.equals(s2)) { + return "24:00:00"; + } + + int h = Integer.parseInt(s2.split(":")[0]) - Integer.parseInt(s1.split(":")[0]); + int m = Integer.parseInt(s2.split(":")[1]) - Integer.parseInt(s1.split(":")[1]); + int s = Integer.parseInt(s2.split(":")[2]) - Integer.parseInt(s1.split(":")[2]); + + if(s < 0) { + s += 60; + m--; + } + + if(m < 0) { + m += 60; + h--; + } + + if(h < 0) { + h += 24; + } + + return String.format("%02d:%02d:%02d", h, m, s); + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + long nextLong() { return Long.parseLong(next()); } + double nextDouble() { return Double.parseDouble(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} diff --git a/solution/string/3029/main.py b/solution/string/3029/main.py new file mode 100644 index 0000000..83479ae --- /dev/null +++ b/solution/string/3029/main.py @@ -0,0 +1,45 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/a2586b306e3340caa3740e5953662eeb +import sys +def input(): + return sys.stdin.readline().rstrip() + +def isBig(): + if start[0] < end[0]: + return 1 + elif start[0] == end[0]: + if start[1] < end[1]: + return 1 + elif start[1] == end[1]: + if start[2] < end[2]: + return 1 + elif start[2] == end[2]: + return 0 + else: + return -1 + else: + return -1 + else: + return -1 + +start = list(map(int, input().split(':'))) +end = list(map(int, input().split(':'))) +total = start[0] * 3600 + start[1] * 60 + start[2] +total2 = end[0] * 3600 + end[1] * 60 + end[2] +if isBig() == 1: + ans = total2 - total + hour, minute, second = str(ans // 3600), str(ans % 3600 // 60), str(ans % 60) + hour = '0' * (2-len(hour)) + hour + minute = '0' * (2-len(minute)) + minute + second = '0' * (2-len(second)) + second + print(f"%s:%s:%s" % (hour, minute, second)) +elif isBig() == 0: + print('24:00:00') +else: + ans = total2 - total + 3600 * 24 + hour, minute, second = str(ans // 3600), str(ans % 3600 // 60), str(ans % 60) + hour = '0' * (2-len(hour)) + hour + minute = '0' * (2-len(minute)) + minute + second = '0' * (2-len(second)) + second + print(f"%s:%s:%s" % (hour, minute, second)) \ No newline at end of file diff --git a/solution/string/4659/Main.java b/solution/string/4659/Main.java new file mode 100644 index 0000000..77a7a28 --- /dev/null +++ b/solution/string/4659/Main.java @@ -0,0 +1,93 @@ +// Authored by : lms0806 +// Co-authored by : - +// Link : http://boj.kr/1e73fdef646c45e784d1f5f3f083bb20 +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.StringTokenizer; + +public class Main { + public static void main(String[] args) throws IOException{ + FastReader rd = new FastReader(); + + StringBuilder sb = new StringBuilder(); + while(true) { + int counta = 0, countb = 0; + boolean istrue = false; + + String str = rd.nextLine(); + + if(str.equals("end")) { + break; + } + char ch0 = str.charAt(0); + + if(ch0 == 'a' || ch0 == 'e' || ch0 == 'i' || ch0 == 'o' || ch0 == 'u') { + counta++; + istrue = true; + } + else { + countb++; + } + + for(int i = 1; i < str.length(); i++) { + char ch = str.charAt(i); + + if(ch == str.charAt(i-1) && ch != 'e' && ch != 'o') { + istrue = false; + break; + } + if(ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u') { + counta++; + countb = 0; + istrue = true; + } + else { + countb++; + counta = 0; + } + if(counta == 3 || countb == 3) { + istrue = false; + break; + } + + } + sb.append("<").append(str).append("> is ").append(istrue ? "" : "not ").append("acceptable.").append("\n"); + } + System.out.print(sb); + } + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + long nextLong() { return Long.parseLong(next()); } + double nextDouble() { return Double.parseDouble(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} \ No newline at end of file diff --git a/solution/string/6550/Main.java b/solution/string/6550/Main.java new file mode 100644 index 0000000..61749e5 --- /dev/null +++ b/solution/string/6550/Main.java @@ -0,0 +1,67 @@ +// Authored by : lms0806 +// Co-authored by : - +// Link : http://boj.kr/806d668045d94b7197663986f1086ae3 +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.StringTokenizer; + +public class Main { + public static void main(String[] args) throws IOException{ + FastReader rd = new FastReader(); + + String str = ""; + StringBuilder sb = new StringBuilder(); + while((str = rd.nextLine()) != null) { + StringTokenizer st = new StringTokenizer(str); + + String s = st.nextToken(),t = st.nextToken(); + + int count = 0; + for(int i = 0; i < t.length(); i++) { + if(t.charAt(i) == s.charAt(count)) { + count++; + } + if(count == s.length()) { + break; + } + } + sb.append(count == s.length() ? "Yes" : "No").append("\n"); + } + System.out.print(sb); + } + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + long nextLong() { return Long.parseLong(next()); } + double nextDouble() { return Double.parseDouble(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} \ No newline at end of file diff --git a/solution/string/9046/Main.java b/solution/string/9046/Main.java new file mode 100644 index 0000000..06897cb --- /dev/null +++ b/solution/string/9046/Main.java @@ -0,0 +1,75 @@ +// Authored by : lms0806 +// Co-authored by : - +// Link : http://boj.kr/ef8d43d74040402da1919de2e2607e4a +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.StringTokenizer; + +public class Main { + public static void main(String[] args) throws IOException{ + FastReader rd = new FastReader(); + + int size = rd.nextInt(); + + StringBuilder sb = new StringBuilder(); + while(size --> 0) { + int[] alpha = new int[26]; + + for(char ch : rd.nextLine().toCharArray()) { + if(ch != ' ') { + alpha[ch - 'a']++; + } + } + + int max = 0, count = 0, n = 0; + for(int i = 0; i < alpha.length; i++) { + if(max < alpha[i]) { + max = alpha[i]; + n = i; + count = 0; + } + else if(max == alpha[i]) { + count++; + } + } + + sb.append(count != 0 ? "?" : (char)(n + 'a')).append("\n"); + } + System.out.print(sb); + } + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + long nextLong() { return Long.parseLong(next()); } + double nextDouble() { return Double.parseDouble(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} \ No newline at end of file diff --git a/solution/string/9046/main.py b/solution/string/9046/main.py new file mode 100644 index 0000000..92abe7f --- /dev/null +++ b/solution/string/9046/main.py @@ -0,0 +1,27 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/ecd357e546d24b059db0160435e99364 +import sys +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +for i in range(N): + a = input() + total = {} + for j in a: + if j == ' ': + continue + if j not in total: + total[j] = 1 + else: + total[j] += 1 + new_total = list(total.items()) + if len(new_total) == 1: + print(new_total[0][0]) + else: + new_total.sort(key = lambda x : -x[1]) + if new_total[0][1] == new_total[1][1]: + print('?') + else: + print(new_total[0][0]) \ No newline at end of file diff --git a/solution/string/9342/Main.java b/solution/string/9342/Main.java new file mode 100644 index 0000000..a8e3fb3 --- /dev/null +++ b/solution/string/9342/Main.java @@ -0,0 +1,57 @@ +// Authored by : lms0806 +// Co-authored by : - +// Link : http://boj.kr/a107f13f52ce413199ad51ca816fa4df +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.StringTokenizer; + +public class Main { + public static void main(String[] args) throws IOException{ + FastReader rd = new FastReader(); + + int size = rd.nextInt(); + + String str = "[A-F]?A+F+C+[A-F]?$"; + + StringBuilder sb = new StringBuilder(); + while(size --> 0) { + sb.append(rd.nextLine().matches(str) ? "Infected!" : "Good").append("\n"); + } + System.out.print(sb); + } + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + long nextLong() { return Long.parseLong(next()); } + double nextDouble() { return Double.parseDouble(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} \ No newline at end of file diff --git a/solution/string/9342/main.cpp b/solution/string/9342/main.cpp new file mode 100644 index 0000000..869f357 --- /dev/null +++ b/solution/string/9342/main.cpp @@ -0,0 +1,30 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/1df192eb8ca749ec8a568e9189e4ef5d +#include + +using namespace std; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int T; cin >> T; + while(T--) { + string s; cin >> s; + bool flag = true; + int idx = 0, N = (int)s.size(); + if(idx < N && 'B' <= s[idx] && s[idx] <= 'F') idx++; + for(char cur : {'A', 'F', 'C'}) { + int cnt = 0; + while(idx < N && s[idx] == cur) idx++, cnt++; + if(cnt == 0) flag = false; + } + if(idx < N && 'A' <= s[idx] && s[idx] <= 'F') idx++; + if(idx < N) flag = false; + if(flag) cout << "Infected!\n"; + else cout << "Good\n"; + } + + return 0; +} diff --git a/solution/string/9342/main.py b/solution/string/9342/main.py new file mode 100644 index 0000000..4cf5cbd --- /dev/null +++ b/solution/string/9342/main.py @@ -0,0 +1,15 @@ +# Authored by : tony9402 +# Co-authored by : - +# Link : http://boj.kr/4fcec3ea35e4472bbca8beeebd2fe065 +import sys +import re + +def input(): + return sys.stdin.readline().rstrip() + +regex = re.compile('^[A-F]?A+F+C+[A-F]?$') +N = int(input()) +for testcase in range(N): + line = input() + print("Infected!" if regex.match(line) else "Good") + diff --git a/solution/tree/1068/main.cpp b/solution/tree/1068/main.cpp new file mode 100644 index 0000000..53832ac --- /dev/null +++ b/solution/tree/1068/main.cpp @@ -0,0 +1,45 @@ +// Authored by : ap4o +// Co-authored by : - +// Link : http://boj.kr/7c236d89d3c64e59920ab0851d08f40d + +#include +using namespace std; +vector tree[51]; +int N, del, answer; + +void dfs(int idx) { + bool isOk = false; + for(auto next: tree[idx]) { + isOk = true; + dfs(next); + } + if(!isOk) answer++; +} + +int main() { + ios::sync_with_stdio(false); + cin.tie(NULL); + + cin >> N; + int root = 0; + for(int i = 0; i < N; i++) { + int tmp; + cin >> tmp; + if(tmp == -1) { + root = i; + continue; + } + tree[tmp].push_back(i); + } + + cin >> del; + tree[del].clear(); + for(int i = 0; i < N; i++) { + for(int j = 0; j < tree[i].size(); j++) { + if(del == tree[i][j]) tree[i].erase(tree[i].begin() + j); + } + } + + if(del != root) dfs(root); + cout << answer; +} \ No newline at end of file diff --git a/solution/tree/11437/main.cpp b/solution/tree/11437/main.cpp new file mode 100644 index 0000000..ce78f19 --- /dev/null +++ b/solution/tree/11437/main.cpp @@ -0,0 +1,53 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/80903be26b2e47eeb98b990db8689c5b +#include + +using namespace std; + +vector> graph; +vector depth, parent; + +void dfs(int cur = 1, int par = -1, int dep = 0) { + depth[cur] = dep; + for(auto &nxt: graph[cur]) { + if(nxt == par) continue; + parent[nxt] = cur; + dfs(nxt, cur, dep + 1); + } +} + +int getLCA(int a, int b) { + if(depth[a] > depth[b]) swap(a, b); + while(depth[a] < depth[b]) b = parent[b]; + while(a != b) { + a = parent[a]; + b = parent[b]; + } + return a; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N; cin >> N; + graph.resize(N + 1); + parent.resize(N + 1); + depth.resize(N + 1); + for(int i = 1; i < N; i++) { + int a, b; cin >> a >> b; + graph[a].push_back(b); + graph[b].push_back(a); + } + + dfs(); + + int Q; cin >> Q; + while(Q--){ + int a, b; cin >> a >> b; + cout << getLCA(a, b) << '\n'; + } + + return 0; +} diff --git a/solution/tree/15681/Main.java b/solution/tree/15681/Main.java new file mode 100644 index 0000000..8c145b4 --- /dev/null +++ b/solution/tree/15681/Main.java @@ -0,0 +1,101 @@ +//Authored by : suin8 +//Co-authored by : - +//Link : http://boj.kr/0f61f373c1df4a91bb7dcc3a52dea9cf + +import java.util.*; +import java.io.*; + +// 문제에서 주어진 힌트를 그대로 구현하였습니다. + +public class Main { + static int[] subtreesize, parent; + static ArrayList[] tree, list; + + public static void main(String[] args) throws IOException { + FastReader rd = new FastReader(); + + int N = rd.nextInt(); + int R = rd.nextInt(); + int Q = rd.nextInt(); + + tree = new ArrayList[N + 1]; + list = new ArrayList[N + 1]; + subtreesize = new int[N + 1]; + parent = new int[N + 1]; + + for(int i = 0;i <= N;i++) { + tree[i] = new ArrayList(); + list[i] = new ArrayList(); + } + + for(int i = 0;i < N - 1;i++) { + int U = rd.nextInt(); + int V = rd.nextInt(); + list[U].add(V); + list[V].add(U); + } + + // 문제에 주어진 힌트 + makeTree(R, -1); + countSubtreeNodes(R); + + for(int i = 0;i < Q;i++) { + int U = rd.nextInt(); + System.out.println(subtreesize[U]); + } + } + + // 입력받은 list를 토대로 트리를 만듭니다. + static void makeTree(int curNode, int p) { + for(int node : list[curNode]) { + if(node != p) { + tree[curNode].add(node); + parent[node] = curNode; + makeTree(node, curNode); + } + } + } + + // dp와 재귀호출로 서브트리크기를 센다. + static void countSubtreeNodes(int curNode) { + // 자신도 size에 포함하기 때문에 1부터 시작 + subtreesize[curNode] = 1; + for(int node : tree[curNode]) { + countSubtreeNodes(node); + subtreesize[curNode] += subtreesize[node]; + } + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} diff --git a/solution/tree/15681/main.py b/solution/tree/15681/main.py new file mode 100644 index 0000000..e77006e --- /dev/null +++ b/solution/tree/15681/main.py @@ -0,0 +1,34 @@ +# Authored by : cieske +# Co-authored by : - +# Link : http://boj.kr/74cde7f86d27498c9a3a724e4ddc206f +import sys +def input(): + return sys.stdin.readline().rstrip() + +sys.setrecursionlimit(1000000) # 꼭 걸어주도록 하자.... (Python 인 경우) + +n, root, query = map(int, input().split()) +tree = [[] for _ in range(n+1)] +for _ in range(n-1): # Tree 생성 + x, y = map(int, input().split()) + tree[x].append(y) + tree[y].append(x) + +num_child = [0]*(n+1) + +def dfs(cur, parent): + if len(tree[cur]) == 1 and parent != -1: # Leaf node라면 + num_child[cur] = 1 + return 1 + + n_sub = 0 # cur를 root로 하는 subtree의 node 개수 + for child in tree[cur]: + if child != parent: # 각 child를 root로 하는 subtree의 node 개수 추가 + n_sub += dfs(child, cur) + num_child[cur] = n_sub + 1 # 본인 추가 + return n_sub + 1 + +dfs(root, -1) + +for _ in range(query): + print(num_child[int(input())]) diff --git a/solution/tree/1967/Main.java b/solution/tree/1967/Main.java new file mode 100644 index 0000000..31dd6d6 --- /dev/null +++ b/solution/tree/1967/Main.java @@ -0,0 +1,114 @@ +//Authored by : suin8 +//Co-authored by : - +//Link : http://boj.kr/de782e0aed93403384ae477b960ab1a6 + +import java.util.*; +import java.io.*; + +class Pair{ + public int idx, w; + Pair(int idx, int w){ + this.idx = idx; // index번호 + this.w = w; // weight + } +} + +public class Main { + static ArrayList tree[]; + static boolean visited[]; + static int weight[]; + public static void main(String[] args) { + FastReader rd = new FastReader(); + + int n = rd.nextInt(); + // 입력받은 트리를 저장합니다. + tree = new ArrayList[n + 10]; + // bfs에서 방문 유무를 저장합니다. + visited = new boolean[n + 10]; + // i번째 노드까지 오면서 가중치의 합을 저장합니다. + weight = new int[n + 10]; + + // 인접리스트를 이용하여 그래프를 만듭니다. + for(int i = 0;i <= n;i++) + tree[i] = new ArrayList(); + + for(int i = 0;i < n - 1;i++) { + int p = rd.nextInt(); // parent + int c = rd.nextInt(); // child + int w = rd.nextInt(); // weight + tree[p].add(new Pair(c, w)); + tree[c].add(new Pair(p, w)); + } + + // 시작노드 1에서 가장 먼 노드를 구한 다음 + // 그 노드를 시작점으로 가장 먼 노드까지의 거리가 지름이 됩니다. + Pair a = bfs(1); // 1번 노드로부터 가장 먼 노드 + Pair b = bfs(a.idx); // 앞에서 구한 노드로부터 가장 먼 노드 + + System.out.println(b.w); + } + + public static Pair bfs(int start) { + int max_weight = 0; + int max_idx = 0; + Queue q = new LinkedList<>(); + q.add(start); + visited[start] = true; + + while(!q.isEmpty()) { + int cur = q.poll(); + + for(Pair p : tree[cur]) { + if(visited[p.idx] == true) continue; // 방문한 노드 + // 미방문 + visited[p.idx] = true; + weight[p.idx] = p.w + weight[cur]; + // 가장 먼 노드의 인덱스와 가중치를 저장합니다. + if(max_weight < weight[p.idx]) { + max_weight = weight[p.idx]; + max_idx = p.idx; + } + q.add(p.idx); + } + } + + // 다음 bfs사용을 위해 초기화 합니다. + Arrays.fill(visited, false); + Arrays.fill(weight, 0); + + return new Pair(max_idx, max_weight); + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} diff --git a/solution/tree/1991/main.cpp b/solution/tree/1991/main.cpp new file mode 100644 index 0000000..f9ba028 --- /dev/null +++ b/solution/tree/1991/main.cpp @@ -0,0 +1,60 @@ +// Authored by : fltcy2039 +// Co-authored by : - +// Link : http://boj.kr/38d41dbf00234e648769fccde2bc0339 + +#include +using namespace std; +int adj[26][2]; + +void preorder_traverse(int root){ + cout << (char)(root+'A'); + int left, right; + if((left = adj[root][0]) >= 0) + preorder_traverse(left); + if((right = adj[root][1]) >= 0) + preorder_traverse(right); +} + +void inorder_traverse(int root){ + int left, right; + if((left = adj[root][0]) >= 0) + inorder_traverse(left); + cout << (char)(root+'A'); + if((right = adj[root][1]) >= 0) + inorder_traverse(right); +} + +void prorder_traverse(int root){ + int left, right; + if((left = adj[root][0]) >= 0) + prorder_traverse(left); + if((right = adj[root][1]) >= 0) + prorder_traverse(right); + cout << (char)(root+'A'); +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(NULL); + + //init & input + int n; + cin >> n; + + char node, left, right; + for(int i = 0 ; i < n ; i++){ + cin >> node >> left >> right; + adj[node-'A'][0] = left-'A'; + adj[node-'A'][1] = right-'A'; + } + + //process & output + preorder_traverse(0); + cout << "\n"; + inorder_traverse(0); + cout << "\n"; + prorder_traverse(0); + cout << "\n"; + + return 0; +} diff --git a/solution/tree/3584/Main.java b/solution/tree/3584/Main.java new file mode 100644 index 0000000..8cc4f0d --- /dev/null +++ b/solution/tree/3584/Main.java @@ -0,0 +1,88 @@ +//Authored by : suin8 +//Co-authored by : - +//Link : http://boj.kr/2b48d830901a4b2d93f3b4a82e7104e4 + +import java.util.*; +import java.io.*; + +public class Main { + static int[] parent; + static Vector comm_1, comm_2; + public static void main(String[] args) { + FastReader rd = new FastReader(); + + int T = rd.nextInt(); + while(T --> 0) { // T번 반복합니다. + int N = rd.nextInt(); + parent = new int[N + 10]; + + // comm_1, comm_2는 공통조상을 찾아야 할 수 comm1, comm2의 + // 자신을 포함한 루트까지의 조상 값을 저장하는 벡터입니다. + comm_1 = new Vector(); + comm_2 = new Vector(); + + for(int i = 0;i < N - 1;i++) { + int A = rd.nextInt(); // parent + int B = rd.nextInt(); // child + parent[B] = A; + } + + int comm1 = rd.nextInt(); + int comm2 = rd.nextInt(); + // 첫 번째 수의 자신포함 모든 조상를 벡터에 넣습니다. + // parent[i]값이 0이면 루트라는 뜻입니다. + while(comm1 != 0) { + comm_1.add(comm1); + comm1 = parent[comm1]; + } + + // 두 번째 수의 자신포함 모든 조상를 벡터에 넣습니다. + while(comm2 != 0) { + comm_2.add(comm2); + comm2 = parent[comm2]; + } + + // 두 개의 벡터를 하나씩 비교하면서 가장 먼저 겹치는 수가 + // 첫 번째 공통 조상의 index입니다. + for(int i : comm_1) { + if(comm_2.indexOf(i) != -1) { + System.out.println(i); + break; + } + } + } + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} diff --git a/solution/tree/3584/main.cpp b/solution/tree/3584/main.cpp new file mode 100644 index 0000000..54e4d67 --- /dev/null +++ b/solution/tree/3584/main.cpp @@ -0,0 +1,61 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/0bfccc47735a40d5a6cb460a341ef24e +#include + +using namespace std; + +vector> G; +vector isRoot, depth, parent; +int N, root; + +void input() { + cin >> N; + G = vector>(N + 1); + isRoot = vector(N + 1, 1); + depth = vector(N + 1); + parent = vector(N + 1); + for(int i = 1; i < N; i++) { + int par, child; cin >> par >> child; + G[par].push_back(child); + G[child].push_back(par); + isRoot[child] = 0; + } + for(int i = 1; i < N; i++) { + if(isRoot[i] == 1) root = i; + } +} + +void dfs(int cur, int prev, int dep) { + depth[cur] = dep; + for(auto &nxt: G[cur]) { + if(nxt == prev) continue; + parent[nxt] = cur; + dfs(nxt, cur, dep + 1); + } +} + +int getLCA(int a, int b) { + if(depth[a] > depth[b]) swap(a, b); + while(depth[a] < depth[b]) b = parent[b]; + while(a != b) { + a = parent[a]; + b = parent[b]; + } + return a; +} + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int T; cin >> T; + while(T--) { + input(); + dfs(root, -1, 0); + int u, v; cin >> u >> v; + cout << getLCA(u, v) << '\n'; + } + + return 0; +} diff --git a/solution/trie/14425/main.cpp b/solution/trie/14425/main.cpp new file mode 100644 index 0000000..627b7e9 --- /dev/null +++ b/solution/trie/14425/main.cpp @@ -0,0 +1,67 @@ +// Authored by : tony9402 +// Co-authored by : - +// Link : http://boj.kr/3c2d334828274046abfde50531627f0a +#include + +using namespace std; + +struct Trie { + struct Node { + char data; + bool isEnd; + int nxt[26]; + int &operator[](int idx) { return nxt[idx]; } + int operator[](int idx) const { return nxt[idx]; } + Node() : data(0) { memset(nxt, 0xff, sizeof(int) * 26); } + Node(char data) : data(data) { memset(nxt, 0xff, sizeof(int) * 26); } + }; + vector tree; + + Trie() { tree.emplace_back(); } + + int getIdx(char x) { + return x - 'a'; + } + + void update(const string &s) { + int cur = 0; // Root of Trie + for(char i: s) { + int idx = getIdx(i); + if(!~tree[cur][idx]) { + tree[cur][idx] = tree.size(); + tree.emplace_back(i); + } + cur = tree[cur][idx]; + } + tree[cur].isEnd = true; + } + + bool find(const string &s) { + int cur = 0; + for(char i: s) { + int idx = getIdx(i); + if(!~tree[cur][idx]) return false; + cur = tree[cur][idx]; + } + return tree[cur].isEnd; + } +} trie; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(0); + + int N, Q; cin >> N >> Q; + for(int i=0;i> s; + trie.update(s); + } + int answer = 0; + for(int i=0;i> s; + if(trie.find(s)) answer ++; + } + cout << answer; + + return 0; +} diff --git a/solution/two_pointer/15961/main.py b/solution/two_pointer/15961/main.py new file mode 100644 index 0000000..360df28 --- /dev/null +++ b/solution/two_pointer/15961/main.py @@ -0,0 +1,41 @@ +# Authored by : kis03160 +# Co-authored by : tony9402 +# Link : http://boj.kr/a074da0ce3c34775a50d386da92800e4 +import sys + +def input(): + return sys.stdin.readline().rstrip() + +def answer(line, max_seq, coupon): + + count = 0 + for i in range(max_seq): + food_number = line[i] + if not eat[food_number]: + count += 1 + eat[food_number] += 1 + + max_count = count + for i in range(1, n): + if max_count <= count: + if not eat[coupon]: + max_count = count + 1 + else: + max_count = count + + out = i - 1 + eat[line[out]] -= 1 + if not eat[line[out]]: + count -= 1 + + in_ = (i + max_seq - 1) % n + if not eat[line[in_]]: + count += 1 + eat[line[in_]] += 1 + + return max_count + +n, f_kind, max_seq, coupon = map(int, input().split()) +line = [int(input()) for _ in range(n)] +eat = [0 for _ in range(3000001)] +print(answer(line, max_seq, coupon)) diff --git a/solution/two_pointer/1806/main.py b/solution/two_pointer/1806/main.py new file mode 100644 index 0000000..083486d --- /dev/null +++ b/solution/two_pointer/1806/main.py @@ -0,0 +1,28 @@ +# Authored by : cieske +# Co-authored by : - +# Link : http://boj.kr/a020564994b8493a92b189861e35636c + +import sys +def input(): + return sys.stdin.readline().rstrip() + +n, s = map(int, input().split()) +lst = list(map(int, input().split())) + +l_p, r_p, cur_sum, min_len = 0, 0, 0, 100002 +# cur_sum에 저장되는 구간합: sum(lst[l_p:r_p]) + +while l_p < n: + if cur_sum >= s: # 현재 구간이 주어진 s보다 크다면 + min_len = min(min_len, r_p-l_p) #현재 구간 길이(r_p-l_p)가 최소라면 업데이트 + cur_sum -= lst[l_p] #왼쪽 포인터를 한 칸 오른쪽으로 옮기고 구간 합 업데이트 + l_p += 1 + + elif r_p == n: #오른쪽 끝에 도달했다면? + break + + else: + cur_sum += lst[r_p] #오른쪽 구간을 움직여서 구간 합 업데이트 + r_p += 1 + +print(min_len if min_len < 100001 else 0) diff --git a/solution/two_pointer/1940/main.py b/solution/two_pointer/1940/main.py new file mode 100644 index 0000000..bad65df --- /dev/null +++ b/solution/two_pointer/1940/main.py @@ -0,0 +1,25 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/901436e12d914d5e9effcd67494bbb44 + +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +M = int(input()) +arr = list(map(int, input().split())) +arr.sort() +ans = 0 +s, e = 0, len(arr) - 1 +while s < e: + if arr[s] + arr[e] > M: + e -= 1 + elif arr[s] + arr[e] < M: + s += 1 + else: + s += 1 + e -= 1 + ans += 1 +print(ans) \ No newline at end of file diff --git a/solution/two_pointer/2018/main.py b/solution/two_pointer/2018/main.py new file mode 100644 index 0000000..244b311 --- /dev/null +++ b/solution/two_pointer/2018/main.py @@ -0,0 +1,26 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/2b640a2f6eb74e08aae6e351cfcbf537 + +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N = int(input()) +arr = [i for i in range(1, N+1)] +s, e = 0, 0 +ans = 0 +total = 0 +while True: + if total < N: + total += arr[e] + e += 1 + elif e == len(arr): + break + elif total >= N: + if total == N: + ans += 1 + total -= arr[s] + s += 1 +print(ans+1) \ No newline at end of file diff --git a/solution/two_pointer/20922/Main.java b/solution/two_pointer/20922/Main.java new file mode 100644 index 0000000..157b404 --- /dev/null +++ b/solution/two_pointer/20922/Main.java @@ -0,0 +1,68 @@ +//Authored by : suin8 +//Co-authored by : tony9402 +//Link : http://boj.kr/a390775f4af44af3af4239329e91fdcb + +import java.util.*; +import java.io.*; + +public class Main { + static int[] num = new int[200010]; + static int[] count = new int[100010]; + + public static void main(String[] args) { + FastReader rd = new FastReader(); + + int N = rd.nextInt(); + int K = rd.nextInt(); + + for(int i = 1;i <= N;i++) + num[i] = rd.nextInt(); + + // 투포인터로 풀이 + // start와 end사이에 겹치는 수가 K개 이하일 때는 end증가 + // K개 초과일 때는 start를 늘려가며 겹치는 수가 빠질때까지 begin증가 + int max = 0; + for(int begin = 1, end = 1; begin <= N; begin ++) { + while(end <= N && count[num[end]] < K) { + count[num[end]] ++; + end ++; + } + max = Math.max(end - begin, max); + count[num[begin]] --; + } + System.out.println(max); + } + + static class FastReader { + BufferedReader br; + StringTokenizer st; + + public FastReader() { + br = new BufferedReader(new InputStreamReader(System.in)); + } + + String next() { + while(st == null || !st.hasMoreElements()) { + try { + st = new StringTokenizer(br.readLine()); + } + catch (IOException e) { + e.printStackTrace(); + } + } + return st.nextToken(); + } + + int nextInt() { return Integer.parseInt(next()); } + String nextLine() { + String str = ""; + try { + str = br.readLine(); + } + catch (IOException e) { + e.printStackTrace(); + } + return str; + } + } +} diff --git a/solution/two_pointer/20922/main.cpp b/solution/two_pointer/20922/main.cpp new file mode 100644 index 0000000..2f1f8ca --- /dev/null +++ b/solution/two_pointer/20922/main.cpp @@ -0,0 +1,33 @@ +//Authored by : suin8 +//Co-authored by : tony9402 +//Link : http://boj.kr/bf868d6487744424a792c188673bf339 + +#include + +using namespace std; + +int num[200010], cnt[100010]; + +int main() { + ios::sync_with_stdio(false); + cin.tie(nullptr); + + int N, K; cin >> N >> K; + + for(int i = 1;i <= N;i++) + cin >> num[i]; + + // start와 end사이에 겹치는 수가 K개 이하일 때는 end를 늘리며 + // 최대 길이를 늘리고 + // K개 초과일 때는 begin를 늘리며 겹치는 수가 빠질때까지 begin을 증가 + int ans = 0; + for(int begin = 1, end = 1; begin <= N; begin ++) { + while(end <= N && cnt[num[end]] < K) ++cnt[num[end++]]; + ans = max(ans, end - begin); + cnt[num[begin]]--; + } + + cout << ans; + + return 0; +} diff --git a/solution/two_pointer/2473/main.py b/solution/two_pointer/2473/main.py new file mode 100644 index 0000000..ffa6e8d --- /dev/null +++ b/solution/two_pointer/2473/main.py @@ -0,0 +1,33 @@ +# Authored by : cieske +# Co-authored by : - +# Link : http://boj.kr/4d3bf96075df4b31b9a95038e6c649e6 + +import sys +def input(): + return sys.stdin.readline().rstrip() + +n = int(input()) +lst = sorted(list(map(int, input().split()))) # 정렬 필요 + +res = 4000000000 # INF 대용 +sol_candi = [] + +for i in range(n-2): + refer = lst[i] # 레퍼런스 값 하나를 잡아놓고 + l_p = i+1 # 레퍼런스 값을 제외한 양 끝에서 투 포인터 이동 + r_p = n-1 # 현재 i 이전에 본 레퍼런스 값은 더 이상 필요 없음! + while l_p < r_p: # 두 포인터가 만나기 전까지 + cur_sum = refer + lst[l_p] + lst[r_p] # 레퍼런스 값 + 두 포인터가 가리키는 값의 합 + if abs(cur_sum) <= abs(res): # 절댓값이 0에 가까운 것이 목표 + sol_candi = [refer, lst[l_p], lst[r_p]] # 정답 후보군 update + res = refer + lst[l_p] + lst[r_p] + #현재 값이 정답이 아니라면 포인터 이동 + if cur_sum < 0: + l_p += 1 + elif cur_sum > 0: + r_p -= 1 + else: + print(*sol_candi) # 정확히 0이 되는 조합을 찾았으면 더 볼 필요 없이 + sys.exit() # 바로 출력하고 프로그램 종료 + +print(*sol_candi) diff --git a/solution/two_pointer/2559/main.py b/solution/two_pointer/2559/main.py new file mode 100644 index 0000000..d8d6e5b --- /dev/null +++ b/solution/two_pointer/2559/main.py @@ -0,0 +1,27 @@ +# Authored by : gusdn3477 +# Co-authored by : - +# Link : http://boj.kr/1d6b566a715d4126b3cd42cc39521ac0 + +import sys + +def input(): + return sys.stdin.readline().rstrip() + +N, K = map(int, input().split()) +arr = list(map(int, input().split())) +total = 0 +MAX = -1e9 +s, e = 0, K-1 +if K == 1: + print(max(arr)) +else: + total = sum(arr[:K]) + while True: + MAX = max(MAX, total) + total -= arr[s] + s += 1 + e += 1 + if e == N: + break + total += arr[e] + print(MAX) \ No newline at end of file diff --git a/string/README.md b/string/README.md new file mode 100644 index 0000000..ccbefed --- /dev/null +++ b/string/README.md @@ -0,0 +1,79 @@ +# String (문자열) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +추천 문제 아닌 나머지는 나머지를 난이도 섞었습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/7276) +| 순번 | 추천 문제 | 문제 번호 | 문제 이름 | 난이도 | 풀이 링크 | +| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | +| 00 | :heavy_check_mark: | 3029 | 경고 | | 바로가기 | +| 01 | :heavy_check_mark: | 11720 | 숫자의 합 | | 바로가기 | +| 02 | :heavy_check_mark: | 11365 | !밀비 급일 | | 바로가기 | +| 03 | :heavy_check_mark: | 9046 | 복호화 | | 바로가기 | +| 04 | :heavy_check_mark: | 10798 | 세로읽기 | | 바로가기 | +| 05 | :heavy_check_mark: | 20154 | 이 구역의 승자는 누구야?! | | 바로가기 | +| 06 | :heavy_check_mark: | 1316 | 그룹 단어 체커 | | 바로가기 | +| 07 | :heavy_check_mark: | 1181 | 단어 정렬 | | 바로가기 | +| 08 | :heavy_check_mark: | 4659 | 비밀번호 발음하기 | | 바로가기 | +| 09 | :heavy_check_mark: | 16171 | 나는 친구가 적다 (Small) | | 바로가기 | +| 10 | :heavy_check_mark: | 6550 | 부분 문자열 | | 바로가기 | +| 11 | :heavy_check_mark: | 9342 | 염색체 | | 바로가기 | +| 12 | :heavy_check_mark: | 1764 | 듣보잡 | | 바로가기 | +| 13 | :heavy_check_mark: | 20291 | 파일 정리 | | 바로가기 | +| 14 | :heavy_check_mark: | 17413 | 단어 뒤집기 2 | | 바로가기 | +| 15 | :heavy_check_mark: | 17609 | 회문 | | 바로가기 | +| 16 | :heavy_check_mark: | 20437 | 문자열 게임 2 | | 바로가기 | +| 17 | :heavy_check_mark: | 16916 | 부분 문자열 | | | +| 18 | :heavy_check_mark: | 20210 | 파일 탐색기 | | | +| 19 | | 20944 | 팰린드롬 척화비 | | | +| 20 | | 1942 | 디지털시계 | | | +| 21 | | 1152 | 단어의 개수 | | 바로가기 | +| 22 | | 10809 | 알파벳 찾기 | | | +| 23 | | 10808 | 알파벳 개수 | | | +| 24 | | 1159 | 농구 경기 | | | +| 25 | | 2744 | 대소문자 바꾸기 | | 바로가기 | +| 26 | | 1718 | 암호 | | | +| 27 | | 1032 | 명령 프롬프트 | | 바로가기 | +| 28 | | 10988 | 팰린드롬인지 확인하기 | | | +| 29 | | 11655 | ROT13 | | | +| 30 | | 1259 | 팰린드롬수 | | | +| 31 | | 9933 | 민균이의 비밀번호 | | | +| 32 | | 6996 | 애너그램 | | | +| 33 | | 2941 | 크로아티아 알파벳 | | | +| 34 | | 14405 | 피카츄 | | | +| 35 | | 12871 | 무한 문자열 | | 바로가기 | +| 36 | | 2204 | 도비의 난독증 테스트 | | 바로가기 | +| 37 | | 4446 | ROT13 | | | +| 38 | | 20114 | 미아 노트 | | | +| 39 | | 5534 | 간판 | | | +| 40 | | 4396 | 지뢰 찾기 | | | +| 41 | | 9242 | 폭탄 해체 | | | +| 42 | | 1622 | 공통 순열 | | | +| 43 | | 3613 | Java vs C++ | | | +| 44 | | 9536 | 여우는 어떻게 울지? | | | +| 45 | | 12933 | 오리 | | | +| 46 | | 4836 | | | | +| 47 | | 11656 | 접미사 배열 | | | +| 48 | | 1620 | 나는야 포켓몬 마스터 이다솜 | | | +| 49 | | 1213 | 팰린드롬 만들기 | | | +| 50 | | 19844 | 단어 개수 세기 | | | +| 51 | | 2852 | NBA 농구 | | | +| 52 | | 11478 | 서로 다른 부분 문자열의 개수 | | | +| 53 | | 1972 | 놀라운 문자열 | | | +| 54 | | 19948 | 음유시인 영재 | | | +| 55 | | 9548 | 무제 | | | +| 56 | | 3005 | 크로스워드 퍼즐 쳐다보기 | | | +| 57 | | 19583 | 싸이버개강총회 | | | +| 58 | | 13022 | 늑대와 올바른 단어 | | | +| 59 | | 15927 | 회문은 회문아니야!! | | | +| 60 | | 3107 | IPv6 | | | +| 61 | | 2671 | 잠수함식별 | | | +| 62 | | 2115 | 갤러리 | | | +| 63 | | 16890 | 창업 | | | diff --git a/string/header.md b/string/header.md new file mode 100644 index 0000000..9f3e218 --- /dev/null +++ b/string/header.md @@ -0,0 +1,13 @@ +# String (문자열) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +추천 문제 아닌 나머지는 나머지를 난이도 섞었습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/7276) diff --git a/string/list.md b/string/list.md new file mode 100644 index 0000000..020e479 --- /dev/null +++ b/string/list.md @@ -0,0 +1,64 @@ +1,3029,./../solution/string/3029 +,1942, +,20944, +1,11720,./../solution/string/11720 +,1152,./../solution/string/1152 +,10809, +,10808, +1,11365,./../solution/string/11365 +,1159, +,2744,./../solution/string/2744 +,1718, +1,9046,./../solution/string/9046 +,1032,./../solution/string/1032 +1,10798,./../solution/string/10798 +,10988, +,11655, +,1259, +,9933, +,6996, +1,20154,./../solution/string/20154 +1,1316,./../solution/string/1316 +,2941, +1,1181,./../solution/string/1181 +,3613, +,9536, +,14405, +1,4659,./../solution/string/4659 +1,16171,./../solution/string/16171 +,12871,./../solution/string/12871 +,2204,./../solution/string/2204 +,4446, +1,9342,./../solution/string/9342 +,20114, +,12933, +,5534, +1,6550,./../solution/string/6550 +,4396, +,9242, +,4836, +1,1764,./../solution/string/1764 +,11656, +,1620, +,1213, +1,20291,./../solution/string/20291 +,19844, +,1622, +1,17413,./../solution/string/17413 +,11478, +,2852, +,1972, +,19948, +,9548, +1,17609,./../solution/string/17609 +,3005, +,19583, +,13022, +,15927, +,3107, +,2671, +1,20437,./../solution/string/20437 +1,16916, +,2115, +,16890, +1,20210, diff --git a/topological_sorting/README.md b/topological_sorting/README.md new file mode 100644 index 0000000..309b9c3 --- /dev/null +++ b/topological_sorting/README.md @@ -0,0 +1,31 @@ +# Topological Sorting (위상정렬) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +위상정렬 문제를 뽑아봤습니다. + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +계보 복원가 호석은 위상정렬로 말고 다른 풀이로도 풀이 가능합니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/7165) +| 순번 | 추천 문제 | 문제 번호 | 문제 이름 | 난이도 | 풀이 링크 | +| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | +| 00 | :heavy_check_mark: | 14567 | 선수과목 (Prerequisite) | | | +| 01 | :heavy_check_mark: | 1005 | ACM Craft | | | +| 02 | :heavy_check_mark: | 2252 | 줄 세우기 | | | +| 03 | :heavy_check_mark: | 1766 | 문제집 | | | +| 04 | :heavy_check_mark: | 2623 | 음악프로그램 | | | +| 05 | | 2056 | 작업 | | | +| 06 | | 14676 | 영우는 사기꾼? | | | +| 07 | | 1516 | 게임 개발 | | | +| 08 | | 9470 | Strahler 순서 | | | +| 09 | | 21276 | 계보 복원가 호석 | | | +| 10 | | 2637 | 장난감 조립 | | | +| 11 | | 20119 | 클레어와 물약 | | | +| 12 | | 3665 | 최종 순위 | | | +| 13 | | 1948 | 임계경로 | | | diff --git a/topological_sorting/header.md b/topological_sorting/header.md new file mode 100644 index 0000000..39ebead --- /dev/null +++ b/topological_sorting/header.md @@ -0,0 +1,15 @@ +# Topological Sorting (위상정렬) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +위상정렬 문제를 뽑아봤습니다. + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +계보 복원가 호석은 위상정렬로 말고 다른 풀이로도 풀이 가능합니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/7165) diff --git a/topological_sorting/list.md b/topological_sorting/list.md new file mode 100644 index 0000000..cdf90db --- /dev/null +++ b/topological_sorting/list.md @@ -0,0 +1,14 @@ +1,14567, +,2056, +,14676, +1,1005, +,1516, +,9470, +1,2252, +1,1766, +1,2623, +,2637, +,20119, +,3665, +,1948, +,21276, diff --git a/tree/README.md b/tree/README.md new file mode 100644 index 0000000..c6a8288 --- /dev/null +++ b/tree/README.md @@ -0,0 +1,61 @@ +# tree (트리) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +추천 문제 아닌 나머지는 나머지를 난이도 섞었습니다. + +문제에 트리가 나오는 문제들을 모아보았습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/7645) +| 순번 | 추천 문제 | 문제 번호 | 문제 이름 | 난이도 | 풀이 링크 | +| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | +| 00 | :heavy_check_mark: | 11725 | 트리의 부모 찾기 | | | +| 01 | :heavy_check_mark: | 1991 | 트리 순회 | | 바로가기 | +| 02 | :heavy_check_mark: | 9934 | 완전 이진 트리 | | | +| 03 | :heavy_check_mark: | 5639 | 이진 검색 트리 | | | +| 04 | :heavy_check_mark: | 1068 | 트리 | | 바로가기 | +| 05 | :heavy_check_mark: | 6416 | 트리인가? | | | +| 06 | :heavy_check_mark: | 14675 | 단절점과 단절선 | | | +| 07 | :heavy_check_mark: | 17073 | 나무 위의 빗물 | | | +| 08 | :heavy_check_mark: | 1967 | 트리의 지름 | | 바로가기 | +| 09 | :heavy_check_mark: | 3584 | 가장 가까운 공통 조상 | | 바로가기 | +| 10 | :heavy_check_mark: | 9489 | 사촌 | | | +| 11 | :heavy_check_mark: | 20924 | 트리의 기둥과 가지 | | | +| 12 | :heavy_check_mark: | 4256 | 트리 | | | +| 13 | :heavy_check_mark: | 2263 | 트리의 순회 | | | +| 14 | :heavy_check_mark: | 2250 | 트리의 높이와 너비 | | | +| 15 | | 9372 | 상근이의 여행 | | | +| 16 | | 20364 | 부동산 다툼 | | | +| 17 | | 15900 | 나무 탈출 | | | +| 18 | | 15681 | 트리와 쿼리 | | 바로가기 | +| 19 | | 19641 | 중첩 집합 모델 | | | +| 20 | | 1240 | 노드사이의 거리 | | | +| 21 | | 4803 | 트리 | | | +| 22 | | 14267 | 회사 문화 1 | | | +| 23 | | 19542 | 전단지 돌리기 | | | +| 24 | | 20955 | 민서의 응급 수술 | | | +| 25 | | 4933 | 뉴턴의 사과 | | | +| 26 | | 21276 | 계보 복원가 호석 | | | +| 27 | | 1167 | 트리의 지름 | | | +| 28 | | 1595 | 북쪽나라의 도로 | | | +| 29 | | 2058 | 원자의 에너지 | | | +| 30 | | 2533 | 사회망 서비스(SNS) | | | +| 31 | | 11437 | LCA | | 바로가기 | +| 32 | | 12896 | 스크루지 민호 | | | +| 33 | | 19535 | ㄷㄷㄷㅈ | | | +| 34 | | 12978 | 스크루지 민호 2 | | | +| 35 | | 14657 | 준오는 최종인재야!! | | | +| 36 | | 16437 | 양 구출 작전 | | | +| 37 | | 14570 | 나무 위의 구슬 | | | +| 38 | | 4315 | 나무 위의 구슬 | | | +| 39 | | 1949 | 우수 마을 | | | +| 40 | | 2213 | 트리의 독립집합 | | | +| 41 | | 2233 | 사과나무 | | | +| 42 | | 12912 | 트리 수정 | | | +| 43 | | 19581 | 두 번째 트리의 지름 | | | diff --git a/tree/header.md b/tree/header.md new file mode 100644 index 0000000..cb5d6af --- /dev/null +++ b/tree/header.md @@ -0,0 +1,15 @@ +# tree (트리) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +추천 문제 아닌 나머지는 나머지를 난이도 섞었습니다. + +문제에 트리가 나오는 문제들을 모아보았습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/7645) diff --git a/tree/list.md b/tree/list.md new file mode 100644 index 0000000..1eb9673 --- /dev/null +++ b/tree/list.md @@ -0,0 +1,44 @@ +1,1991,./../solution/tree/1991 +,9372, +1,9934, +1,11725, +,20364, +1,1068,./../solution/tree/1068 +1,5639, +,15900, +1,6416, +1,14675, +,15681,./../solution/tree/15681 +1,17073, +,19641, +,1240, +1,1967,./../solution/tree/1967 +1,3584,./../solution/tree/3584 +1,4256, +,4803, +,4933, +1,9489, +,14267, +,19542, +1,20924, +,20955, +,21276, +,1167, +,1595, +,2058, +1,2263, +,2533, +,11437,./../solution/tree/11437 +,12896, +,19535, +1,2250, +,4315, +,14657, +,16437, +,1949, +,2213, +,2233, +,12912, +,12978, +,14570, +,19581, diff --git a/trie/README.md b/trie/README.md new file mode 100644 index 0000000..b62c9a0 --- /dev/null +++ b/trie/README.md @@ -0,0 +1,29 @@ +# Trie (트라이) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +추천 문제 아닌 나머지는 나머지를 난이도 섞었습니다. + +트라이 추천 문제에서는 꼭 트라이로 안풀어도 되는 문제가 있습니다. + +하지만 트라이를 연습하려고 하시는 분들은 반드시 트라이로 풀어보는걸 추천드립니다. +(코테에 안나올 가능성이 매우 높은 문제도 있습니다. 골드 수준까지만 풀고 넘어가도 무방합니다.) + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/6785) +| 순번 | 추천 문제 | 문제 번호 | 문제 이름 | 난이도 | 풀이 링크 | +| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | +| 00 | :heavy_check_mark: | 14425 | 문자열 집합 | | 바로가기 | +| 01 | :heavy_check_mark: | 4358 | 생태학 | | | +| 02 | :heavy_check_mark: | 20166 | 문자열 지옥에 빠진 호석 | | | +| 03 | :heavy_check_mark: | 5052 | 전화번호 목록 | | | +| 04 | :heavy_check_mark: | 14725 | 개미굴 | | | +| 05 | | 9202 | Boggle | | | +| 06 | | 5670 | 휴대폰 자판 | | | +| 07 | | 5446 | 용량 부족 | | | +| 08 | | 19585 | 전설 | | | diff --git a/trie/header.md b/trie/header.md new file mode 100644 index 0000000..98366ef --- /dev/null +++ b/trie/header.md @@ -0,0 +1,18 @@ +# Trie (트라이) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +추천 문제 아닌 나머지는 나머지를 난이도 섞었습니다. + +트라이 추천 문제에서는 꼭 트라이로 안풀어도 되는 문제가 있습니다. + +하지만 트라이를 연습하려고 하시는 분들은 반드시 트라이로 풀어보는걸 추천드립니다. +(코테에 안나올 가능성이 매우 높은 문제도 있습니다. 골드 수준까지만 풀고 넘어가도 무방합니다.) + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/6785) diff --git a/trie/list.md b/trie/list.md new file mode 100644 index 0000000..1d7aee8 --- /dev/null +++ b/trie/list.md @@ -0,0 +1,9 @@ +1,14425,./../solution/trie/14425 +1,5052, +1,4358, +1,14725, +1,20166, +,9202, +,5670, +,5446, +,19585, diff --git a/two_pointer/README.md b/two_pointer/README.md new file mode 100644 index 0000000..fba89cd --- /dev/null +++ b/two_pointer/README.md @@ -0,0 +1,57 @@ +# Two Pointers (투 포인터) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +추천 문제 아닌 나머지는 나머지를 난이도 섞었습니다. + +최근 많이 나오는 유형이니 꼭 풀어보시길 바랍니다. + +특히, 투 포인터는 부분합과 많이 연관되어 나오는 만큼, 투 포인터 문제는 아니지만 부분합을 연습할 수 있는 문제를 첫 문제로 넣어놨습니다. + +광부 호석은 최근 제 2회 류호석배 코딩테스트에서 나온 문제로 코딩테스트 치곤 상당히 어려운 문제에 속하지만 한번 접해보면 매우 좋은 문제라 넣었습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/6782) +| 순번 | 추천 문제 | 문제 번호 | 문제 이름 | 난이도 | 풀이 링크 | +| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | +| 00 | :heavy_check_mark: | 11728 | 배열 합치기 | | | +| 01 | :heavy_check_mark: | 21921 | 블로그 | | | +| 02 | :heavy_check_mark: | 20922 | 겹치는 건 싫어 | | 바로가기 | +| 03 | :heavy_check_mark: | 22862 | 가장 긴 짝수 연속한 부분 수열 (large) | | | +| 04 | :heavy_check_mark: | 2470 | 두 용액 | | | +| 05 | :heavy_check_mark: | 15961 | 회전 초밥 | | 바로가기 | +| 06 | :heavy_check_mark: | 1806 | 부분합 | | 바로가기 | +| 07 | :heavy_check_mark: | 3151 | 합이 0 | | | +| 08 | :heavy_check_mark: | 22945 | 팀 빌딩 | | | +| 09 | :heavy_check_mark: | 20366 | 같이 눈사람 만들래? | | | +| 10 | :heavy_check_mark: | 20442 | ㅋㅋ루ㅋㅋ | | | +| 11 | :heavy_check_mark: | 7453 | 합이 0인 네 정수 | | | +| 12 | :heavy_check_mark: | 21279 | 광부 호석 | | | +| 13 | | 2018 | 수들의 합 5 | | 바로가기 | +| 14 | | 1940 | 주몽 | | 바로가기 | +| 15 | | 10025 | 게으른 백곰 | | | +| 16 | | 6159 | 코스튬 파티 | | | +| 17 | | 3273 | 두 수의 합 | | | +| 18 | | 2003 | 수들의 합 2 | | | +| 19 | | 2559 | 수열 | | 바로가기 | +| 20 | | 2428 | 표절 | | | +| 21 | | 15565 | 귀여운 라이언 | | | +| 22 | | 2531 | 회전 초밥 | | | +| 23 | | 2118 | 두 개의 탑 | | | +| 24 | | 2467 | 용액 | | | +| 25 | | 2230 | 수 고르기 | | | +| 26 | | 14921 | 용액 합성하기 | | | +| 27 | | 9024 | 두 수의 합 | | | +| 28 | | 2473 | 세 용액 | | 바로가기 | +| 29 | | 1484 | 다이어트 | | | +| 30 | | 13422 | 도둑 | | | +| 31 | | 6137 | 문자열 생성 | | | +| 32 | | 1644 | 소수의 연속합 | | | +| 33 | | 16472 | 고냥이 | | | +| 34 | | 15831 | 준표의 조약돌 | | | +| 35 | | 20181 | 꿈틀꿈틀 호석 애벌레 - 효율성 | | | diff --git a/two_pointer/header.md b/two_pointer/header.md new file mode 100644 index 0000000..aef9a5d --- /dev/null +++ b/two_pointer/header.md @@ -0,0 +1,19 @@ +# Two Pointers (투 포인터) + +[메인으로 돌아가기](https://github.com/tony9402/baekjoon) + +풀어보면 좋을 문제는 추천 문제에 체크(:heavy_check_mark:) 해놨습니다. + +추천 문제 아닌 나머지는 나머지를 난이도 섞었습니다. + +최근 많이 나오는 유형이니 꼭 풀어보시길 바랍니다. + +특히, 투 포인터는 부분합과 많이 연관되어 나오는 만큼, 투 포인터 문제는 아니지만 부분합을 연습할 수 있는 문제를 첫 문제로 넣어놨습니다. + +광부 호석은 최근 제 2회 류호석배 코딩테스트에서 나온 문제로 코딩테스트 치곤 상당히 어려운 문제에 속하지만 한번 접해보면 매우 좋은 문제라 넣었습니다. + +
+ +***❗️❗️꼭 문제를 순서대로 안풀어도 됩니다.❗️❗️*** + +[백준 문제집](https://www.acmicpc.net/workbook/view/6782) diff --git a/two_pointer/list.md b/two_pointer/list.md new file mode 100644 index 0000000..3b330d1 --- /dev/null +++ b/two_pointer/list.md @@ -0,0 +1,36 @@ +1,2470, +1,15961,./../solution/two_pointer/15961 +1,1806,./../solution/two_pointer/1806 +1,7453, +,15565, +,2467, +,2473,./../solution/two_pointer/2473 +,1644, +,20181, +,16472, +1,11728, +,2018,./../solution/two_pointer/2018 +,1940,./../solution/two_pointer/1940 +,3273, +,10025, +,6159, +,2003, +,2559,./../solution/two_pointer/2559 +,2531, +,2118, +1,20922,./../solution/two_pointer/20922 +,2230, +,14921, +,9024, +,1484, +,13422, +,15831, +1,20366, +,6137, +1,3151, +1,20442, +1,21279, +,2428, +1,21921, +1,22862, +1,22945,