├── .gitignore ├── Algorithm-practice.iml ├── README.md ├── notes ├── Basic │ └── README.md ├── DataStructure │ ├── Array+LinkedList.md │ ├── README.md │ ├── Stack+Queue.md │ └── Trie.md ├── Graph │ ├── DisjointSet.md │ ├── Graph.md │ └── TopologicalSort.md ├── README.md └── Sort │ └── QuickSort │ ├── Main.java │ └── README.md └── src ├── Array ├── CyclicRotation │ ├── Main.java │ └── README.md ├── FrogRiverOne │ ├── Main.java │ └── README.md ├── MaxCounters │ ├── Main.java │ └── README.md ├── MissingInteger │ ├── Main.java │ └── README.md ├── OddOccurrencesInArray │ ├── Main.java │ └── README.md ├── P20299 │ ├── Main.java │ ├── README.md │ └── input.txt ├── PermCheck │ ├── Main.java │ └── README.md ├── swea1208 │ ├── README.md │ ├── Solution.java │ └── input.txt ├── swea1210 │ ├── README.md │ ├── Solution.java │ ├── input.txt │ └── output.txt ├── swea1954 │ ├── README.md │ ├── Solution.java │ └── input.txt ├── swea2001 │ ├── README.md │ ├── Solution.java │ ├── input.txt │ └── output.txt └── swea2805 │ ├── README.md │ ├── Solution.java │ ├── input.txt │ └── output.txt ├── BFS ├── P1039 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1194 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P13460 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P13549 │ ├── Main.java │ └── README.md ├── P14226 │ ├── Main.java │ └── README.md ├── P14502 │ ├── Main.java │ ├── Main2.java │ ├── README.md │ └── input.txt ├── P1525 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1600 │ ├── Main.java │ ├── Main2.java │ ├── README.md │ └── input.txt ├── P16236 │ ├── Main.java │ ├── Main2.java │ ├── README.md │ └── input.txt ├── P1697 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1743 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1938 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1939 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P20304 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2178 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2206 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P3055 │ ├── Main.java │ ├── README.md │ └── input1.txt ├── P7576 │ ├── Main.java │ ├── Main2.java │ ├── README.md │ └── input.txt ├── swea10966 │ ├── README.md │ ├── Solution.java │ ├── sample_input.txt │ └── sample_output.txt ├── swea1238 │ ├── README.md │ ├── Solution.java │ ├── input.txt │ └── output.txt ├── swea1249 │ ├── README.md │ ├── Solution.java │ ├── Solution2.java │ ├── input.txt │ └── output.txt └── swea1953 │ ├── README.md │ ├── Solution.java │ ├── sample_input.txt │ └── sample_output.txt ├── BruteForce ├── P14889 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P16637 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P17136 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P17471 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2468 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2961 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P3040 │ ├── Main.java │ ├── README.md │ └── input.txt ├── prg42839 │ ├── Main.java │ └── README.md ├── prg42842 │ ├── Main.java │ └── README.md ├── swea1247 │ ├── README.md │ ├── Solution.java │ ├── input.txt │ └── output.txt ├── swea3234 │ ├── README.md │ ├── Solution.java │ ├── sample_input.txt │ └── sample_output.txt └── swea4012 │ ├── README.md │ ├── Solution.java │ ├── sample_input.txt │ └── sample_output.txt ├── Combination ├── P1007 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1010 │ ├── Main.java │ └── input.txt ├── P11050 │ └── Main.java ├── P11051 │ └── Main.java ├── P1256 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2798 │ ├── Main.java │ ├── README.md │ └── input.txt └── swea9229 │ ├── README.md │ ├── Solution.java │ ├── sample_input.txt │ └── sample_output.txt ├── DAC ├── P1074 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P10830 │ ├── Main.java │ ├── README.md │ └── input.txt └── P1992 │ ├── Main.java │ ├── README.md │ └── input.txt ├── DFS ├── P1062 │ ├── Main.java │ ├── Main2.java │ ├── README.md │ └── input.txt ├── P10971 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1103 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P13023 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P14500 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P14501 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P14888 │ ├── Main.java │ └── README.md ├── P1520 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P15658 │ ├── Main.java │ └── README.md ├── P17070 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1759 │ ├── Main.java │ ├── Main2.java │ ├── README.md │ └── input.txt ├── P1937 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1987 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P20164 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2667 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P3109 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P4963 │ ├── Main.java │ ├── README.md │ └── input.txt ├── prg12952 │ ├── Main.java │ └── README.md ├── swea1949 │ ├── README.md │ ├── Solution.java │ ├── sample_input.txt │ └── sample_output.txt ├── swea2105 │ ├── README.md │ ├── Solution.java │ ├── sample_input.txt │ └── sample_output.txt └── swea5215 │ ├── README.md │ ├── Solution.java │ ├── sample_input.txt │ └── sample_output.txt ├── DFSandBFS ├── P1260 │ ├── Main.java │ ├── README.md │ └── input.txt └── P2573 │ ├── Main.java │ ├── README.md │ └── input.txt ├── DP ├── MinAbsSum │ └── Main.java ├── P1003 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P10844 │ ├── Main.java │ └── README.md ├── P11048 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P11052 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P11053 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P11054 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P11055 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P11057 │ ├── Main.java │ └── README.md ├── P11066 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1149 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P11659 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P11660 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P11722 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P11726 │ ├── Main.java │ └── README.md ├── P11727 │ ├── Main.java │ └── README.md ├── P12852 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P12865 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1328 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P13398 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P14002 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1463 │ ├── Main.java │ └── README.md ├── P15678 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P15988 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P15990 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P16194 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1699 │ ├── Main.java │ └── README.md ├── P17845 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1912 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1932 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2098 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2156 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2193 │ ├── Main.java │ └── README.md ├── P2225 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2294 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2533 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2579 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2629 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P9095 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P9465 │ ├── Main.java │ ├── README.md │ └── input.txt ├── jo1681 │ ├── Main.java │ ├── README.md │ └── input.txt ├── prg42895 │ ├── Main.java │ └── README.md ├── swea1861 │ ├── README.md │ ├── Solution.java │ ├── input.txt │ └── output.txt └── swea1952 │ ├── README.md │ ├── Solution.java │ ├── sample_input.txt │ └── sample_output.txt ├── GCD ├── GCDTest.java ├── P14476 │ ├── Main.java │ └── input.txt ├── P1735 │ ├── Main.java │ ├── README.md │ └── input.txt └── P2609 │ ├── Main.java │ ├── README.md │ └── input.txt ├── Graph ├── P11404 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P11657 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P11724 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1197 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P14621 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P16398 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P16562 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1707 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1717 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1738 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P17472 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1753 │ ├── Main.java │ ├── Main2.java │ ├── README.md │ └── input.txt ├── P1854 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1944 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P21276 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P21278 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2252 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2458 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P3860 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P4195 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P4386 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P5719 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P9205 │ ├── Main.java │ ├── README.md │ └── input.txt ├── jo1863 │ ├── Main.java │ ├── README.md │ └── input.txt ├── prg43162 │ ├── Main.java │ └── README.md ├── prg49189 │ ├── README.md │ └── Solution.java ├── prg49191 │ ├── README.md │ └── Solution.java ├── swea1251 │ ├── README.md │ ├── Solution.java │ ├── input.txt │ └── output.txt ├── swea1263 │ ├── README.md │ ├── Solution.java │ ├── input.txt │ └── output.txt └── swea3289 │ ├── README.md │ ├── Solution.java │ └── sample_input.txt ├── Greedy ├── P1092 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P11047 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1343 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2839 │ ├── Main.java │ ├── README.md │ └── usingDP.java ├── P2847 │ ├── Main.java │ ├── README.md │ └── input.txt └── jo1828 │ ├── Main.java │ ├── README.md │ └── input.txt ├── Hash ├── P1764 │ ├── Main.java │ ├── README.md │ └── input.txt ├── prg42576 │ ├── README.md │ └── Solution.java ├── prg42577 │ ├── README.md │ └── Solution.java ├── prg42578 │ ├── README.md │ └── Solution.java └── prg42579 │ ├── Main.java │ └── README.md ├── Heap ├── P11279 │ ├── Main.java │ └── input.txt ├── P11286 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1202 │ ├── Main.java │ └── input.txt ├── P1927 │ ├── Main.java │ └── input.txt ├── P7662 │ ├── Main.java │ ├── README.md │ └── input.txt ├── prg42626 │ ├── Main.java │ └── README.md ├── prg42627 │ ├── Main.java │ └── README.md └── prg42628 │ ├── Main.java │ └── README.md ├── Implementation ├── P10713 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P11005 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P12933 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P15787 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P16463 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P16719 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P20546 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P21608 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2615 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2877 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P4396 │ ├── Main.java │ ├── README.md │ └── input.txt ├── prg70130 │ ├── Main.java │ └── README.md ├── prg84512 │ ├── Main.java │ └── README.md ├── prg85002 │ ├── Main.java │ └── README.md └── prg86048 │ ├── Main.java │ └── README.md ├── IndexedTree ├── IndexedTreeTest.java ├── P10868 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P11505 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1275 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P12837 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2042 │ ├── Main.java │ └── input.txt ├── P2243 │ ├── Main.java │ └── input.txt ├── P2268 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2357 │ ├── Main.java │ ├── README.md │ └── input.txt └── P5676 │ ├── Main.java │ ├── README.md │ └── input.txt ├── Iterations ├── BinaryGap │ ├── Main.java │ └── README.md ├── swea1289 │ ├── README.md │ ├── Solution.java │ └── input.txt ├── swea3499 │ ├── README.md │ ├── Solution.java │ ├── sample_input.txt │ └── sample_output.txt ├── swea4789 │ ├── README.md │ ├── Solution.java │ ├── sample_input.txt │ └── sample_output.txt ├── swea5356 │ ├── README.md │ ├── Solution.java │ ├── sample_input.txt │ └── sample_output.txt ├── swea6485 │ ├── README.md │ ├── Solution.java │ ├── s_input.txt │ └── s_output.txt └── swea7964 │ ├── README.md │ ├── Solution.java │ ├── input.txt │ └── output.txt ├── List └── P18115 │ ├── Main.java │ ├── README.md │ └── input.txt ├── Math ├── P13458 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2108 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P21275 │ ├── Main.java │ ├── README.md │ └── input.txt └── swea8382 │ ├── README.md │ ├── Solution.java │ ├── sample_input.txt │ └── sample_output.txt ├── Permutation ├── P10972 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P10973 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P10974 │ ├── Main.java │ └── README.md ├── P1722 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P5568 │ ├── Main.java │ └── input.txt ├── P9742 │ ├── Main.java │ ├── README.md │ └── input.txt └── swea6808 │ ├── README.md │ ├── Solution.java │ ├── s_input.txt │ └── s_output.txt ├── Prime ├── P1644 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1929 │ ├── Main.java │ └── README.md ├── P1978 │ ├── Main.java │ └── README.md ├── P6588 │ ├── Main.java │ └── README.md └── swea4698 │ ├── README.md │ ├── Solution.java │ ├── sample_input.txt │ └── sample_output.txt ├── Probability └── P13251 │ ├── Main.java │ └── input.txt ├── Queue ├── P10845 │ ├── Main.java │ └── input.txt ├── P1158 │ ├── Main.java │ ├── Main2.java │ ├── Main3.java │ ├── README.md │ └── input.txt ├── P18258 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1966 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P3190 │ ├── Main.java │ ├── README.md │ └── input.txt ├── prg42583 │ ├── README.md │ └── Solution.java ├── prg42586 │ ├── README.md │ └── Solution.java ├── prg42587 │ ├── README.md │ └── Solution.java └── swea1225 │ ├── README.md │ ├── Solution.java │ ├── input.txt │ └── output.txt ├── Recursion ├── P17478 │ ├── Main.java │ └── README.md └── P1914 │ ├── Main.java │ ├── README.md │ └── input.txt ├── Series ├── NandM │ ├── P15649 │ │ └── Main.java │ ├── P15650 │ │ └── Main.java │ ├── P15651 │ │ ├── Main.java │ │ └── README.md │ ├── P15652 │ │ └── Main.java │ ├── P15654 │ │ └── Main.java │ ├── P15655 │ │ └── Main.java │ ├── P15656 │ │ └── Main.java │ ├── P15657 │ │ └── Main.java │ ├── P15663 │ │ └── Main.java │ ├── P15664 │ │ └── Main.java │ ├── P15665 │ │ └── Main.java │ ├── P15666 │ │ └── Main.java │ └── input.txt └── 수열과쿼리 │ ├── P13537 │ ├── Main.java │ └── README.md │ ├── P13544 │ ├── Main.java │ └── README.md │ └── input.txt ├── Simulation ├── P10163 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1022 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P12100 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1244 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P13300 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P14499 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P14503 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P14891 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P15662 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P15683 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P15686 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P16927 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P16935 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1713 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P17135 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P17144 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P17281 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P17406 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P17779 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P19236 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2174 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2477 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2563 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2564 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2571 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2636 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2931 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P3954 │ ├── Main.java │ ├── README.md │ └── input.txt ├── jo1037 │ ├── Main.java │ ├── README.md │ └── input.txt ├── jo1205 │ ├── Main.java │ ├── README.md │ └── input.txt ├── swea1767 │ ├── README.md │ ├── Solution.java │ ├── sample_input.txt │ └── sample_output.txt ├── swea1873 │ ├── README.md │ ├── Solution.java │ ├── input.txt │ └── output.txt ├── swea2115 │ ├── README.md │ ├── Solution.java │ ├── sample_input.txt │ └── sample_output.txt ├── swea4014 │ ├── README.md │ ├── Solution.java │ ├── sample_input.txt │ └── sample_output.txt ├── swea5656 │ ├── README.md │ ├── Solution.java │ ├── sample_input.txt │ └── sample_output.txt └── swea9760 │ ├── README.md │ ├── Solution.java │ ├── input.txt │ └── output.txt ├── Sort ├── P10989 │ ├── Main.java │ └── README.md ├── P11931 │ ├── Main.java │ └── README.md ├── P15688 │ ├── Main.java │ └── README.md ├── P2750 │ ├── Main.java │ └── README.md ├── P2751 │ ├── Main.java │ └── README.md ├── input.txt ├── prg42746 │ ├── Main.java │ └── README.md ├── prg42747 │ ├── Main.java │ └── README.md └── prg42748 │ ├── Main.java │ └── README.md ├── Stack ├── P10799 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P10828 │ ├── Main.java │ └── input.txt ├── P17298 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1863 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1918 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2493 │ ├── Main.java │ ├── Main2.java │ ├── README.md │ └── input.txt ├── P2504 │ ├── Main.java │ └── input.txt ├── P2800 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2867 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P3425 │ ├── Main.java │ ├── README.md │ └── input.txt ├── prg42584 │ ├── README.md │ └── Solution.java ├── swea1218 │ ├── README.md │ ├── Solution.java │ ├── input.txt │ └── output.txt └── swea1223 │ ├── README.md │ ├── Solution.java │ ├── input.txt │ └── output.txt ├── String ├── P10256 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1213 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1305 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P13505 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P14425 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P14426 │ ├── Main.java │ ├── README.md │ ├── input.txt │ └── usingTrie.java ├── P15740 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P17413 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1786 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P5052 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P6503 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P9093 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P9250 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P9252 │ ├── Main.java │ ├── README.md │ └── input.txt └── P9342 │ ├── Main.java │ ├── README.md │ └── input.txt ├── TimeComplexity ├── FrogJmp │ ├── Main.java │ └── README.md ├── P12015 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P12738 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P14003 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P15961 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P16566 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1806 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2003 │ ├── Main.java │ └── input.txt ├── P2143 │ ├── Main.java │ └── input.txt ├── P2748 │ └── Main.java ├── P2805 │ ├── Main.java │ └── input.txt ├── PermMissingElem │ ├── Main.java │ └── README.md ├── TapeEquilibrium │ ├── Main.java │ └── README.md ├── prg43238 │ ├── Main.java │ └── README.md └── swea3307 │ ├── README.md │ ├── Solution.java │ ├── sample_input.txt │ └── sample_output.txt ├── Tree ├── P1068 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1167 │ ├── Main.java │ ├── Main2.java │ ├── README.md │ └── input.txt ├── P11725 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P1991 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P2263 │ ├── Main.java │ ├── README.md │ └── input.txt └── swea1233 │ ├── README.md │ ├── Solution.java │ ├── input.txt │ └── output.txt ├── Trie ├── P5670 │ ├── Main.java │ ├── README.md │ └── input.txt ├── P9202 │ ├── Answer │ │ └── Main.java │ ├── Main.java │ ├── README.md │ └── input.txt └── TrieTest.java ├── _2019_KAKAO_BLIND_RECRUITMENT ├── P1 │ ├── Main.java │ └── README.md ├── P2 │ ├── Main.java │ └── README.md ├── P3 │ ├── Main.java │ └── README.md └── P6 │ ├── Main.java │ └── README.md ├── _2020_KAKAO_BLIND_RECRUITMENT ├── P1 │ ├── 210103.js │ ├── Main.java │ └── README.md ├── P2 │ ├── 210109.js │ ├── Main.java │ └── README.md ├── P3 │ ├── Main.java │ └── README.md ├── P4 │ ├── Main.java │ └── README.md ├── P5 │ ├── Main.java │ └── README.md ├── P6 │ ├── Main.java │ └── README.md └── P7 │ ├── Main.java │ └── README.md ├── _2020_카카오_인턴십 ├── P1 │ ├── Main.java │ └── README.md ├── P2 │ ├── Main.java │ └── README.md ├── P3 │ ├── Main.java │ └── README.md ├── P4 │ ├── Main.java │ └── README.md └── P5 │ ├── Main.java │ └── README.md └── _2021_KAKAO_BLIND_RECRUITMENT ├── P1 ├── Main.java └── README.md ├── P2 ├── Main.java └── README.md ├── P3 ├── Main.java └── README.md └── P4 ├── Main.java └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | out/ 3 | _TEST/ 4 | _XPractice/ -------------------------------------------------------------------------------- /Algorithm-practice.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /notes/DataStructure/Array+LinkedList.md: -------------------------------------------------------------------------------- 1 | # 배열(Array)과 연결 리스트(Linked List) 2 | 3 | 배열과 연결 리스트는 서로 반대되는 특징을 가졌다. 4 | 5 | ## Array (배열) 6 | 7 | 동일한 자료형의 데이터를 일렬로 나열한 자료구조이다. 8 | 9 | - 선형 자료구조 10 | - 데이터 접근이 용이하다. (인덱스로 접근) 11 | - 데이터 삽입/삭제가 어렵다. 12 | - 구조가 간단하여 프로그램 작성이 쉽다. 13 | 14 | ## Linked List (연결 리스트) 15 | 16 | 각 노드가 **데이터**와 **포인터**를 가지고 일렬로 연결되어 있는 방식이다. 17 | 18 | - 선형 자료구조 19 | - 데이터의 접근이 느리다. (링크를 타고 가서 찾아야 한다.) 20 | - 데이터의 삽입/삭제 연산이 용이하다. 21 | - 포인터를 위한 추가 공간이 필요하다. 22 | -------------------------------------------------------------------------------- /notes/README.md: -------------------------------------------------------------------------------- 1 | # Notes 2 | 3 | ## 📖 Basic 4 | 5 | 1. [알고리즘 기초](./Basic) 6 | 7 | ## 📖 Data Structure 8 | 9 | 1. [자료구조(Data Structure)](./DataStructure) 10 | 2. [배열(Array)과 연결 리스트(Linked List)](./DataStructure/Array+LinkedList.md) 11 | 3. [스택(Stack)과 큐(Queue) 그리고 덱(Deque)](./DataStructure/Stack+Queue.md) 12 | 4. [트라이(Trie)](./DataStructure/Trie.md) 13 | 14 | ## 📖 Graph 15 | 16 | 1. [그래프(Graph)](./Graph/Graph.md) 17 | 2. [서로소 집합(Disjoint Set)과 Union-Find 알고리즘](./Graph/DisjointSet.md) 18 | 3. [DAG(Directed Acyclic Graph)와 위상정렬(Topological Sort)](./Graph/TopologicalSort.md) 19 | 20 | ## 📖 Sort 21 | 22 | 1. [퀵정렬(QuickSort)](./Sort/QuickSort) -------------------------------------------------------------------------------- /src/Array/CyclicRotation/README.md: -------------------------------------------------------------------------------- 1 | ## [Codility - Lesson 2 Arrays] CyclicRotation 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/101764242-2d9ba000-3b23-11eb-836c-a492b77fdc20.png) 4 | 5 | ### Scoring 과정 6 | 7 | 1. 75% (8 min) : `A.length` < `K` 인 경우를 처리하지 못했음 8 | 2. 87% (2 min) : 1의 경우를 해결하기 위해 `K %= A.length` 연산을 추가하였고, 이 때 `A.length`가 0인 경우를 처리하지 못했음 9 | 3. 100% (2 min) 10 | -------------------------------------------------------------------------------- /src/Array/FrogRiverOne/README.md: -------------------------------------------------------------------------------- 1 | ## [Codility - Lesson 4 Counting Elements] FrogRiverOne 2 | 3 | > Detected time complexity : **O(N)** 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/103459726-86420f80-4d54-11eb-9e07-a5f901f71c04.png) 6 | ![image](https://user-images.githubusercontent.com/22045163/103459780-ce613200-4d54-11eb-9505-ffec8ef16489.png) 7 | -------------------------------------------------------------------------------- /src/Array/MaxCounters/README.md: -------------------------------------------------------------------------------- 1 | ## [Codility - Lesson 4 Counting Elements] MaxCounters 2 | 3 | > Detected time complexity : **O(N + M)** 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/106290129-76ebae80-628d-11eb-896e-5b89ec292cd4.png) 6 | -------------------------------------------------------------------------------- /src/Array/MissingInteger/Main.java: -------------------------------------------------------------------------------- 1 | package Array.MissingInteger; 2 | 3 | public class Main { 4 | public static void main(String[] args) { 5 | Solution sol = new Solution(); 6 | System.out.println(sol.solution(new int[]{1, 2, 3})); 7 | } 8 | } 9 | 10 | class Solution { 11 | 12 | static boolean[] check = new boolean[1000001]; 13 | 14 | public int solution(int[] A) { 15 | for (int value : A) { 16 | if (value > 0) check[value] = true; 17 | } 18 | int ans = 1; 19 | while (check[ans]) ans ++; 20 | return ans; 21 | } 22 | } -------------------------------------------------------------------------------- /src/Array/MissingInteger/README.md: -------------------------------------------------------------------------------- 1 | ## [Codility - Lesson 4 Counting Elements] MissingInteger 2 | 3 | > Detected time complexity : **O(N) or O(N * log(N))** 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/104467349-9205bf80-55f9-11eb-9944-5a0ce4077b19.png) 6 | -------------------------------------------------------------------------------- /src/Array/OddOccurrencesInArray/Main.java: -------------------------------------------------------------------------------- 1 | package Array.OddOccurrencesInArray; 2 | 3 | import java.util.*; 4 | 5 | public class Main { 6 | 7 | public static void main(String[] args) { 8 | Solution s = new Solution(); 9 | System.out.println(s.solution(new int[]{9, 3, 9, 3, 9, 7, 9})); 10 | } 11 | } 12 | 13 | class Solution { 14 | 15 | public int solution(int[] A) { 16 | HashSet set = new HashSet<>(); 17 | for (int a : A) { 18 | if (set.contains(a)) set.remove(a); 19 | else set.add(a); 20 | } 21 | return (int) set.toArray()[0]; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Array/OddOccurrencesInArray/README.md: -------------------------------------------------------------------------------- 1 | ## [Codility - Lesson 2 Arrays] OddOccurrencesInArray 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/101767118-224a7380-3b27-11eb-9a99-4f33c176d075.png) 4 | 5 | ### 다른 풀이 - XOR 6 | 7 | 다른 풀이를 보니 XOR 연산을 통해 풀 수 있는 문제이기도 하다. 8 | 9 | > XOR 연산은 입력값이 같지 않으면 1을 반환한다. 10 | > 11 | > - 0 XOR 0 = 0 12 | > - 0 XOR 1 = 1 13 | > - 1 XOR 0 = 1 14 | > - 1 XOR 1 = 0 15 | 16 | 따라서 다음과 같이 생각해 볼 수 있다. 17 | 18 | - `A == B` : A ^ B = 0 19 | - `A == B != C` : A ^ B ^ C = C 20 | 21 | 이를 코드로 옮기면 다음과 같다. 22 | 23 | ```java 24 | int ans = A[0]; 25 | for (int i = 1; i < A.length; i++) { 26 | ans = ans ^ A[i]; 27 | } 28 | ``` 29 | -------------------------------------------------------------------------------- /src/Array/P20299/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-20299] 3대 측정 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/107446292-77cfea80-6b81-11eb-80ff-34ec506884f0.png) 4 | 5 | ### 자료구조에 담지 말고 StringBuilder를 이용할 것 6 | 7 | `x1`, `x2`, `x3` 정보를 특정 자료 구조에 담기엔 N의 크기가 매우 크기 때문에 성능상 적절하지 않다. 8 | 9 | ![image](https://user-images.githubusercontent.com/22045163/107446329-8cac7e00-6b81-11eb-97b1-f6c790620fbc.png) 10 | -------------------------------------------------------------------------------- /src/Array/P20299/input.txt: -------------------------------------------------------------------------------- 1 | 5 5000 1600 2 | 1621 1928 1809 3 | 2300 2300 1499 4 | 1805 1211 1699 5 | 1600 1700 1800 6 | 1792 1617 1830 -------------------------------------------------------------------------------- /src/Array/PermCheck/README.md: -------------------------------------------------------------------------------- 1 | ## [Codility - Lesson 4 Counting Elements] PermCheck 2 | 3 | > Detected time complexity : **O(N) or O(N * log(N))** 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/104466321-6fbf7200-55f8-11eb-87f8-949a7dd4f0c1.png) 6 | -------------------------------------------------------------------------------- /src/Array/swea1208/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 1208] Flatten 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/106551211-13e16c80-6558-11eb-82df-8e4a4bbaf93f.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/106551255-383d4900-6558-11eb-8fa0-61bec85061e0.png) 5 | ![image](https://user-images.githubusercontent.com/22045163/106551275-425f4780-6558-11eb-8f46-962bc416c5c8.png) 6 | ![image](https://user-images.githubusercontent.com/22045163/106551334-586d0800-6558-11eb-8076-809bc53c28e3.png) 7 | -------------------------------------------------------------------------------- /src/Array/swea1210/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 1210] Ladder1 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/106583093-0a6ff880-6588-11eb-895a-7be1ca14d594.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/106583132-16f45100-6588-11eb-8748-657fca76c9a7.png) 5 | ![image](https://user-images.githubusercontent.com/22045163/106583202-2ecbd500-6588-11eb-97ec-dac365f31d43.png) 6 | ![image](https://user-images.githubusercontent.com/22045163/106583230-38553d00-6588-11eb-945c-2405bef60d3b.png) 7 | ![image](https://user-images.githubusercontent.com/22045163/106583404-689cdb80-6588-11eb-8e10-52acbd864987.png) 8 | -------------------------------------------------------------------------------- /src/Array/swea1210/output.txt: -------------------------------------------------------------------------------- 1 | #1 67 2 | #2 45 3 | #3 39 4 | #4 24 5 | #5 91 6 | #6 93 7 | #7 90 8 | #8 4 9 | #9 99 10 | #10 35 11 | 12 | // sample test 13 | 1 14 | 1 0 0 0 1 0 1 0 0 1 15 | 1 0 0 0 1 0 1 1 1 1 16 | 1 0 0 0 1 0 1 0 0 1 17 | 1 0 0 0 1 1 1 0 0 1 18 | 1 0 0 0 1 0 1 0 0 1 19 | 1 1 1 1 1 0 1 1 1 1 20 | 1 0 0 0 1 0 1 0 0 1 21 | 1 1 1 1 1 0 1 0 0 1 22 | 1 0 0 0 1 1 1 0 0 1 23 | 1 0 0 0 1 0 1 0 0 2 -------------------------------------------------------------------------------- /src/Array/swea1954/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 1954] 달팽이 숫자 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/106583980-02648880-6589-11eb-9638-e0250d586d3e.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/106584090-22944780-6589-11eb-9de2-97f484931762.png) 5 | ![image](https://user-images.githubusercontent.com/22045163/106584206-45bef700-6589-11eb-8001-a2d9bda538c8.png) 6 | -------------------------------------------------------------------------------- /src/Array/swea1954/input.txt: -------------------------------------------------------------------------------- 1 | 10 2 | 1 3 | 2 4 | 3 5 | 4 6 | 5 7 | 6 8 | 7 9 | 8 10 | 9 11 | 10 -------------------------------------------------------------------------------- /src/Array/swea2001/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 2001] 파리 퇴치 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/106764102-d295ad80-667a-11eb-8c5e-cc8b62117da7.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/106764161-df1a0600-667a-11eb-928f-9efe57d0e70e.png) 5 | ![image](https://user-images.githubusercontent.com/22045163/106764270-fb1da780-667a-11eb-85cd-a84058cb76cf.png) 6 | -------------------------------------------------------------------------------- /src/Array/swea2001/output.txt: -------------------------------------------------------------------------------- 1 | #1 49 2 | #2 159 3 | #3 428 4 | #4 620 5 | #5 479 6 | #6 941 7 | #7 171 8 | #8 968 9 | #9 209 10 | #10 1242 11 | -------------------------------------------------------------------------------- /src/Array/swea2805/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 2805] 농작물 수확하기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/106721709-5da98000-6648-11eb-8c12-73ecf5c86b6b.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/106721740-68fcab80-6648-11eb-8db1-516b26ea7b9b.png) 5 | ![image](https://user-images.githubusercontent.com/22045163/106721870-99444a00-6648-11eb-9e30-664d30614248.png) 6 | -------------------------------------------------------------------------------- /src/BFS/P1039/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1039] 교환 2 | 3 | 어우 그리마 이 문제 일주일만에 풀었다야. 늘 정말 늘 !! 생각하지만, 혼자서 희한한 알고리즘 구상하지 말고 경우의 수는 모든 경우를 탐색하여라. 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/92713092-837e7180-f395-11ea-9659-f157577f4d1b.png) 6 | -------------------------------------------------------------------------------- /src/BFS/P1039/input.txt: -------------------------------------------------------------------------------- 1 | 132 3 -------------------------------------------------------------------------------- /src/BFS/P1194/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1194] 달이 차오른다, 가자. 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/115640740-9fe28380-a352-11eb-8022-01b9e49bc6a6.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/115640765-aa048200-a352-11eb-80d5-3f3ef526915e.png) 6 | -------------------------------------------------------------------------------- /src/BFS/P1194/input.txt: -------------------------------------------------------------------------------- 1 | 7 8 2 | a#c#eF.1 3 | .#.#.#.. 4 | .#B#D### 5 | 0....F.1 6 | C#E#A### 7 | .#.#.#.. 8 | d#f#bF.1 -------------------------------------------------------------------------------- /src/BFS/P13460/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-13460] 구슬 탈출 2 2 | 3 | 맞았습니다!의 쾌감....💚 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/92930760-763cb200-f47d-11ea-8b43-54f788df9f6e.png) 6 | -------------------------------------------------------------------------------- /src/BFS/P13460/input.txt: -------------------------------------------------------------------------------- 1 | 10 10 2 | ########## 3 | #.BR.....# 4 | #.#####..# 5 | #.#...#..# 6 | #.#.#.O..# 7 | #.#.#....# 8 | #.#....#.# 9 | #.#..#...# 10 | #.#......# 11 | ########## -------------------------------------------------------------------------------- /src/BFS/P13549/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-13549] 숨바꼭질 3 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/101243817-1127ee00-3746-11eb-8834-9f0d8f536ec0.png) 4 | 5 | BFS 문제임을 판단한 후, `정확하게 조건 파악하기` & `메모리 초과 신경 쓰기` 로 문제를 풀어나가면 되겠다. 6 | -------------------------------------------------------------------------------- /src/BFS/P14226/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-14226] 이모티콘 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/101236473-dce80980-3714-11eb-9b64-dde07af86818.png) 4 | 5 | 1. BFS로 풀 수 있는 문제임을 깨닫기 6 | 2. 문제 조건을 잘 파악하고 정확히 조건 구현하기 7 | 3. BFS에서 주의해야 하는 메모리 초과 문제 기억하기 !! 8 | -------------------------------------------------------------------------------- /src/BFS/P14502/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-14502] 연구소 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/93325862-ecad2b80-f852-11ea-8f18-bea014abe9fd.png) 4 | 5 | ### 2021.03.26 6 | 7 | - [210326.java](Main2.java) 8 | 9 | 6개월의 성능 차이 ..!!! 10 | 11 | ![image](https://user-images.githubusercontent.com/22045163/112578864-2336b500-8e39-11eb-8f91-f32b14c83645.png) 12 | -------------------------------------------------------------------------------- /src/BFS/P14502/input.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 2 0 0 0 0 0 0 2 3 | 2 0 0 0 0 0 0 2 4 | 2 0 0 0 0 0 0 2 5 | 2 0 0 0 0 0 0 2 6 | 2 0 0 0 0 0 0 2 7 | 0 0 0 0 0 0 0 0 8 | 0 0 0 0 0 0 0 0 9 | 0 0 0 0 0 0 0 0 -------------------------------------------------------------------------------- /src/BFS/P1525/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1525] 퍼즐 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/93355349-edf14f00-f878-11ea-9de4-8f0d9e596d4f.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/93355434-06fa0000-f879-11ea-94d4-90f9cc8745a9.png) 5 | -------------------------------------------------------------------------------- /src/BFS/P1525/input.txt: -------------------------------------------------------------------------------- 1 | 2 5 7 2 | 8 0 3 3 | 4 1 6 4 | 5 | // 18 -------------------------------------------------------------------------------- /src/BFS/P1600/input.txt: -------------------------------------------------------------------------------- 1 | 1 2 | 4 4 3 | 0 0 0 0 4 | 1 0 0 0 5 | 0 0 1 0 6 | 0 1 0 0 7 | 8 | 3 9 | 4 5 10 | 0 1 1 1 11 | 1 1 0 1 12 | 1 1 1 1 13 | 1 1 1 0 14 | 1 1 1 0 15 | //3 16 | 17 | 1 18 | 4 4 19 | 0 0 0 0 20 | 1 0 0 0 21 | 0 0 1 1 22 | 0 1 0 0 23 | //4 24 | 25 | 1 26 | 5 5 27 | 0 0 0 0 0 28 | 0 0 0 0 0 29 | 0 0 0 0 0 30 | 0 0 0 1 1 31 | 0 0 0 1 0 32 | //6 33 | -------------------------------------------------------------------------------- /src/BFS/P16236/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-16236] 아기 상어 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/93317269-3b08fd00-f848-11ea-8c37-5f8b921d34b6.png) 4 | 5 | ### 2021.03.17 (6달의 성능 차이 ~) 6 | 7 | - [210317.java](Main2.java) 8 | 9 | ![image](https://user-images.githubusercontent.com/22045163/111414242-f987da80-8722-11eb-973c-d3074f58e62a.png) 10 | -------------------------------------------------------------------------------- /src/BFS/P16236/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 4 3 2 1 3 | 0 0 0 0 4 | 0 0 9 0 5 | 1 2 3 4 -------------------------------------------------------------------------------- /src/BFS/P1697/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1697] 숨바꼭질 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/96842537-2099f300-1488-11eb-8984-a9dfdeed1610.png) 4 | 5 | ### 메모리 초과 이슈 6 | 7 | 처음에 `visited` 배열을 두지 않고 풀었을 때 메모리 초과가 났다. 8 | 9 | `visited` 배열을 두지 않으면, 이미 갔던 좌표에 대해서도 계속 큐에 넣게 되기 때문에 메모리 초과 이슈가 발생할 수 있다. 기억해두기 !! 10 | 11 | -------------------------------------------------------------------------------- /src/BFS/P1697/input.txt: -------------------------------------------------------------------------------- 1 | 5 17 -------------------------------------------------------------------------------- /src/BFS/P1743/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1743] 음식물 피하기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/126355303-455a657e-12e5-4dd0-91fe-6516cbe88a9d.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/126355333-f39e0196-5600-4eae-a681-954d3fe5bf67.png) 6 | -------------------------------------------------------------------------------- /src/BFS/P1743/input.txt: -------------------------------------------------------------------------------- 1 | 3 4 5 2 | 3 2 3 | 2 2 4 | 3 1 5 | 2 3 6 | 1 1 -------------------------------------------------------------------------------- /src/BFS/P1938/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1938] 통나무 옮기기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/110050117-94cd9700-7d96-11eb-9c90-ab73c8cd29e1.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/110050138-a2831c80-7d96-11eb-803b-3e351f2d6560.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/110050165-b3cc2900-7d96-11eb-85b4-334c9fdbbf0d.png) 7 | -------------------------------------------------------------------------------- /src/BFS/P1939/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1939] 중량제한 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/129474818-b9d36119-ecaf-4564-82cd-1e4360654130.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/129474824-8f49f53e-0668-4ccb-9e9a-bf229afa5a7b.png) 6 | -------------------------------------------------------------------------------- /src/BFS/P1939/input.txt: -------------------------------------------------------------------------------- 1 | 9 9 2 | 1 4 11 3 | 1 5 2 4 | 4 5 4 5 | 4 3 10 6 | 4 2 7 7 | 5 2 10 8 | 5 6 13 9 | 3 2 9 10 | 2 6 8 11 | 1 6 12 | // 9 13 | 14 | 3 3 15 | 1 2 2 16 | 3 1 3 17 | 2 3 2 18 | 1 3 -------------------------------------------------------------------------------- /src/BFS/P20304/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-20304] 비밀번호 제작 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/107463226-fdaf5e00-6ba0-11eb-8a85-37e20120510c.png) 4 | 5 | N, M의 크기가 매우 크므로 한 배열 내에서 비트 연산 및 BFS를 통해 풀어야 한다. 6 | 7 | ![image](https://user-images.githubusercontent.com/22045163/107463276-0f910100-6ba1-11eb-8b17-848fd9b218b1.png) 8 | -------------------------------------------------------------------------------- /src/BFS/P20304/input.txt: -------------------------------------------------------------------------------- 1 | 10 2 | 2 3 | 4 3 -------------------------------------------------------------------------------- /src/BFS/P2178/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2178] 미로 탐색 2 | 3 | ### 처음에 메모리 초과가 났다. 4 | 5 | BFS 방문 표시는 큐에서 뺄 때가 아닌 넣을 때 해야 중복 방문이 일어나지 않습니다. 6 | BFS에서 많은 사람들이 하는 실수입니다. 7 | BFS 문제에서 메모리 초과가 나면 대부분은 이것 때문이라고 볼 수 있습니다. 8 | 9 | ![image](https://user-images.githubusercontent.com/22045163/93305485-8a93fc80-f839-11ea-83ea-6d62f870a772.png) 10 | -------------------------------------------------------------------------------- /src/BFS/P2178/input.txt: -------------------------------------------------------------------------------- 1 | 4 6 2 | 110110 3 | 110110 4 | 111111 5 | 111101 -------------------------------------------------------------------------------- /src/BFS/P2206/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2206] 벽 부수고 이동하기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/112110431-3a399500-8bf6-11eb-816c-413bd9e74978.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/112110467-44f42a00-8bf6-11eb-9a9a-d189d0873534.png) 6 | -------------------------------------------------------------------------------- /src/BFS/P2206/input.txt: -------------------------------------------------------------------------------- 1 | 6 4 2 | 0100 3 | 1110 4 | 1000 5 | 0000 6 | 0111 7 | 0000 -------------------------------------------------------------------------------- /src/BFS/P3055/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-3055] 탈출 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/91595818-1b945800-e99f-11ea-8aed-a5c3a5738b03.png) 4 | -------------------------------------------------------------------------------- /src/BFS/P7576/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-7576] 토마토 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/96839353-052ce900-1484-11eb-845f-d76c0d11a9a3.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/114639163-21f5fb00-9d08-11eb-8a09-a236fd327ad9.png) 6 | 7 | ### 2021.04.14 8 | 9 | - [210414.java](Main2.java) 10 | ![image](https://user-images.githubusercontent.com/22045163/114639207-30441700-9d08-11eb-8c48-3f8ea4595757.png) 11 | -------------------------------------------------------------------------------- /src/BFS/P7576/input.txt: -------------------------------------------------------------------------------- 1 | 5 5 2 | -1 1 0 0 0 3 | 0 -1 -1 -1 0 4 | 0 -1 -1 -1 0 5 | 0 -1 -1 -1 0 6 | 0 0 0 0 0 -------------------------------------------------------------------------------- /src/BFS/swea10966/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 10966] 물놀이를 가자 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/111078581-87a06d00-8539-11eb-9580-d79a2f898fed.png) 4 | 5 | ### BFS에 대하여 한 가지를 더 기억해두자 !!! 6 | 7 | 어떤 점에서의 최단 경로를 찾을 때 많이 쓰이는 BFS가 가지고 있는 좋은 점은 **여러 점에서 동시에 출발할 수 있다**는 점이다. 이는 DFS는 적용할 수 없는 BFS만의 장점이다. 위 문제는 이러한 BFS의 특징을 기억하지 않으면 시간 초과를 겪을 수 있다. 특히 방문 체크 대신, **지금까지 지나온 거리를 배열에 저장**하여 훨씬 효율적으로 답을 구할 수 있는 문제이다. 꼭 기억해두자. 8 | 9 | ![image](https://user-images.githubusercontent.com/22045163/111078663-009fc480-853a-11eb-984f-1aecf99b58a1.png) 10 | -------------------------------------------------------------------------------- /src/BFS/swea10966/sample_input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 2 3 3 | WLL 4 | LLL 5 | 3 2 6 | WL 7 | LL 8 | LW 9 | 4 5 10 | LLLWW 11 | WWLLL 12 | LLLWL 13 | LWLLL -------------------------------------------------------------------------------- /src/BFS/swea10966/sample_output.txt: -------------------------------------------------------------------------------- 1 | #1 9 2 | #2 4 3 | #3 15 -------------------------------------------------------------------------------- /src/BFS/swea1238/output.txt: -------------------------------------------------------------------------------- 1 | #1 17 2 | #2 96 3 | #3 49 4 | #4 39 5 | #5 49 6 | #6 1 7 | #7 28 8 | #8 45 9 | #9 59 10 | #10 64 11 | -------------------------------------------------------------------------------- /src/BFS/swea1249/output.txt: -------------------------------------------------------------------------------- 1 | #1 2 2 | #2 2 3 | #3 8 4 | #4 57 5 | #5 151 6 | #6 257 7 | #7 18 8 | #8 160 9 | #9 414 10 | #10 395 11 | -------------------------------------------------------------------------------- /src/BFS/swea1953/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 1953] 탈주범 검거 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/110758069-6e749380-828f-11eb-8a01-90aa48f80a45.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/110758109-7a605580-828f-11eb-9049-796a621ffac6.png) 5 | ![image](https://user-images.githubusercontent.com/22045163/110758158-86e4ae00-828f-11eb-8e21-1be982dd2edc.png) 6 | ![image](https://user-images.githubusercontent.com/22045163/110758222-9cf26e80-828f-11eb-8eaf-61474f106628.png) 7 | 8 | ![image](https://user-images.githubusercontent.com/22045163/110758257-a976c700-828f-11eb-9181-5c333650d00c.png) 9 | -------------------------------------------------------------------------------- /src/BFS/swea1953/sample_output.txt: -------------------------------------------------------------------------------- 1 | #1 5 2 | #2 15 3 | #3 29 4 | #4 67 5 | #5 71 -------------------------------------------------------------------------------- /src/BruteForce/P14889/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-14889] 스타트와 링크 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/107963418-7cfec080-6feb-11eb-9bee-fd59e8aca41e.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/107963481-943dae00-6feb-11eb-8afc-6a0914915b71.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/107963511-9dc71600-6feb-11eb-91f3-5a20c2de140f.png) 7 | -------------------------------------------------------------------------------- /src/BruteForce/P14889/input.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 0 1 2 3 4 5 3 | 1 0 2 3 4 5 4 | 1 2 0 3 4 5 5 | 1 2 3 0 4 5 6 | 1 2 3 4 0 5 7 | 1 2 3 4 5 0 -------------------------------------------------------------------------------- /src/BruteForce/P16637/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-16637] 괄호 추가하기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/107970177-1fbb3d00-6ff4-11eb-80a3-cef494a5f380.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/107970208-2ba6ff00-6ff4-11eb-8cc5-65f9f6bd774c.png) 6 | -------------------------------------------------------------------------------- /src/BruteForce/P16637/input.txt: -------------------------------------------------------------------------------- 1 | 19 2 | 1-9-1-9-1-9-1-9-1-9 -------------------------------------------------------------------------------- /src/BruteForce/P17136/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-17136] 색종이 붙이기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/108603810-65f60f00-73ed-11eb-8566-692104288bb2.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/108603831-7b6b3900-73ed-11eb-8a8d-5cde017f5281.png) 6 | -------------------------------------------------------------------------------- /src/BruteForce/P17136/input.txt: -------------------------------------------------------------------------------- 1 | 0 0 0 0 0 0 0 0 0 0 2 | 0 1 1 0 0 0 0 0 0 0 3 | 0 0 1 0 0 0 0 0 0 0 4 | 0 0 0 0 1 1 0 0 0 0 5 | 0 0 0 0 0 1 0 0 0 0 6 | 0 0 0 0 0 0 0 0 0 0 7 | 0 0 1 0 0 0 0 0 0 0 8 | 0 0 0 0 0 0 0 0 0 0 9 | 0 0 0 0 0 0 0 0 0 0 10 | 0 0 0 0 0 0 0 0 0 0 -------------------------------------------------------------------------------- /src/BruteForce/P17471/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-17471] 게리맨더링 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/112151635-ce225580-8c24-11eb-993b-c44a3ff4534d.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/112151680-d8dcea80-8c24-11eb-94aa-113efdb5fc84.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/112151740-e72b0680-8c24-11eb-8e6c-7b4bf2606363.png) 7 | -------------------------------------------------------------------------------- /src/BruteForce/P17471/input.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 2 2 2 2 2 2 3 | 1 3 4 | 1 4 5 | 1 1 6 | 1 2 7 | 1 6 8 | 1 5 9 | //-1 10 | 11 | 12 | 6 13 | 5 2 3 4 1 2 14 | 2 2 4 15 | 4 1 3 6 5 16 | 2 4 2 17 | 2 1 3 18 | 1 2 19 | 1 2 -------------------------------------------------------------------------------- /src/BruteForce/P2468/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2468] 안전 영역 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/110245310-e9932c80-7fa5-11eb-8844-0ec14f2f6e30.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/110245336-fd3e9300-7fa5-11eb-9211-0b9e4da07ae4.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/110245361-0def0900-7fa6-11eb-8108-52d6ed66cb64.png) 7 | -------------------------------------------------------------------------------- /src/BruteForce/P2468/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 1 1 1 1 1 3 | 1 1 1 1 1 4 | 1 1 1 1 1 5 | 1 1 1 1 1 6 | 1 1 1 1 1 -------------------------------------------------------------------------------- /src/BruteForce/P2961/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2961] 도영이가 만든 맛있는 음식 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/107924311-18753e80-6fb6-11eb-9205-f5b1992785a5.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/107924349-21fea680-6fb6-11eb-92b7-2e2e8532a3d5.png) 6 | -------------------------------------------------------------------------------- /src/BruteForce/P2961/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 1 7 3 | 2 6 4 | 3 8 5 | 4 9 -------------------------------------------------------------------------------- /src/BruteForce/P3040/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-3040] 백설 공주와 일곱 난쟁이 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/107954886-656e0a80-6fe0-11eb-8204-e4e24320f9f4.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/107954897-6d2daf00-6fe0-11eb-9c1d-af0e6a7c671e.png) 6 | -------------------------------------------------------------------------------- /src/BruteForce/P3040/input.txt: -------------------------------------------------------------------------------- 1 | 8 2 | 6 3 | 5 4 | 1 5 | 37 6 | 30 7 | 28 8 | 22 9 | 36 -------------------------------------------------------------------------------- /src/BruteForce/prg42842/README.md: -------------------------------------------------------------------------------- 1 | ## [programmers - 완전탐색] 카펫 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/104201273-e891c300-546c-11eb-83ba-3815c8ac36de.png) 4 | -------------------------------------------------------------------------------- /src/BruteForce/swea1247/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 1247] 최적 경로 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/108326561-bca4f280-720d-11eb-98af-2da95f3c42b3.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/108326630-cd556880-720d-11eb-9e73-146f69667ff1.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/108326410-8bc4bd80-720d-11eb-9144-75cce182cc4e.png) 7 | -------------------------------------------------------------------------------- /src/BruteForce/swea1247/output.txt: -------------------------------------------------------------------------------- 1 | #1 200 2 | #2 304 3 | #3 265 4 | #4 307 5 | #5 306 6 | #6 366 7 | #7 256 8 | #8 399 9 | #9 343 10 | #10 391 11 | -------------------------------------------------------------------------------- /src/BruteForce/swea3234/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 3234] 준환이의 양팔저울 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/108479990-c005b000-72d9-11eb-9c0f-44025d841b83.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/108480038-cc8a0880-72d9-11eb-83b4-2bbb913e1320.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/108480179-f6dbc600-72d9-11eb-8f47-dbf7d45c96b8.png) 7 | -------------------------------------------------------------------------------- /src/BruteForce/swea3234/sample_input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 3 3 | 1 2 4 4 | 3 5 | 1 2 3 6 | 9 7 | 1 2 3 5 6 4 7 8 9 -------------------------------------------------------------------------------- /src/BruteForce/swea3234/sample_output.txt: -------------------------------------------------------------------------------- 1 | #1 15 2 | #2 17 3 | #3 35583723 -------------------------------------------------------------------------------- /src/BruteForce/swea4012/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 4012] 요리사 2 | 3 | > 비슷한 문제 : [boj-14889 스타트와 링크](../P14889) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/108457351-d9950080-72b5-11eb-9e08-c05b1b5c8ad6.png) 6 | ![image](https://user-images.githubusercontent.com/22045163/108457388-e7e31c80-72b5-11eb-834d-26eb7d7fd50b.png) 7 | ![image](https://user-images.githubusercontent.com/22045163/108457418-f3364800-72b5-11eb-9d6e-f75469e8d5ad.png) 8 | 9 | ![image](https://user-images.githubusercontent.com/22045163/108457308-bd915f00-72b5-11eb-8fb0-28c85e6702cc.png) 10 | -------------------------------------------------------------------------------- /src/BruteForce/swea4012/sample_output.txt: -------------------------------------------------------------------------------- 1 | #1 2 2 | #2 1 3 | #3 38 4 | #4 15 5 | #5 4 6 | #6 0 7 | #7 51 8 | #8 23 9 | #9 13 10 | #10 11 11 | -------------------------------------------------------------------------------- /src/Combination/P1007/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1007] 벡터 매칭 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/126060439-9ea33f8d-8bce-41ae-bdd6-7e3c0bb2d8db.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/126060448-d14a646f-47db-4a94-adf7-44ecbffae0c2.png) 6 | -------------------------------------------------------------------------------- /src/Combination/P1007/input.txt: -------------------------------------------------------------------------------- 1 | 2 2 | 4 3 | 5 5 4 | 5 -5 5 | -5 5 6 | -5 -5 7 | 2 8 | -100000 -100000 9 | 100000 100000 -------------------------------------------------------------------------------- /src/Combination/P1010/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 2 2 3 | 1 5 4 | 13 29 -------------------------------------------------------------------------------- /src/Combination/P1256/README.md: -------------------------------------------------------------------------------- 1 | 2 | 🚩 다음 코드 간결화 시키기 (계산한 숫자가 10억이 넘어가면 10억으로 치환해주는 코드) 3 | 10억 : `1e9`로 표현할 수 있다. 4 | 5 | ```java 6 | long result = combis[i-1][j-1] + combis[i-1][j]; 7 | if (result > MAX) 8 | combis[i][j] = MAX; 9 | else 10 | combis[i][j] = (int) result; 11 | ``` 12 | 13 | ```java 14 | combis[i][j] = Math.min(combis[i-1][j-1] + combis[i-1][j], (int) 1e9); 15 | ``` 16 | -------------------------------------------------------------------------------- /src/Combination/P1256/input.txt: -------------------------------------------------------------------------------- 1 | 2 3 7 -------------------------------------------------------------------------------- /src/Combination/P2798/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2798] 블랙잭 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/109193318-94a02b00-77db-11eb-85cc-98b89ccde266.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/109193352-9e299300-77db-11eb-8622-589a3cb7a452.png) 6 | -------------------------------------------------------------------------------- /src/Combination/P2798/input.txt: -------------------------------------------------------------------------------- 1 | 10 500 2 | 93 181 245 214 315 36 185 138 216 295 -------------------------------------------------------------------------------- /src/Combination/swea9229/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 9229] 한빈이와 Spot Mart 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/107225432-1f52fd00-6a5c-11eb-9491-7612b48f84f3.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/107225475-2da11900-6a5c-11eb-82a3-2cdb48a38367.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/107225786-97212780-6a5c-11eb-80b2-f837f12305a2.png) 7 | -------------------------------------------------------------------------------- /src/Combination/swea9229/sample_input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 3 45 3 | 20 20 20 4 | 6 10 5 | 1 2 5 8 9 11 6 | 4 100 7 | 80 80 60 60 8 | 4 20 9 | 10 5 10 16 10 | -------------------------------------------------------------------------------- /src/Combination/swea9229/sample_output.txt: -------------------------------------------------------------------------------- 1 | #1 40 2 | #2 10 3 | #3 -1 4 | #4 20 5 | -------------------------------------------------------------------------------- /src/DAC/P1074/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1074] Z 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/108591215-e2b3c980-73aa-11eb-8e0b-f920fb4f0436.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/108591222-ed6e5e80-73aa-11eb-982c-ff2131202dd5.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/108591229-f8c18a00-73aa-11eb-9b63-b9efe8d7f40e.png) 7 | -------------------------------------------------------------------------------- /src/DAC/P1074/input.txt: -------------------------------------------------------------------------------- 1 | 2 3 1 -------------------------------------------------------------------------------- /src/DAC/P10830/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-10830] 행렬 제곱 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/132988187-b7ac0aa0-4046-4a90-95c1-f6f42d90d1fc.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/132988197-fde9433e-1170-4fc5-824b-bf7769f9b3de.png) 6 | -------------------------------------------------------------------------------- /src/DAC/P10830/input.txt: -------------------------------------------------------------------------------- 1 | 5 10 2 | 1 0 0 0 1 3 | 1 0 0 0 1 4 | 1 0 0 0 1 5 | 1 0 0 0 1 6 | 1 0 0 0 1 -------------------------------------------------------------------------------- /src/DAC/P1992/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1992] 쿼드트리 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/108593933-0fbba880-73ba-11eb-9e73-983876d94085.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/108593938-1b0ed400-73ba-11eb-86cc-fc336de61ae6.png) 6 | -------------------------------------------------------------------------------- /src/DAC/P1992/input.txt: -------------------------------------------------------------------------------- 1 | 8 2 | 11110000 3 | 11110000 4 | 00011100 5 | 00011100 6 | 11110000 7 | 11110000 8 | 11110011 9 | 11110011 10 | 11 | 00000000 12 | 00000000 13 | 00001111 14 | 00001111 15 | 00011111 16 | 00111111 17 | 00111111 18 | 00111111 19 | -------------------------------------------------------------------------------- /src/DFS/P1062/input.txt: -------------------------------------------------------------------------------- 1 | 3 6 2 | antarctica 3 | antahellotica 4 | antacartica -------------------------------------------------------------------------------- /src/DFS/P10971/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-10971] 외판원 순회 2 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/94675648-040d0e00-0355-11eb-8ae9-ac6673464fa5.png) 4 | -------------------------------------------------------------------------------- /src/DFS/P10971/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 0 10 15 20 3 | 5 0 9 10 4 | 6 13 0 12 5 | 8 8 9 0 -------------------------------------------------------------------------------- /src/DFS/P1103/input.txt: -------------------------------------------------------------------------------- 1 | 3 7 2 | 3942178 3 | 1234567 4 | 9123532 -------------------------------------------------------------------------------- /src/DFS/P13023/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-13023] ABCDE 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/97014663-9a63d680-1585-11eb-8ffd-be4945e093c0.png) 4 | 5 | ### 시간 초과 이슈 6 | 7 | 처음에 시간 초과가 났었다. 이 문제는 다음과 같이 코드를 고치니 해결되었다. 8 | 9 | ```java 10 | for (int i = 0; i < N; i++) { 11 | if (ans == 0) dfs(i, 1); 12 | } 13 | ``` 14 | 15 | 처음에는 `dfs`를 먼저 돌리고 count가 5가 되는 것을 찾았을 때 1을 출력하고 프로그램을 종료하도록 했었다. 16 | 그런데 이렇게 하지 않고 `dfs`를 돌리기 전, count가 5가 되는 것을 찾았다면 돌리지 않는 방식으로 조건문을 설정하니 시간 초과 문제가 해결되었다. 17 | -------------------------------------------------------------------------------- /src/DFS/P13023/input.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 1 7 3 | 3 7 4 | 4 7 5 | 3 4 6 | 4 6 7 | 3 5 8 | 0 4 9 | 2 7 -------------------------------------------------------------------------------- /src/DFS/P14500/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-14500] 테트로미노 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/94993435-ea293080-05cb-11eb-94b3-49b4b2a92ca9.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/94993442-fad9a680-05cb-11eb-9511-e858535a7185.png) 5 | -------------------------------------------------------------------------------- /src/DFS/P14500/input.txt: -------------------------------------------------------------------------------- 1 | 5 5 2 | 1 2 3 4 5 3 | 5 4 3 2 1 4 | 2 3 4 5 6 5 | 6 5 4 3 2 6 | 1 2 1 2 1 -------------------------------------------------------------------------------- /src/DFS/P14501/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-14501] 퇴사 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/94358322-1e3bb780-00db-11eb-8f01-a74ebe977126.png) 4 | -------------------------------------------------------------------------------- /src/DFS/P14501/input.txt: -------------------------------------------------------------------------------- 1 | 10 2 | 5 50 3 | 4 40 4 | 3 30 5 | 2 20 6 | 1 10 7 | 1 10 8 | 2 20 9 | 3 30 10 | 4 40 11 | 5 50 -------------------------------------------------------------------------------- /src/DFS/P14888/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-14888] 연산자 끼워넣기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/93988799-1e2e7580-fdc4-11ea-9c57-ba29d309a08a.png) 4 | -------------------------------------------------------------------------------- /src/DFS/P1520/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1520] 내리막 길 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/113481979-795dc500-94d7-11eb-896e-efd89d06e257.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/113481987-87134a80-94d7-11eb-8678-79e47519c0d3.png) 5 | 6 | DFS + DP 문제는 아직 미숙한 것 같다. 많이 더 많이 연습하자 !!! 7 | 8 | ![image](https://user-images.githubusercontent.com/22045163/113482007-985c5700-94d7-11eb-8242-92513491a896.png) 9 | -------------------------------------------------------------------------------- /src/DFS/P1520/input.txt: -------------------------------------------------------------------------------- 1 | 4 5 2 | 50 45 37 32 30 3 | 35 50 40 20 25 4 | 30 30 25 17 28 5 | 27 24 22 15 10 6 | 7 | 3 3 8 | 9 4 3 9 | 8 5 2 10 | 7 6 1 11 | // 6 12 | -------------------------------------------------------------------------------- /src/DFS/P15658/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-15658] 연산자 끼워넣기 (2) 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/94247356-f708ad00-ff57-11ea-8e85-dc5e856be0e6.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/94247386-01c34200-ff58-11ea-9521-114e42703429.png) 5 | -------------------------------------------------------------------------------- /src/DFS/P17070/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-17070] 파이프 옮기기 1 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/108448988-0fca8400-72a6-11eb-904c-c68a7abd4ffd.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/108449048-2a046200-72a6-11eb-8e37-722b785ab461.png) 5 | ![image](https://user-images.githubusercontent.com/22045163/108449069-338dca00-72a6-11eb-8e1c-a529106c9479.png) 6 | 7 | ![image](https://user-images.githubusercontent.com/22045163/108449098-40aab900-72a6-11eb-95a0-b6910f4dd8e0.png) 8 | -------------------------------------------------------------------------------- /src/DFS/P1759/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1759] 암호 만들기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/111273377-17980100-8677-11eb-93ed-d625d02dea82.png) 4 | 5 | ### 2021.03.16 - using Combination 6 | 7 | - [210316.java](Main2.java) 8 | 9 | ![image](https://user-images.githubusercontent.com/22045163/111273478-36969300-8677-11eb-9a15-c141111559fb.png) 10 | -------------------------------------------------------------------------------- /src/DFS/P1759/input.txt: -------------------------------------------------------------------------------- 1 | 4 6 2 | a t c i s w -------------------------------------------------------------------------------- /src/DFS/P1937/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1937] 욕심쟁이 판다 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/110246368-abe4d280-7faa-11eb-8327-0820485cf89a.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/110246375-b3a47700-7faa-11eb-94e4-85a026d0aff8.png) 6 | -------------------------------------------------------------------------------- /src/DFS/P1937/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 14 9 12 10 3 | 1 11 5 4 4 | 7 15 2 13 5 | 6 3 16 8 -------------------------------------------------------------------------------- /src/DFS/P1987/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1987] 알파벳 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/108330570-15c25580-7211-11eb-8be2-c4fee4e06cf6.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/108330608-22df4480-7211-11eb-9336-32e4fd4d72af.png) 6 | -------------------------------------------------------------------------------- /src/DFS/P1987/input.txt: -------------------------------------------------------------------------------- 1 | 2 4 2 | CATB 3 | BDCB -------------------------------------------------------------------------------- /src/DFS/P20164/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-20164] 홀수 홀릭 호석 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/125167014-48c5af80-e1d9-11eb-99d6-367d5af4668c.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/125167022-51b68100-e1d9-11eb-96aa-f70d15f4950f.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/125167030-64c95100-e1d9-11eb-83b0-ac911c150c33.png) 7 | -------------------------------------------------------------------------------- /src/DFS/P20164/input.txt: -------------------------------------------------------------------------------- 1 | 999999999 -------------------------------------------------------------------------------- /src/DFS/P2667/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2667] 단지번호붙이기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/96833690-d1e65c00-147b-11eb-96dc-e0d257eac3ef.png) 4 | -------------------------------------------------------------------------------- /src/DFS/P2667/input.txt: -------------------------------------------------------------------------------- 1 | 7 2 | 0110100 3 | 0110101 4 | 1110101 5 | 0000111 6 | 0100000 7 | 0111110 8 | 0111000 -------------------------------------------------------------------------------- /src/DFS/P3109/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-3109] 빵집 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/108316208-efe08500-71ff-11eb-8b66-d29e1e2b98dc.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/108316234-fc64dd80-71ff-11eb-931e-fc309352fffe.png) 6 | -------------------------------------------------------------------------------- /src/DFS/P4963/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-4963] 섬의 개수 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/96835296-5cc85600-147e-11eb-9061-ff95a69e7a34.png) 4 | -------------------------------------------------------------------------------- /src/DFS/P4963/input.txt: -------------------------------------------------------------------------------- 1 | 1 1 2 | 0 3 | 2 2 4 | 0 1 5 | 1 0 6 | 3 2 7 | 1 1 1 8 | 1 1 1 9 | 5 4 10 | 1 0 1 0 0 11 | 1 0 0 0 0 12 | 1 0 1 0 1 13 | 1 0 0 1 0 14 | 5 4 15 | 1 1 1 0 1 16 | 1 0 1 0 1 17 | 1 0 1 0 1 18 | 1 0 1 1 1 19 | 5 5 20 | 1 0 1 0 1 21 | 0 0 0 0 0 22 | 1 0 1 0 1 23 | 0 0 0 0 0 24 | 1 0 1 0 1 25 | 0 0 -------------------------------------------------------------------------------- /src/DFS/prg12952/README.md: -------------------------------------------------------------------------------- 1 | ## [programmers - Backtracking] N-Queen 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/120099101-98de3a80-c174-11eb-86d9-bfe4af4359e9.png) 4 | -------------------------------------------------------------------------------- /src/DFS/swea1949/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 1949] 등산로 조성 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/110740744-e5e9f900-8276-11eb-9698-db2de90ac333.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/110740776-f39f7e80-8276-11eb-8829-c8a5c5921272.png) 5 | ![image](https://user-images.githubusercontent.com/22045163/110740819-0023d700-8277-11eb-8601-feb94f1955df.png) 6 | ![image](https://user-images.githubusercontent.com/22045163/110740844-0914a880-8277-11eb-8feb-84fbb0ffe0e9.png) 7 | 8 | ![image](https://user-images.githubusercontent.com/22045163/110740880-16ca2e00-8277-11eb-9ec0-91a81842d6b7.png) 9 | -------------------------------------------------------------------------------- /src/DFS/swea1949/sample_output.txt: -------------------------------------------------------------------------------- 1 | #1 6 2 | #2 3 3 | #3 7 4 | #4 4 5 | #5 2 6 | #6 12 7 | #7 6 8 | #8 7 9 | #9 10 10 | #10 19 11 | -------------------------------------------------------------------------------- /src/DFS/swea2105/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 2105] 디저트 카페 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/109147298-3148d580-77a8-11eb-81a2-8649fe72c0ea.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/109147501-6c4b0900-77a8-11eb-801c-346348805f40.png) 5 | ![image](https://user-images.githubusercontent.com/22045163/109147563-7c62e880-77a8-11eb-872c-e20313b7cc23.png) 6 | ![image](https://user-images.githubusercontent.com/22045163/109147604-88e74100-77a8-11eb-8a6d-b0835eb0064a.png) 7 | 8 | ![image](https://user-images.githubusercontent.com/22045163/109147661-9997b700-77a8-11eb-9c81-bc8e89cb5c95.png) 9 | -------------------------------------------------------------------------------- /src/DFS/swea2105/sample_output.txt: -------------------------------------------------------------------------------- 1 | #1 6 2 | #2 -1 3 | #3 4 4 | #4 4 5 | #5 8 6 | #6 6 7 | #7 14 8 | #8 12 9 | #9 18 10 | #10 30 11 | -------------------------------------------------------------------------------- /src/DFS/swea5215/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 5215] 햄버거 다이어트 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/107463573-becdd800-6ba1-11eb-81fd-17b594ceb44e.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/107463593-c8574000-6ba1-11eb-9b09-dc2ffe4fb560.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/107463722-13715300-6ba2-11eb-9a1f-0f7ef494cc50.png) 7 | -------------------------------------------------------------------------------- /src/DFS/swea5215/sample_input.txt: -------------------------------------------------------------------------------- 1 | 1 2 | 5 1000 3 | 100 200 4 | 300 500 5 | 250 300 6 | 500 1000 7 | 400 400 -------------------------------------------------------------------------------- /src/DFS/swea5215/sample_output.txt: -------------------------------------------------------------------------------- 1 | #1 750 -------------------------------------------------------------------------------- /src/DFSandBFS/P1260/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1260] DFS와 BFS 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/92494421-a8a59f80-f230-11ea-9f98-75ac5f201e67.png) 4 | -------------------------------------------------------------------------------- /src/DFSandBFS/P1260/input.txt: -------------------------------------------------------------------------------- 1 | 5 5 3 2 | 5 4 3 | 5 2 4 | 1 2 5 | 3 4 6 | 3 1 -------------------------------------------------------------------------------- /src/DFSandBFS/P2573/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2573] 빙산 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/92456953-8d21a100-f1fe-11ea-91a2-f3566800ab50.png) 4 | -------------------------------------------------------------------------------- /src/DFSandBFS/P2573/input.txt: -------------------------------------------------------------------------------- 1 | 5 7 2 | 0 0 0 0 0 0 0 3 | 0 2 4 5 3 0 0 4 | 0 3 0 2 5 2 0 5 | 0 7 6 2 4 0 0 6 | 0 0 0 0 0 0 0 -------------------------------------------------------------------------------- /src/DP/P1003/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1003] 피보나치 함수 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/106982512-97dd6380-67a7-11eb-8544-c5d059eb73c0.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/106982547-a75cac80-67a7-11eb-9992-32a98741552e.png) 6 | -------------------------------------------------------------------------------- /src/DP/P1003/input.txt: -------------------------------------------------------------------------------- 1 | 41 2 | 0 3 | 1 4 | 2 5 | 3 6 | 4 7 | 5 8 | 6 9 | 7 10 | 8 11 | 9 12 | 10 13 | 11 14 | 12 15 | 13 16 | 14 17 | 15 18 | 16 19 | 17 20 | 18 21 | 19 22 | 20 23 | 21 24 | 22 25 | 23 26 | 24 27 | 25 28 | 26 29 | 27 30 | 28 31 | 29 32 | 30 33 | 31 34 | 32 35 | 33 36 | 34 37 | 35 38 | 36 39 | 37 40 | 38 41 | 39 42 | 40 -------------------------------------------------------------------------------- /src/DP/P10844/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-10844] 쉬운 계단 수 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/99814188-fc672a00-2b8b-11eb-8a53-256db217c5ac.png) 4 | 5 | ![IMG_F5A753F76CB1-1](https://user-images.githubusercontent.com/22045163/99814338-333d4000-2b8c-11eb-8bf2-d03f65a17f94.jpeg) 6 | -------------------------------------------------------------------------------- /src/DP/P11048/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-11048] 이동하기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/98326398-81066400-2034-11eb-90f0-75338def92da.png) 4 | 5 | 앞으로 이런 문제는 DP로 풀자 !!!! 6 | -------------------------------------------------------------------------------- /src/DP/P11048/input.txt: -------------------------------------------------------------------------------- 1 | 4 3 2 | 1 2 3 3 | 6 5 4 4 | 7 8 9 5 | 12 11 10 -------------------------------------------------------------------------------- /src/DP/P11052/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-11052] 카드 구매하기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/97882740-4a47f980-1d67-11eb-9d4b-482b670cc7a7.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/97882772-53d16180-1d67-11eb-8b17-04df33b5b6db.png) 5 | -------------------------------------------------------------------------------- /src/DP/P11052/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 3 5 15 16 3 | 4 | 0 1 2 3 4 -------------------------------------------------------------------------------- /src/DP/P11053/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-11053] 가장 긴 증가하는 부분 수열 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/100542323-8a2dce00-328c-11eb-98b0-7c9f9715796e.png) 4 | 5 | ![IMG_9BEBFBA0116F-1](https://user-images.githubusercontent.com/22045163/100542333-9ade4400-328c-11eb-81b9-6012fb098810.jpeg) 6 | -------------------------------------------------------------------------------- /src/DP/P11053/input.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 10 20 10 30 20 50 -------------------------------------------------------------------------------- /src/DP/P11054/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-11054] 가장 긴 바이토닉 부분 수열 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/100743086-2091f900-341f-11eb-844e-783e419d8d57.png) 4 | 5 | 이번 문제도 풀이 과정 없이 머릿속으로 생각해서 풀었다 !! 6 | 7 | 가장 긴 증가하는 부분 수열을 **앞에서부터** 구해서 저장하고, 8 | 가장 긴 감소하는 부분 수열을 **뒤에서부터** 구해서 저장하여 9 | 두 가지 배열에 대하여 각 인덱스에 저장된 값의 합에서 1(자기 자신 중복)을 빼면 10 | 각 인덱스별로 바이토닉 부분 수열 길이를 구할 수 있다. 11 | -------------------------------------------------------------------------------- /src/DP/P11054/input.txt: -------------------------------------------------------------------------------- 1 | 10 2 | 1 5 2 1 4 3 4 5 2 1 -------------------------------------------------------------------------------- /src/DP/P11055/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-11055] 가장 큰 증가 부분 수열 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/100616953-2cb58200-335d-11eb-93f6-dfd9d926e705.png) 4 | 5 | 헤헤 이번엔 딱히 노트에 풀이 과정 안 적고 풀었다. 6 | -------------------------------------------------------------------------------- /src/DP/P11055/input.txt: -------------------------------------------------------------------------------- 1 | 10 2 | 1 100 2 50 60 3 5 6 7 8 -------------------------------------------------------------------------------- /src/DP/P11057/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-11057] 오르막 수 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/98127395-00dbe380-1efa-11eb-9d63-6bbf4c67f6d7.png) 4 | -------------------------------------------------------------------------------- /src/DP/P11066/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-11066] 파일 합치기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/98438695-39b0ce00-212f-11eb-8bd3-b9ec1e3fa199.png) 4 | 5 | 나외있는 풀이를 이해해서 풀었다. `Kruth's optimization` 을 이용하면 O(n^2)로 줄일 수 있다고 하는데, 한 번 더 풀어봐야겠다. -------------------------------------------------------------------------------- /src/DP/P11066/input.txt: -------------------------------------------------------------------------------- 1 | 2 2 | 4 3 | 40 30 30 50 4 | 15 5 | 1 21 3 4 5 35 5 4 3 5 98 21 14 17 32 -------------------------------------------------------------------------------- /src/DP/P1149/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 26 40 83 3 | 49 60 57 4 | 13 89 99 -------------------------------------------------------------------------------- /src/DP/P11659/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-11659] 구간 합 구하기 4 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/90812742-87544080-e361-11ea-8255-cec1bf4e3ffc.png) 4 | -------------------------------------------------------------------------------- /src/DP/P11659/input.txt: -------------------------------------------------------------------------------- 1 | 5 3 2 | 5 4 3 2 1 3 | 1 3 4 | 2 4 5 | 5 5 -------------------------------------------------------------------------------- /src/DP/P11660/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-11660] 구간 합 구하기 5 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/90875246-d474f880-e3db-11ea-91bb-25015a1b23fb.png) 4 | -------------------------------------------------------------------------------- /src/DP/P11660/input.txt: -------------------------------------------------------------------------------- 1 | 2 4 2 | 1 2 3 | 3 4 4 | 1 1 1 1 5 | 1 2 1 2 6 | 2 1 2 1 7 | 2 2 2 2 -------------------------------------------------------------------------------- /src/DP/P11722/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-11722] 가장 긴 감소하는 부분 수열 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/100617789-54f1b080-335e-11eb-90fc-cdacec02a71f.png) 4 | 5 | 앞에서 풀었던 문제 방식의 반복이다 !! 6 | -------------------------------------------------------------------------------- /src/DP/P11722/input.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 10 30 10 20 20 10 -------------------------------------------------------------------------------- /src/DP/P11726/Main.java: -------------------------------------------------------------------------------- 1 | package DP.P11726; 2 | 3 | import java.util.Scanner; 4 | 5 | public class Main { 6 | 7 | static int n; 8 | static int[] dp = new int[1001]; 9 | 10 | public static void main(String[] args) { 11 | Scanner sc = new Scanner(System.in); 12 | n = sc.nextInt(); 13 | 14 | dp[1] = 1; 15 | dp[2] = 2; 16 | for (int i = 3; i <= n; i++) { 17 | dp[i] = (dp[i-1] + dp[i-2]) % 10007; 18 | } 19 | 20 | System.out.println(dp[n]); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/DP/P11726/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-11726] 2×n 타일링 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/98793167-dedae780-244a-11eb-908a-c105ebdaffd7.png) 4 | 5 | ### 점화식 6 | 7 | ```java 8 | dp[1] = 1 9 | dp[2] = 2 10 | dp[n] = dp[n-1] + dp[n-2] 11 | ``` 12 | 13 | ### 왜 이런 식이 성립하나? 14 | 15 | ![image](https://user-images.githubusercontent.com/22045163/98794521-7f7dd700-244c-11eb-994b-0364be020798.png) 16 | 17 | 2xn 크기의 직사각형은 2x(n-1) 크기의 직사각형을 채우고 2x1 타일을 채우는 방법의 수와, 18 | 2x(n-2) 크기의 직사각형을 채우고 1x2 타일 두 개를 채우는 방법의 수를 합친 것과 같다. 19 | 그 이상으로 더 자르면 대칭이거나, 이미 이전 단계의 경우의 수를 다 세었기 때문에 더 생각할 필요가 없다. 20 | -------------------------------------------------------------------------------- /src/DP/P11727/Main.java: -------------------------------------------------------------------------------- 1 | package DP.P11727; 2 | 3 | import java.util.Scanner; 4 | 5 | public class Main { 6 | 7 | static int n; 8 | static int[] dp = new int[1001]; 9 | 10 | public static void main(String[] args) { 11 | Scanner sc = new Scanner(System.in); 12 | n = sc.nextInt(); 13 | 14 | dp[1] = 1; 15 | dp[2] = 3; 16 | for (int i = 3; i <= n; i++) { 17 | dp[i] = (dp[i-1] + dp[i-2] * 2) % 10007; 18 | } 19 | 20 | System.out.println(dp[n]); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/DP/P11727/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-11727] 2×n 타일링 2 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/98795831-08494280-244e-11eb-80ad-d70bd56e08fa.png) 4 | 5 | ### 점화식 6 | 7 | ```java 8 | dp[1] = 1 9 | dp[2] = 2 10 | dp[n] = dp[n-1] + (dp[n-2] * 2) 11 | ``` 12 | 13 | [2xn 타일링](../P11726) 문제에 2x2 타일이 생겼으므로, 2x(n-2) 크기의 직사각형으로 잘랐을 때 14 | 경우의 수가 하나 더 생긴다. 그래서 2를 곱해준다. 15 | -------------------------------------------------------------------------------- /src/DP/P12852/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-12852] 1로 만들기 2 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/112117297-8e487780-8bfe-11eb-8f9b-5516059c6245.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/112117342-9ef8ed80-8bfe-11eb-84e7-10e6b908f4c7.png) 6 | -------------------------------------------------------------------------------- /src/DP/P12852/input.txt: -------------------------------------------------------------------------------- 1 | 10 -------------------------------------------------------------------------------- /src/DP/P12865/input.txt: -------------------------------------------------------------------------------- 1 | 5 9 2 | 2 4 3 | 1 3 4 | 3 5 5 | 4 8 6 | 2 1 7 | 8 | 4 7 9 | 6 13 10 | 4 8 11 | 3 6 12 | 5 12 13 | -------------------------------------------------------------------------------- /src/DP/P1328/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 2 -------------------------------------------------------------------------------- /src/DP/P13398/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-13398] 연속합 2 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/100982308-3cb2a900-358b-11eb-9cf0-37de27655ed8.png) 4 | 5 | ### 점화식 6 | 7 | ```java 8 | dp[0][0] = dp[0][1] = arr[0]; 9 | dp[n][0] = Math.max(dp[n-1][0], 0) + arr[n]; 10 | dp[n][1] = Math.max(dp[n-1][0], dp[n-1][1] + arr[n]); 11 | ``` 12 | 13 | ![IMG_BEB4BBF853D3-1](https://user-images.githubusercontent.com/22045163/100983690-00804800-358d-11eb-81a9-2f0c46161d57.jpeg) 14 | 15 | 후아.. 한참을 헤맨 문제다. 성장하자 !!! 16 | -------------------------------------------------------------------------------- /src/DP/P13398/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | -10 10 20 -40 50 3 | 4 | 10 5 | 2 1 -4 3 4 -4 6 5 -5 1 6 | 7 | 10 8 | 10 -4 3 1 5 6 -35 12 21 -1 9 | 10 | 5 11 | -1 -2 -3 -4 -5 12 | -------------------------------------------------------------------------------- /src/DP/P14002/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-14002] 가장 긴 증가하는 부분 수열 4 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/100543331-cf54fe80-3292-11eb-9181-bcf0aa6aabbb.png) 4 | 5 | ![IMG_34F6ACBEB872-1](https://user-images.githubusercontent.com/22045163/100543341-e85daf80-3292-11eb-9940-b3f252769ef6.jpeg) 6 | -------------------------------------------------------------------------------- /src/DP/P14002/input.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 10 20 10 30 20 50 -------------------------------------------------------------------------------- /src/DP/P1463/Main.java: -------------------------------------------------------------------------------- 1 | package DP.P1463; 2 | 3 | import java.util.Scanner; 4 | 5 | public class Main { 6 | 7 | static int N; 8 | static int[] dp = new int[1000001]; 9 | 10 | public static void main(String[] args) throws Exception { 11 | Scanner sc = new Scanner(System.in); 12 | N = sc.nextInt(); 13 | 14 | for (int i = 2; i <= N; i++) { 15 | int x1 = (i % 3 == 0) ? dp[i/3] : Integer.MAX_VALUE; 16 | int x2 = (i % 2 == 0) ? dp[i/2] : Integer.MAX_VALUE; 17 | int x3 = dp[i-1]; 18 | dp[i] = Math.min(x1, Math.min(x2, x3)) + 1; 19 | } 20 | 21 | System.out.println(dp[N]); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/DP/P1463/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1463] 1로 만들기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/98788838-c5cf3800-2444-11eb-8624-3fb3f0b3ca6e.png) 4 | 5 | ### 점화식 6 | 7 | ```java 8 | dp[1] = 0 9 | dp[n] = Math.min(dp[n-1], dp[n/2], dp[n/3]) + 1 10 | // n/2, n/3은 나누어 떨어지는지 확인 11 | ``` 12 | -------------------------------------------------------------------------------- /src/DP/P15678/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-15678] 연세워터파크 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/126867807-4710c8a8-51f4-40e0-a012-11a3e758b508.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/126867815-ec940082-aa45-41b3-83af-4b28358d820a.png) 5 | 6 | ### 풀이 과정 7 | 8 | - [동적 계획법 4(Dynamic Programming 4)|작성자 라이](https://blog.naver.com/kks227/221386454504) 9 | - [15678번: 연세워터파크](https://hellogaon.tistory.com/67) 10 | 11 | 어려워서 위 풀이를 참고했다 ㅎㅎㅎ 좋은 문제다 ㅎㅎ 12 | 13 | ![image](https://user-images.githubusercontent.com/22045163/126867825-98689033-b78a-489b-87e2-ea7b4f7420c5.png) 14 | -------------------------------------------------------------------------------- /src/DP/P15678/input.txt: -------------------------------------------------------------------------------- 1 | 10 2 2 | 2 7 -5 -4 10 -5 -5 -5 30 -10 -------------------------------------------------------------------------------- /src/DP/P15988/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-15988] 1, 2, 3 더하기 3 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/99142391-ecd17800-2697-11eb-909f-df06f48ce95a.png) 4 | -------------------------------------------------------------------------------- /src/DP/P15988/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 4 3 | 7 4 | 10 -------------------------------------------------------------------------------- /src/DP/P15990/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-15990] 1, 2, 3 더하기 5 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/99809431-9e374880-2b85-11eb-8108-a22ebe22a9b0.png) 4 | 5 | ![IMG_3E4C86D36612-1](https://user-images.githubusercontent.com/22045163/99809685-fec68580-2b85-11eb-8791-f6e168364e23.jpeg) 6 | 7 | ### 2021.02.04 - 재채점 및 시간초과로 인해 다시 풀이 8 | 9 | 테스트케이스가 있으므로 dp 배열은 미리 초기화, StringBuilder 사용 10 | 11 | ![image](https://user-images.githubusercontent.com/22045163/106891625-5197ee00-672e-11eb-95cd-3e0f3ddda779.png) 12 | -------------------------------------------------------------------------------- /src/DP/P15990/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 4 3 | 7 4 | 10 -------------------------------------------------------------------------------- /src/DP/P16194/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-16194] 카드 구매하기 2 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/97884107-048c3080-1d69-11eb-95eb-61c170c14d66.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/97884134-0eae2f00-1d69-11eb-839a-ec23ad877385.png) 5 | -------------------------------------------------------------------------------- /src/DP/P16194/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 3 5 15 16 -------------------------------------------------------------------------------- /src/DP/P1699/Main.java: -------------------------------------------------------------------------------- 1 | package DP.P1699; 2 | 3 | import java.util.Scanner; 4 | 5 | public class Main { 6 | 7 | static int N; 8 | static int[] dp = new int[100001]; 9 | 10 | public static void main(String[] args) { 11 | Scanner sc = new Scanner(System.in); 12 | N = sc.nextInt(); 13 | 14 | for (int i = 1; i <= N; i++) { 15 | int nearSquare = (int) Math.floor(Math.sqrt(i)); 16 | dp[i] = Integer.MAX_VALUE; 17 | for (int j = nearSquare; j > 0; j--) { 18 | dp[i] = Math.min(dp[i], dp[i - j*j] + 1); 19 | } 20 | } 21 | 22 | System.out.println(dp[N]); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/DP/P1699/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1699] 제곱수의 합 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/100987220-93bb7c80-3591-11eb-92e7-8e5456b8bb8f.png) 4 | 5 | ![IMG_F93DDD89E4EC-1](https://user-images.githubusercontent.com/22045163/100987439-dda46280-3591-11eb-8ca2-2a7e91d23c83.jpeg) 6 | -------------------------------------------------------------------------------- /src/DP/P17845/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-17845] 수강 과목 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/132991144-de48fc60-7906-4221-b80e-fce683a8d186.png) 4 | 5 | ### 배낭 문제 6 | 7 | 문제를 잘 읽어보면 배낭 문제라는 것을 금방 알 수 있다. [여기](../P12865)로 가면 내가 잘 정리해뒀다. 8 | 9 | ![image](https://user-images.githubusercontent.com/22045163/132991153-44884760-3e3e-493e-88f9-662b6b0a3adb.png) 10 | -------------------------------------------------------------------------------- /src/DP/P17845/input.txt: -------------------------------------------------------------------------------- 1 | 80 3 2 | 650 40 3 | 700 60 4 | 60 40 -------------------------------------------------------------------------------- /src/DP/P1912/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1912] 연속합 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/100898134-ca4ab600-3503-11eb-8ee5-b62457398c4a.png) 4 | 5 | ![IMG_5B816FCF061B-1](https://user-images.githubusercontent.com/22045163/100898174-d3d41e00-3503-11eb-86fb-0931950ddfbc.jpeg) 6 | -------------------------------------------------------------------------------- /src/DP/P1912/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | -1 -2 -3 -4 -5 -------------------------------------------------------------------------------- /src/DP/P1932/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 7 3 | 3 8 4 | 8 1 0 5 | 2 7 4 4 6 | 4 5 2 6 5 -------------------------------------------------------------------------------- /src/DP/P2098/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 0 10 15 20 3 | 5 0 9 10 4 | 6 13 0 12 5 | 8 8 9 0 -------------------------------------------------------------------------------- /src/DP/P2156/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2156] 포도주 시식 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/100535918-62287580-3260-11eb-8998-2e3bc2e5d86d.png) 4 | 5 | ![IMG_31725EF2855A-1](https://user-images.githubusercontent.com/22045163/100535944-a4ea4d80-3260-11eb-85ce-14491fecb3f4.jpeg) 6 | 7 | ### 점화식 8 | 9 | `dp` 배열 : 지금껏 선택한 것들 중 최대의 값 (연속 3개 선택 x) 10 | 11 | ```java 12 | dp[1] = drink[1] 13 | dp[2] = drink[1] + drink[2] 14 | ... 15 | dp[n] = Math.max(dp[n-2] + drink[n], drink[n-3] + drink[n-1] + drink[n]) 16 | dp[n] = Math.max(dp[n-1], dp[n]) /* 연속 2개 선택 x */ 17 | ``` 18 | -------------------------------------------------------------------------------- /src/DP/P2156/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 10 3 | 15 4 | 1 5 | 6 | 6 7 | 6 8 | 10 9 | 13 10 | 9 11 | 8 12 | 1 13 | 14 | 6 15 | 100 16 | 400 17 | 2 18 | 1 19 | 4 20 | 200 -------------------------------------------------------------------------------- /src/DP/P2193/Main.java: -------------------------------------------------------------------------------- 1 | package DP.P2193; 2 | 3 | import java.util.Scanner; 4 | 5 | public class Main { 6 | 7 | static int N; 8 | static long[][] dp = new long[91][2]; 9 | 10 | public static void main(String[] args) throws Exception { 11 | Scanner sc = new Scanner(System.in); 12 | N = sc.nextInt(); 13 | 14 | dp[1][0] = 0; dp[1][1] = 1; 15 | dp[2][0] = 1; dp[2][1] = 0; 16 | 17 | for (int i = 3; i <= N; i++) { 18 | dp[i][0] = dp[i-1][0] + dp[i-1][1]; 19 | dp[i][1] = dp[i-1][0]; 20 | } 21 | 22 | System.out.println(dp[N][0] + dp[N][1]); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/DP/P2193/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2193] 이친수 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/99967302-029f1580-2ddb-11eb-929f-596ce1560168.png) 4 | 5 | ### 주의할 점 6 | 7 | N의 범위가 `1 ≤ N ≤ 90`으로 주어졌기 때문에 결과값이 매우 클 수 있는데, 8 | 따로 `mod` 값이 주어지지 않았으므로 반드시 `dp` 배열을 `long`으로 선언해야 한다. 9 | 10 | ![image](https://user-images.githubusercontent.com/22045163/99967538-5f9acb80-2ddb-11eb-9df9-b4696c283e16.png) 11 | -------------------------------------------------------------------------------- /src/DP/P2225/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2225] 합분해 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/101066300-8fb34d00-35d9-11eb-9e3f-49d0e881c450.png) 4 | 5 | ![IMG_F5BB57C2137D-1](https://user-images.githubusercontent.com/22045163/101066443-c2f5dc00-35d9-11eb-909e-512e698956d3.jpeg) 6 | 7 | 풀이가 낙서장처럼 엉망진창이긴 하지만, 곰곰이 잘 생각해보면 식을 도출할 수 있기 때문에 8 | 한 번 더 예쁘게 정리하지 않아도 될 것 같다 !! 9 | -------------------------------------------------------------------------------- /src/DP/P2225/input.txt: -------------------------------------------------------------------------------- 1 | 20 3 -------------------------------------------------------------------------------- /src/DP/P2294/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2294] 동전 2 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/113482949-e4a99600-94db-11eb-880a-a3175ca47b51.png) 4 | 5 | ### 점화식 6 | 7 | ```java 8 | dp[0] = 0 // 동전의 가치는 자연수임 9 | for (int coin : coins) { 10 | dp[n] = Math.min(dp[n], 1 + dp[n-coin]); 11 | } 12 | ``` 13 | 14 | 동전이 1원, 5원이 있다고 할 때, 7원을 만드는 방법은 `5원 1개 + [2원을 만드는 방법의 최솟값]`, `1원 1개 + [6원을 만드는 방법의 최솟값]` 중 최솟값이다. 이를 점화식으로 표현하면 위와 같다. 15 | 16 | ![image](https://user-images.githubusercontent.com/22045163/113482952-eb380d80-94db-11eb-9987-c527e750daf9.png) 17 | -------------------------------------------------------------------------------- /src/DP/P2294/input.txt: -------------------------------------------------------------------------------- 1 | 3 15 2 | 12 3 | 4 4 | 2 -------------------------------------------------------------------------------- /src/DP/P2533/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2533] 사회망 서비스(SNS) 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/114294377-3607e580-9ad9-11eb-8272-dc11ed0e1406.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/114294385-3f914d80-9ad9-11eb-844b-1ca4cea142e7.png) 5 | 6 | ### 풀이 과정 7 | 8 | > 풀이 과정을 떠올릴 수가 없어서 [이 블로그](https://comyoung.tistory.com/41) 를 참고하였다. 9 | 10 | ![image](https://user-images.githubusercontent.com/22045163/114294418-723b4600-9ad9-11eb-9af6-dd683fa42669.png) 11 | -------------------------------------------------------------------------------- /src/DP/P2533/input.txt: -------------------------------------------------------------------------------- 1 | 8 2 | 1 2 3 | 1 3 4 | 1 4 5 | 2 5 6 | 2 6 7 | 4 7 8 | 4 8 -------------------------------------------------------------------------------- /src/DP/P2579/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2579] 계단 오르기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/98138014-02aba400-1f06-11eb-96da-fb16f6fbe374.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/98138054-0d663900-1f06-11eb-8eb6-2f69fbc7e019.png) 5 | 6 | ### 점화식 7 | 8 | ``` 9 | /* 한 계단 오를 때 (연속 3번 방지) */ 10 | dp[n] = dp[n-3] + stair[n-1] + stair[n] 11 | /* 두 계단 오를 때 */ 12 | dp[n] = dp[n-2] + stair[n] 13 | ``` 14 | -------------------------------------------------------------------------------- /src/DP/P2579/input.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 10 3 | 20 4 | 15 5 | 25 6 | 10 7 | 20 -------------------------------------------------------------------------------- /src/DP/P2629/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 2 3 3 3 3 | 3 4 | 1 4 10 -------------------------------------------------------------------------------- /src/DP/P9095/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-9095] 1, 2, 3 더하기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/94254638-08ef4d80-ff62-11ea-9672-d64f3ef0f059.png) 4 | 5 | ### 점화식 6 | 7 | ```java 8 | dp[1] = 1 9 | dp[2] = 2 10 | dp[3] = 4 11 | dp[n] = dp[n-1] + dp[n-2] + dp[n-3]; 12 | ``` 13 | 14 | 정수 n을 1, 2, 3의 합으로 나타내는 방법은 dp[n-1]에 +1을 한 것, dp[n-2]에 +2를 한 것, 15 | dp[n-3]에 +3을 한 것, 이 모든 경우의 수를 합친 것과 같다. 16 | -------------------------------------------------------------------------------- /src/DP/P9095/input.txt: -------------------------------------------------------------------------------- 1 | 10 2 | 1 3 | 2 4 | 3 5 | 4 6 | 5 7 | 6 8 | 7 9 | 8 10 | 9 11 | 10 12 | 13 | //1 14 | 2 15 | 4 16 | 7 17 | 13 18 | 24 19 | 44 20 | 81 21 | 149 22 | 274 23 | -------------------------------------------------------------------------------- /src/DP/P9465/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-9465] 스티커 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/100544436-ebf43500-3298-11eb-9d66-a536de85a203.png) 4 | 5 | ![IMG_FA671A4A0DB7-1](https://user-images.githubusercontent.com/22045163/100544439-f0205280-3298-11eb-963d-25dea48b5323.jpeg) 6 | -------------------------------------------------------------------------------- /src/DP/P9465/input.txt: -------------------------------------------------------------------------------- 1 | 2 2 | 5 3 | 50 10 100 20 40 4 | 30 50 70 10 60 5 | 7 6 | 10 30 10 50 100 20 40 7 | 20 40 30 50 60 20 80 -------------------------------------------------------------------------------- /src/DP/jo1681/README.md: -------------------------------------------------------------------------------- 1 | ## [JUNGOL-1681] 해밀턴 순환회로 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/112010238-7aebcc80-8b6a-11eb-9753-a22d78d2f811.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/112010319-8b03ac00-8b6a-11eb-8d7d-b04444cfc601.png) 6 | -------------------------------------------------------------------------------- /src/DP/jo1681/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 0 30 94 73 90 3 | 42 0 32 78 81 4 | 52 3 0 55 0 5 | 63 0 87 0 12 6 | 31 0 60 33 0 7 | // 160 8 | 9 | 5 10 | 0 14 4 10 20 11 | 14 0 7 8 7 12 | 4 5 0 7 16 13 | 11 7 9 0 2 14 | 18 7 17 4 0 15 | // 30 -------------------------------------------------------------------------------- /src/DP/prg42895/README.md: -------------------------------------------------------------------------------- 1 | ## [programmers - 동적계획법] N으로 표현 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/112585389-0d2af380-8e3d-11eb-8f38-ec852ed15860.png) 4 | -------------------------------------------------------------------------------- /src/DP/swea1861/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 1861] 정사각형 방 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/107003265-d555e700-67cf-11eb-957a-19f13bd15095.png) 4 | 5 | ### BFS, DFS, DP 6 | 7 | ![image](https://user-images.githubusercontent.com/22045163/107003364-ff0f0e00-67cf-11eb-9162-2e2f97251f4e.png) 8 | 9 | 아래서부터 순서대로 BFS, DFS, DP로 푼 실행 결과이다. 10 | 11 | - 현 문제에서 정말 위험한 메모리 성능 : BFS 12 | - 가장 빨리 구현할 수 있는 것 : DFS 13 | - 가장 좋은 성능을 보장하는 것 : DP 14 | -------------------------------------------------------------------------------- /src/DP/swea1861/output.txt: -------------------------------------------------------------------------------- 1 | #1 6 8 2 | #2 3 2 3 | #3 149 2 4 | #4 2 45 5 | #5 2 23 6 | #6 1 2 7 | #7 1 4 8 | #8 5 17 9 | #9 4 2 10 | #10 1 35 11 | #11 2 2 12 | #12 7 2 13 | #13 45 2 14 | #14 113 2 15 | #15 12 32 16 | #16 6 9 17 | #17 1 4 18 | #18 36 42 19 | #19 204 2 20 | #20 7 14 21 | #21 4 2 22 | #22 8225 2200 23 | #23 35 3 24 | #24 2 2 25 | #25 613 2 26 | #26 33 2 27 | #27 5 5 28 | -------------------------------------------------------------------------------- /src/DP/swea1952/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 1952] 수영장 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/110744307-cf46a080-827c-11eb-9827-b97c2efa9b4e.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/110744323-d9689f00-827c-11eb-9e38-23269fbaf178.png) 5 | ![image](https://user-images.githubusercontent.com/22045163/110744346-e2597080-827c-11eb-86c0-94204cfd58c7.png) 6 | 7 | ![image](https://user-images.githubusercontent.com/22045163/110744374-ee453280-827c-11eb-8019-2fa40a547f45.png) 8 | -------------------------------------------------------------------------------- /src/DP/swea1952/sample_input.txt: -------------------------------------------------------------------------------- 1 | 10 2 | 10 40 100 300 3 | 0 0 2 9 1 5 0 0 0 0 0 0 4 | 10 100 50 300 5 | 0 0 0 0 0 0 0 0 6 2 7 8 6 | 10 70 180 400 7 | 6 9 7 7 7 5 5 0 0 0 0 0 8 | 10 70 200 550 9 | 0 0 0 0 8 9 6 9 6 9 8 6 10 | 10 80 200 550 11 | 0 8 9 15 1 13 2 4 9 0 0 0 12 | 10 130 360 1200 13 | 0 0 0 15 14 11 15 13 12 15 10 15 14 | 10 180 520 1900 15 | 0 18 16 16 19 19 18 18 15 16 17 16 16 | 10 100 200 1060 17 | 12 9 11 13 11 8 6 12 8 7 15 6 18 | 10 170 500 1980 19 | 19 18 18 17 15 19 19 16 19 15 17 18 20 | 10 200 580 2320 21 | 12 28 24 24 29 25 23 26 26 28 27 22 -------------------------------------------------------------------------------- /src/DP/swea1952/sample_output.txt: -------------------------------------------------------------------------------- 1 | #1 110 2 | #2 100 3 | #3 400 4 | #4 530 5 | #5 430 6 | #6 1080 7 | #7 1840 8 | #8 800 9 | #9 1980 10 | #10 2260 11 | -------------------------------------------------------------------------------- /src/GCD/P14476/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 8 12 20 32 36 -------------------------------------------------------------------------------- /src/GCD/P1735/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1735] 분수 합 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/107123392-a54a3900-68e0-11eb-9781-220f33ee8f45.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/107123401-b3985500-68e0-11eb-8e4e-813960f4c302.png) 6 | -------------------------------------------------------------------------------- /src/GCD/P1735/input.txt: -------------------------------------------------------------------------------- 1 | 2 7 2 | 3 5 -------------------------------------------------------------------------------- /src/GCD/P2609/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2609] 최대공약수와 최소공배수 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/93660963-08047a80-fa8f-11ea-9211-62893feca6c7.png) 4 | -------------------------------------------------------------------------------- /src/GCD/P2609/input.txt: -------------------------------------------------------------------------------- 1 | 24 18 -------------------------------------------------------------------------------- /src/Graph/P11404/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-11404] 플로이드 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/106630419-2b077500-65bf-11eb-9dec-b3b94edb092d.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/106630455-335fb000-65bf-11eb-9201-e489d997fef3.png) 6 | 7 | 플로이드-워셜 알고리즘을 이용하는데, 문제에서 "시작 도시와 도착 도시를 연결하는 노선은 하나가 아닐 수 있다." 라는 조건을 확인하고 이 부분을 고려해야 한다. 8 | -------------------------------------------------------------------------------- /src/Graph/P11404/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 14 3 | 1 2 2 4 | 1 3 3 5 | 1 4 1 6 | 1 5 10 7 | 2 4 2 8 | 3 4 1 9 | 3 5 1 10 | 4 5 3 11 | 3 5 10 12 | 3 1 8 13 | 1 4 2 14 | 5 1 7 15 | 3 4 2 16 | 5 2 4 -------------------------------------------------------------------------------- /src/Graph/P11657/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-11657] 타임머신 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/106625700-4328c580-65ba-11eb-95b4-9fd5a2761cc7.png) 4 | 5 | ### 출력 초과 이슈 6 | 7 | > [11657번 - 타임머신 > 출력초과 문제 해결이 되었는데 이유를 모르겠습니다](https://www.acmicpc.net/board/view/55270) 8 | 9 | ![image](https://user-images.githubusercontent.com/22045163/106625810-62275780-65ba-11eb-9ece-2a882f589424.png) 10 | 11 | 음의 가중치가 허용되기 때문에 underflow 이슈를 고려해야 한다. 앞으로 이런 부분도 신경 써서 구현해야겠다. 12 | 13 | ![image](https://user-images.githubusercontent.com/22045163/106625767-550a6880-65ba-11eb-8091-48feded9e2b6.png) 14 | -------------------------------------------------------------------------------- /src/Graph/P11657/input.txt: -------------------------------------------------------------------------------- 1 | 3 4 2 | 1 2 4 3 | 1 3 3 4 | 2 3 -1 5 | 3 1 -2 6 | 7 | 3 4 8 | 1 2 4 9 | 1 3 3 10 | 2 3 -4 11 | 3 1 -2 12 | 13 | 3 2 14 | 1 2 4 15 | 1 2 3 16 | -------------------------------------------------------------------------------- /src/Graph/P11724/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-11724] 연결 요소의 개수 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/96466954-632fb580-1265-11eb-8b38-670c7276869b.png) 4 | -------------------------------------------------------------------------------- /src/Graph/P11724/input.txt: -------------------------------------------------------------------------------- 1 | 6 8 2 | 1 2 3 | 2 5 4 | 5 1 5 | 3 4 6 | 4 6 7 | 5 4 8 | 2 4 9 | 2 3 -------------------------------------------------------------------------------- /src/Graph/P1197/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1197] 최소 스패닝 트리 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/110059302-4ffe2c00-7da7-11eb-9688-7e21e1ef344a.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/110059326-59879400-7da7-11eb-9a05-ba5e27d59cab.png) 6 | -------------------------------------------------------------------------------- /src/Graph/P1197/input.txt: -------------------------------------------------------------------------------- 1 | 3 3 2 | 1 2 1 3 | 2 3 2 4 | 1 3 3 -------------------------------------------------------------------------------- /src/Graph/P14621/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-14621] 나만 안되는 연애 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/109738945-2230b000-7c0c-11eb-9bf6-1046bbb464d7.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/109738968-2bba1800-7c0c-11eb-8d48-1574aae1df78.png) 6 | -------------------------------------------------------------------------------- /src/Graph/P14621/input.txt: -------------------------------------------------------------------------------- 1 | 5 7 2 | M W W W M 3 | 1 2 12 4 | 1 3 10 5 | 4 2 5 6 | 5 2 5 7 | 2 5 10 8 | 3 4 3 9 | 5 4 7 10 | 11 | 3 3 12 | M W M 13 | 1 2 1 14 | 2 3 1 15 | 1 3 1 16 | // ans 2 17 | -------------------------------------------------------------------------------- /src/Graph/P16398/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-16398] 행성 연결 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/109742069-bb15fa00-7c11-11eb-8003-53d098d75120.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/109742087-c2d59e80-7c11-11eb-8a2b-1881dde3c651.png) 6 | -------------------------------------------------------------------------------- /src/Graph/P16398/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 0 6 8 1 3 3 | 6 0 5 7 3 4 | 8 5 0 9 4 5 | 1 7 9 0 6 6 | 3 3 4 6 0 -------------------------------------------------------------------------------- /src/Graph/P16562/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-16562] 친구비 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/109410364-68ec9300-79dd-11eb-916e-bc9df2d89a23.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/109410368-7570eb80-79dd-11eb-9d59-ee5474c1e572.png) 6 | -------------------------------------------------------------------------------- /src/Graph/P16562/input.txt: -------------------------------------------------------------------------------- 1 | 5 4 100 2 | 6 2 3 4 5 3 | 1 5 4 | 2 4 5 | 4 3 6 | 5 4 7 | 8 | 5 3 10 9 | 10 10 20 20 30 10 | 1 3 11 | 2 4 12 | 5 4 -------------------------------------------------------------------------------- /src/Graph/P1707/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1707] 이분 그래프 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/97858143-10183100-1d42-11eb-89da-fdb339b83529.png) 4 | -------------------------------------------------------------------------------- /src/Graph/P1707/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 3 2 3 | 1 3 4 | 2 3 5 | 4 4 6 | 1 2 7 | 2 3 8 | 3 4 9 | 4 2 10 | 9 6 11 | 1 5 12 | 1 6 13 | 1 9 14 | 2 7 15 | 3 8 16 | 4 8 17 | 1000000 1 18 | 4 6 -------------------------------------------------------------------------------- /src/Graph/P1717/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1717] 집합의 표현 2 | 3 | ### 문제 분석 4 | 5 | - 초기화 : {0}, {1}, {2}, ... {n} 이 각각 n+1개의 집합 6 | - Union : 합집합 연산 7 | - Find : 두 원소가 같은 집합에 포함되어 있는지를 확인하는 연산 8 | 9 | ### 입력 10 | 11 | - 첫째 줄 : n(1≤n≤1,000,000), m(1≤m≤100,000) 12 | - n : 집합 원소의 최댓값 13 | - m : 주어질 연산의 수 14 | - 다음 m개의 줄 15 | - Union : 0 a b의 형태, a가 포함되어 있는 집합과 b가 포함되어 있는 집합을 합친다 16 | - Find : 1 a b의 형태, a와 b가 같은 집합에 포함되어 있는지를 확인 17 | - a와 b는 n 이하의 자연수 또는 0이며 같을 수도 있다. 18 | 19 | ### 출력 20 | 21 | - 1로 시작하는 입력에 대해서 한 줄에 하나씩 YES/NO(yes/no)로 결과를 출력한다. 22 | -------------------------------------------------------------------------------- /src/Graph/P1717/input.txt: -------------------------------------------------------------------------------- 1 | 7 8 2 | 0 1 1 3 | 1 1 7 4 | 0 7 6 5 | 1 7 1 6 | 0 3 7 7 | 0 4 2 8 | 0 1 1 9 | 1 1 1 -------------------------------------------------------------------------------- /src/Graph/P1738/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1738] 골목길 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/123546336-25414480-d797-11eb-8c69-acfe0d3447c6.png) 4 | 5 | ### 풀이 과정 6 | 7 | 경로를 구하는 법을 잘 모르겠어서 다른 풀이를 참고했다. 다음에 풀 때는 잘 풀 수 있기를 !! 8 | 9 | - 가중치가 최대가 되는 경로를 구해야 하므로 주어진 가중치에 `-1`을 곱하여 최단경로 문제로 바꿀 수 있다. 10 | - 경로를 구하기 위해 `prev` 배열을 선언하여 최단경로가 업데이트될 때마다 방문한 노드를 배열에 저장하면 된다. 11 | - 싸이클이 존재하더라도 1에서 n까지 가는 경로에 싸이클이 없으면 가능한 경로가 된다. 이를 구하기 위해 최단 경로를 구하기 전 `bfs`를 통해 n과 연결된 길의 방문 노드를 체크한다. 12 | 13 | ![image](https://user-images.githubusercontent.com/22045163/123546346-2f634300-d797-11eb-9284-4a902c75c64f.png) 14 | -------------------------------------------------------------------------------- /src/Graph/P1738/input.txt: -------------------------------------------------------------------------------- 1 | 5 7 2 | 1 2 3 3 | 1 3 4 4 | 3 1 -7 5 | 2 3 2 6 | 3 4 1 7 | 4 2 -2 8 | 4 5 1 -------------------------------------------------------------------------------- /src/Graph/P17472/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-17472] 다리 만들기 2 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/112599943-e6c48280-8e53-11eb-8f75-c0d960743444.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/112600020-fd6ad980-8e53-11eb-9f63-faaf4aa1f03f.png) 5 | ![image](https://user-images.githubusercontent.com/22045163/112600060-09ef3200-8e54-11eb-8cd6-c11b5e187e51.png) 6 | 7 | 이 문제는 BFS + MST !! 8 | 9 | ![image](https://user-images.githubusercontent.com/22045163/112600101-183d4e00-8e54-11eb-9f41-90d909a88510.png) 10 | -------------------------------------------------------------------------------- /src/Graph/P17472/input.txt: -------------------------------------------------------------------------------- 1 | 10 6 2 | 0 0 0 1 0 0 3 | 0 0 0 1 0 0 4 | 0 1 0 0 0 1 5 | 0 0 0 0 0 0 6 | 1 1 0 1 1 0 7 | 1 0 0 0 1 0 8 | 1 1 0 0 1 0 9 | 0 0 0 0 1 1 10 | 0 0 0 0 0 0 11 | 0 1 0 0 0 0 12 | ans: 13 13 | 14 | 7 7 15 | 1 1 1 0 1 1 1 16 | 1 1 1 0 1 1 1 17 | 1 1 1 0 1 1 1 18 | 0 0 0 0 0 0 0 19 | 1 1 1 0 1 1 1 20 | 1 1 1 0 1 1 1 21 | 1 1 1 0 1 1 1 -------------------------------------------------------------------------------- /src/Graph/P1753/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1753] 최단경로 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/106621109-93515900-65b5-11eb-8fcf-ded496c53a11.png) 4 | 5 | ### 다익스트라 알고리즘 - Priority Queue를 이용한 개선 알고리즘 6 | 7 | - 그래프 정보를 이차원 배열에 저장하면 **메모리 초과** 8 | - 단순 배열로 다음 방문 정점을 고르면 **시간 초과** 9 | 10 | ![image](https://user-images.githubusercontent.com/22045163/106626369-001b2200-65bb-11eb-8027-a0ea100c7f05.png) 11 | 12 | ### 2021.03.22 13 | 14 | - [210322.java](Main2.java) 15 | -------------------------------------------------------------------------------- /src/Graph/P1753/input.txt: -------------------------------------------------------------------------------- 1 | 5 6 2 | 1 3 | 5 1 1 4 | 1 2 2 5 | 1 3 3 6 | 2 3 4 7 | 2 4 5 8 | 3 4 6 -------------------------------------------------------------------------------- /src/Graph/P1854/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1854] K번째 최단경로 찾기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/106920032-068dd300-674e-11eb-81d0-e3f362577bcc.png) 4 | 5 | ### 풀이 로직 6 | 7 | 다익스트라 알고리즘은 현재 계산된 최단 거리보다 큰 값이 들어오면 무시해버린다. 8 | 이 문제는 그 값을 무시하지 않고 top `K` 를 뽑는 것이다. 어떻게 이런 생각을 했을까. 9 | 참 재밌는 다익스트라 🧘🏼‍♂️ 10 | 11 | ![image](https://user-images.githubusercontent.com/22045163/106920894-d266e200-674e-11eb-9e49-c85bd39be790.png) 12 | -------------------------------------------------------------------------------- /src/Graph/P1854/input.txt: -------------------------------------------------------------------------------- 1 | 5 10 2 2 | 1 2 2 3 | 1 3 7 4 | 1 4 5 5 | 1 5 6 6 | 2 4 2 7 | 2 3 4 8 | 3 4 6 9 | 3 5 8 10 | 5 2 4 11 | 5 4 1 12 | 13 | //output 14 | -1 15 | 10 16 | 7 17 | 5 18 | 14 -------------------------------------------------------------------------------- /src/Graph/P1944/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1944] 복제 로봇 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/109767193-84a0a500-7c3a-11eb-990b-b0d113bfd4fd.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/109767244-97b37500-7c3a-11eb-92ee-7b8cd9fac8f5.png) 6 | -------------------------------------------------------------------------------- /src/Graph/P1944/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 2 | 11111 3 | 1S001 4 | 10001 5 | 1K1K1 6 | 11111 -------------------------------------------------------------------------------- /src/Graph/P21276/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-21276] 계보 복원가 호석 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/113163622-4cad7180-927b-11eb-80c4-628a5a2d8b20.png) 4 | 5 | 이 문제는 위상정렬 + Map 자료구조를 사용하는 문제이다. 위상정렬 문제라는 것을 떠올리기 힘들었다. 더 공부하도록 !!! 6 | 7 | ![image](https://user-images.githubusercontent.com/22045163/113163695-5b942400-927b-11eb-9f80-e19a17d4fbee.png) 8 | -------------------------------------------------------------------------------- /src/Graph/P21276/input.txt: -------------------------------------------------------------------------------- 1 | 7 2 | daeil sangdo yuri hoseok minji doha haeun 3 | 7 4 | hoseok sangdo 5 | yuri minji 6 | hoseok daeil 7 | daeil sangdo 8 | haeun doha 9 | doha minji 10 | haeun minji -------------------------------------------------------------------------------- /src/Graph/P21278/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-21278] 호석이 두 마리 치킨 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/113171455-7027ea80-9282-11eb-8622-e7fe4113fdd9.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/113171495-7d44d980-9282-11eb-9bbc-a6597393e937.png) 6 | -------------------------------------------------------------------------------- /src/Graph/P21278/input.txt: -------------------------------------------------------------------------------- 1 | 5 4 2 | 1 3 3 | 4 2 4 | 2 5 5 | 3 2 -------------------------------------------------------------------------------- /src/Graph/P2252/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2252] 줄 세우기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/90795565-29b3fa00-e349-11ea-8826-87ae8ec18053.png) -------------------------------------------------------------------------------- /src/Graph/P2252/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 2 | 4 2 3 | 3 1 -------------------------------------------------------------------------------- /src/Graph/P2458/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2458] 키 순서 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/115832330-bcafb180-a44d-11eb-9cdc-3b736178cbd4.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/115832369-ca653700-a44d-11eb-8322-a91daa866817.png) 6 | -------------------------------------------------------------------------------- /src/Graph/P2458/input.txt: -------------------------------------------------------------------------------- 1 | 6 6 2 | 1 5 3 | 3 4 4 | 5 4 5 | 4 2 6 | 4 6 7 | 5 2 -------------------------------------------------------------------------------- /src/Graph/P3860/input.txt: -------------------------------------------------------------------------------- 1 | 5 5 2 | 11 3 | 0 1 4 | 0 2 5 | 0 3 6 | 1 1 7 | 1 2 8 | 1 3 9 | 2 1 10 | 2 2 11 | 2 3 12 | 3 1 13 | 3 2 14 | 1 15 | 0 4 1 0 -12 16 | 0 0 17 | 18 | 3 3 19 | 2 20 | 2 1 21 | 1 2 22 | 0 23 | 4 3 24 | 2 25 | 2 1 26 | 3 1 27 | 1 28 | 3 0 2 2 0 29 | 4 2 30 | 0 31 | 1 32 | 2 0 1 0 -3 33 | 0 0 34 | 35 | // output 36 | Impossible 37 | 4 38 | Never -------------------------------------------------------------------------------- /src/Graph/P4195/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-4195] 친구 네트워크 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/123262959-6df8c380-d533-11eb-9260-68a31d9bcdd3.png) 4 | 5 | ### 풀이 과정 6 | 7 | - 친구 이름을 문자열로 받는다 -> HashMap 8 | - 친구 네트워크 구성 -> Union-Find 9 | - 친구 네트워크의 크기 구하기 -> size 배열 따로 선언 10 | 11 | 어느 정도 생각하게 만드는 좋은 문제였다. 😆 12 | 13 | ![image](https://user-images.githubusercontent.com/22045163/123262997-781ac200-d533-11eb-9192-95256efa8606.png) 14 | -------------------------------------------------------------------------------- /src/Graph/P4195/input.txt: -------------------------------------------------------------------------------- 1 | 2 2 | 3 3 | Fred Barney 4 | Barney Betty 5 | Betty Wilma 6 | 3 7 | Fred Barney 8 | Betty Wilma 9 | Barney Betty -------------------------------------------------------------------------------- /src/Graph/P4386/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-4386] 별자리 만들기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/109409702-473cdd00-79d8-11eb-8884-f41171a5b622.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/109409708-51f77200-79d8-11eb-8b03-779de0ec5c6d.png) 6 | -------------------------------------------------------------------------------- /src/Graph/P4386/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 1.0 1.0 3 | 2.0 2.0 4 | 2.0 4.0 -------------------------------------------------------------------------------- /src/Graph/P5719/input.txt: -------------------------------------------------------------------------------- 1 | 7 9 2 | 0 6 3 | 0 1 1 4 | 0 2 1 5 | 0 3 2 6 | 0 4 3 7 | 1 5 2 8 | 2 6 4 9 | 3 6 2 10 | 4 6 4 11 | 5 6 1 12 | 4 6 13 | 0 2 14 | 0 1 1 15 | 1 2 1 16 | 1 3 1 17 | 3 2 1 18 | 2 0 3 19 | 3 0 2 20 | 6 8 21 | 0 1 22 | 0 1 1 23 | 0 2 2 24 | 0 3 3 25 | 2 5 3 26 | 3 4 2 27 | 4 1 1 28 | 5 1 1 29 | 3 0 1 30 | 0 0 -------------------------------------------------------------------------------- /src/Graph/P9205/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-9205] 맥주 마시면서 걸어가기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/112498388-d4056b80-8dc9-11eb-917b-5213512f786a.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/112498484-ea132c00-8dc9-11eb-8608-d8fb4a4e95f8.png) 6 | -------------------------------------------------------------------------------- /src/Graph/P9205/input.txt: -------------------------------------------------------------------------------- 1 | 2 2 | 2 3 | 0 0 4 | 1000 0 5 | 1000 1000 6 | 2000 1000 7 | 2 8 | 0 0 9 | 1000 0 10 | 2000 1000 11 | 2000 2000 -------------------------------------------------------------------------------- /src/Graph/jo1863/input.txt: -------------------------------------------------------------------------------- 1 | 10 9 2 | 1 2 3 | 1 3 4 | 1 4 5 | 1 5 6 | 1 6 7 | 1 7 8 | 1 8 9 | 1 9 10 | 1 10 -------------------------------------------------------------------------------- /src/Graph/prg43162/README.md: -------------------------------------------------------------------------------- 1 | ## [programmers - 깊이/너비 우선 탐색(DFS/BFS)] 네트워크 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/109410733-617ab900-79e0-11eb-971c-eedfc9d6f6f9.png) 4 | -------------------------------------------------------------------------------- /src/Graph/prg49189/README.md: -------------------------------------------------------------------------------- 1 | ## [programmers - 그래프] 가장 먼 노드 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/116100368-ce13ea80-a6e7-11eb-9309-04ad089d34ca.png) 4 | -------------------------------------------------------------------------------- /src/Graph/prg49191/README.md: -------------------------------------------------------------------------------- 1 | ## [programmers - 그래프] 순위 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/116101038-77f37700-a6e8-11eb-91c3-02a1bb84052c.png) 4 | 5 | ### 유사한 문제 6 | 7 | [BOJ 2458 키 순서](../P2458) 문제와 비슷하며 풀이도 동일하게 해서 풀었다. 8 | -------------------------------------------------------------------------------- /src/Graph/swea1251/output.txt: -------------------------------------------------------------------------------- 1 | #1 10000 2 | #2 180000 3 | #3 1125000 4 | #4 1953913 5 | #5 27365366 6 | #6 337122 7 | #7 711268755613 8 | #8 280157 9 | #9 521568761 10 | #10 34 11 | #11 375890356686 12 | #12 68427157 13 | #13 21404 14 | #14 16620885 15 | #15 4776395492 16 | #16 54860981981 17 | #17 24236206202 18 | #18 132410 19 | #19 12876964085 20 | #20 7016649393 -------------------------------------------------------------------------------- /src/Graph/swea1263/output.txt: -------------------------------------------------------------------------------- 1 | #1 2 2 | #2 3 3 | #3 25 4 | #4 37 5 | #5 16 6 | #6 11 7 | #7 21 8 | #8 20 9 | #9 715 10 | #10 1449 -------------------------------------------------------------------------------- /src/Graph/swea3289/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 3289] 서로소 집합 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/111572932-e8a39b80-87ec-11eb-8591-827456e879c9.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/111572802-ac703b00-87ec-11eb-8130-26de5666732b.png) 6 | -------------------------------------------------------------------------------- /src/Graph/swea3289/sample_input.txt: -------------------------------------------------------------------------------- 1 | 1 2 | 7 8 3 | 0 1 3 4 | 1 1 7 5 | 0 7 6 6 | 1 7 1 7 | 0 3 7 8 | 0 4 2 9 | 0 1 1 10 | 1 1 1 11 | -------------------------------------------------------------------------------- /src/Greedy/P1092/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1092] 배 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/129473246-06c6ff5f-0894-4a13-904b-28967cc337ae.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/129473256-8964e3e1-0436-40fc-8452-45aeef24a7a9.png) 6 | -------------------------------------------------------------------------------- /src/Greedy/P1092/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 6 8 9 3 | 5 4 | 2 5 2 4 7 -------------------------------------------------------------------------------- /src/Greedy/P11047/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-11047] 동전 0 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/139080565-6db9e172-1a8b-457c-95b5-2167f4076856.png) 4 | 5 | 동전들이 배수 관계이므로 그리디하게 풀 수 있다 !! 6 | 7 | ![image](https://user-images.githubusercontent.com/22045163/139080602-267d1106-57d2-4552-aeb4-c75aade7e839.png) 8 | -------------------------------------------------------------------------------- /src/Greedy/P11047/input.txt: -------------------------------------------------------------------------------- 1 | 10 4790 2 | 1 3 | 5 4 | 10 5 | 50 6 | 100 7 | 500 8 | 1000 9 | 5000 10 | 10000 11 | 50000 -------------------------------------------------------------------------------- /src/Greedy/P1343/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1343] 폴리오미노 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/122774345-11539980-d2e4-11eb-88b6-1ee2603c0169.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/122774391-19133e00-d2e4-11eb-9689-a89de586fcd4.png) 6 | -------------------------------------------------------------------------------- /src/Greedy/P1343/input.txt: -------------------------------------------------------------------------------- 1 | XXXXXX -------------------------------------------------------------------------------- /src/Greedy/P2839/Main.java: -------------------------------------------------------------------------------- 1 | package Greedy.P2839; 2 | 3 | import java.util.Scanner; 4 | 5 | public class Main { 6 | 7 | public static void main(String[] args) { 8 | Scanner sc = new Scanner(System.in); 9 | int N = sc.nextInt(); 10 | int ans = 0; 11 | while (N > 0) { 12 | if (N%5==0) { ans += N/5; N = 0; } 13 | else { ans ++; N-= 3; } 14 | } 15 | if (N < 0) System.out.println(-1); 16 | else System.out.println(ans); 17 | } 18 | } -------------------------------------------------------------------------------- /src/Greedy/P2839/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2839] 설탕 배달 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/108313759-2f0cd700-71fc-11eb-9d3f-36acbec3d89f.png) 4 | 5 | ### Greedy Algorithm vs DP 6 | 7 | - [using Greedy Alg](Main.java) 8 | ![image](https://user-images.githubusercontent.com/22045163/108313951-77c49000-71fc-11eb-8ec5-c4b1fb8b2e0a.png) 9 | 10 | - [using DP](usingDP.java) 11 | ![image](https://user-images.githubusercontent.com/22045163/108313992-857a1580-71fc-11eb-990b-564ab4aab094.png) 12 | -------------------------------------------------------------------------------- /src/Greedy/P2839/usingDP.java: -------------------------------------------------------------------------------- 1 | package Greedy.P2839; 2 | 3 | import java.util.*; 4 | 5 | public class usingDP { 6 | 7 | public static void main(String[] args) { 8 | Scanner sc = new Scanner(System.in); 9 | 10 | int N = sc.nextInt(); 11 | 12 | int[] dp = new int[5001]; 13 | Arrays.fill(dp, 5000); 14 | 15 | dp[3] = 1; 16 | dp[5] = 1; 17 | for (int i = 6; i <= N; i++) { 18 | dp[i] = Math.min(dp[i-3], dp[i-5]) + 1; 19 | } 20 | 21 | if (dp[N] >= 5000) System.out.println(-1); 22 | else System.out.println(dp[N]); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Greedy/P2847/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2847] 게임을 만든 동준이 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/139077177-ccc8c617-7ad0-499a-95e8-dc9a6d8f7d14.png) 4 | 5 | 생각의 흐름대로 정확하게 코드를 짜면 되는 문제였다. 6 | 7 | ![image](https://user-images.githubusercontent.com/22045163/139077023-efa78ce2-2108-480e-a1ac-79d8266400e8.png) 8 | -------------------------------------------------------------------------------- /src/Greedy/P2847/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 5 3 | 5 4 | 5 -------------------------------------------------------------------------------- /src/Greedy/jo1828/README.md: -------------------------------------------------------------------------------- 1 | ## [JUNGOL-1828] 냉장고 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/108316778-b52b1c80-7200-11eb-9849-3f9b3aab0c8b.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/108316806-bf4d1b00-7200-11eb-8ce1-a026c455d2c7.png) 6 | -------------------------------------------------------------------------------- /src/Hash/P1764/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1764] 듣보잡 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/115133913-acab6280-a046-11eb-89ff-4b14483bb6c0.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/115133921-b339da00-a046-11eb-8473-6d78f9918321.png) 6 | -------------------------------------------------------------------------------- /src/Hash/P1764/input.txt: -------------------------------------------------------------------------------- 1 | 3 4 2 | ohhenrie 3 | charlie 4 | baesangwook 5 | obama 6 | baesangwook 7 | ohhenrie 8 | clinton -------------------------------------------------------------------------------- /src/Hash/prg42576/README.md: -------------------------------------------------------------------------------- 1 | ## [programmers - 해시] 완주하지 못한 선수 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/115870709-95bba480-a47a-11eb-82e3-1a5b1e9ca39b.png) 4 | -------------------------------------------------------------------------------- /src/Hash/prg42576/Solution.java: -------------------------------------------------------------------------------- 1 | package Hash.prg42576; 2 | 3 | import java.util.*; 4 | 5 | class Solution { 6 | 7 | HashMap map = new HashMap<>(); 8 | 9 | public String solution(String[] participant, String[] completion) { 10 | 11 | for (String p : participant) { 12 | map.merge(p, 1, Integer::sum); 13 | } 14 | 15 | for (String c : completion) { 16 | if (map.get(c) == 1) map.remove(c); 17 | else map.put(c, map.get(c)-1); 18 | } 19 | 20 | String ans = ""; 21 | for (String s : map.keySet()) ans = s; 22 | 23 | return ans; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Hash/prg42577/README.md: -------------------------------------------------------------------------------- 1 | ## [programmers - 해시] 전화번호 목록 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/115870938-e4693e80-a47a-11eb-9bcf-c13922426edd.png) 4 | -------------------------------------------------------------------------------- /src/Hash/prg42577/Solution.java: -------------------------------------------------------------------------------- 1 | package Hash.prg42577; 2 | 3 | import java.util.*; 4 | 5 | class Solution { 6 | 7 | HashSet set = new HashSet<>(); 8 | 9 | public boolean solution(String[] phone_book) { 10 | 11 | Collections.addAll(set, phone_book); 12 | 13 | for (String p : phone_book) { 14 | for (int i = 1; i < p.length(); i++) { 15 | if (set.contains(p.substring(0, i))) return false; 16 | } 17 | } 18 | 19 | return true; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Hash/prg42578/README.md: -------------------------------------------------------------------------------- 1 | ## [programmers - 해시] 위장 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/115871061-0793ee00-a47b-11eb-9a9b-f3343273b160.png) 4 | 5 | ### 경우의 수 구하기 : 시간초과 이슈 6 | 7 | 처음에 경우의 수를 부분집합으로 구했으나 시간초과가 났다. 대신 조금 찾아보니 경우의 수를 훨씬 쉽게 구할 수 있는 방법이 있었다. 8 | 9 | > 만약 A 종류의 옷이 3개가 있다면 경우의 수는 이 3가지를 입는경우 + 이 종류를 입지 않는 경우 1 = 4가지가 된다. 이런식으로 모든 종류의 옷 개수에 1을 더해준 후 모두 곱하면 이를 모두 고려한 개수가 나오며, 여기서 1을 빼주면 모두 입지 않은 경우를 제외하기 때문에 정답이 된다. 10 | > 출처 : [프로그래머스 - 위장 @so-soon](https://velog.io/@so-soon/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EC%9C%84%EC%9E%A5) 11 | 12 | 기억하고 있다가 다음에 비슷한 문제가 나오면 써먹자 !! 13 | -------------------------------------------------------------------------------- /src/Hash/prg42578/Solution.java: -------------------------------------------------------------------------------- 1 | package Hash.prg42578; 2 | 3 | import java.util.*; 4 | 5 | class Solution { 6 | 7 | HashMap map = new HashMap<>(); 8 | int ans = 1; 9 | 10 | public int solution(String[][] clothes) { 11 | 12 | for (String[] c : clothes) { 13 | map.merge(c[1], 1, Integer::sum); 14 | } 15 | 16 | for (int val : map.values()) { 17 | ans *= val+1; 18 | } 19 | 20 | return ans-1; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Hash/prg42579/README.md: -------------------------------------------------------------------------------- 1 | ## [programmers - 해시] 베스트앨범 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/111806341-39aeaf00-8915-11eb-802b-f34cc1f74967.png) 4 | -------------------------------------------------------------------------------- /src/Heap/P11279/input.txt: -------------------------------------------------------------------------------- 1 | 13 2 | 0 3 | 1 4 | 2 5 | 3 6 | 2 7 | 1 8 | 0 9 | 0 10 | 0 11 | 0 12 | 0 13 | 0 14 | 0 -------------------------------------------------------------------------------- /src/Heap/P11286/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-11286] 절댓값 힙 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/122013338-0c30af00-cdf9-11eb-8c56-2464b8789ed7.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/122013382-1783da80-cdf9-11eb-9145-36d86c53007b.png) 6 | -------------------------------------------------------------------------------- /src/Heap/P11286/input.txt: -------------------------------------------------------------------------------- 1 | 18 2 | 1 3 | -1 4 | 0 5 | 0 6 | 0 7 | 1 8 | 1 9 | -1 10 | -1 11 | 2 12 | -2 13 | 0 14 | 0 15 | 0 16 | 0 17 | 0 18 | 0 19 | 0 -------------------------------------------------------------------------------- /src/Heap/P1202/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 2 | 1 65 3 | 5 23 4 | 2 99 5 | 10 6 | 2 -------------------------------------------------------------------------------- /src/Heap/P1927/input.txt: -------------------------------------------------------------------------------- 1 | 31 2 | 4 3 | 15 4 | 11 5 | 20 6 | 13 7 | 19 8 | 23 9 | 3 10 | 24 11 | 99 12 | 193 13 | 1 14 | 3 15 | 483 16 | 213 17 | 0 18 | 0 19 | 0 20 | 0 21 | 0 22 | 0 23 | 0 24 | 0 25 | 0 26 | 0 27 | 0 28 | 0 29 | 0 30 | 0 31 | 0 32 | 0 -------------------------------------------------------------------------------- /src/Heap/P7662/input.txt: -------------------------------------------------------------------------------- 1 | 2 2 | 7 3 | I 16 4 | I -5643 5 | D 1 6 | D -1 7 | D 1 8 | I 123 9 | D -1 10 | 9 11 | I -45 12 | I 653 13 | D 1 14 | I -642 15 | I 45 16 | I 97 17 | D 1 18 | D -1 19 | I 333 -------------------------------------------------------------------------------- /src/Heap/prg42626/README.md: -------------------------------------------------------------------------------- 1 | ## [programmers - 힙(Heap)] 더 맵게 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/105866064-ec117680-6036-11eb-9f70-bb5f4e473154.png) 4 | -------------------------------------------------------------------------------- /src/Heap/prg42627/README.md: -------------------------------------------------------------------------------- 1 | ## [programmers - 힙(Heap)] 디스크 컨트롤러 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/106354998-d5ba3200-6338-11eb-9443-f56944ccecee.png) 4 | -------------------------------------------------------------------------------- /src/Heap/prg42628/README.md: -------------------------------------------------------------------------------- 1 | ## [programmers - 힙(Heap)] 이중우선순위큐 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/106357160-b4ad0d80-6347-11eb-943e-46361de1664f.png) 4 | -------------------------------------------------------------------------------- /src/Implementation/P10713/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-10713] 기차 여행 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/125199554-ade4d800-e2a1-11eb-9166-1f5708a354d0.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/125199565-b89f6d00-e2a1-11eb-8d5e-db37e41aeb2d.png) 5 | 6 | ### 정수 범위 생각하기 7 | 8 | 해당 문제에서 자꾸 50점이 나와 처음에는 시간 문제인줄 알고 여러 시도를 해보았으나 아니었다. 제한을 살펴보면 계산해봤을 때 비용이 정수 범위를 훨씬 넘어갈 수 있는데 `int`로 계산한 것이 문제였다. 앞으로 시간 뿐만 아니라 타입도 잘 살펴보고 코딩하자 !! (그래도 `long`으로 바꾸고 돌렸을 때, 이전에 실행 시간을 줄이려던 시도를 많이 했던 덕분에 짧은 코드와 실행 시간의 결과를 볼 수 있었다. 기분은 좋아 🤣) 9 | 10 | ![image](https://user-images.githubusercontent.com/22045163/125199576-c2c16b80-e2a1-11eb-88f1-d4797ab93694.png) 11 | -------------------------------------------------------------------------------- /src/Implementation/P10713/input.txt: -------------------------------------------------------------------------------- 1 | 8 5 2 | 7 5 3 5 4 3 | 12 5 8 4 | 16 2 1 5 | 3 1 5 6 | 17 12 17 7 | 19 7 5 8 | 12 2 19 9 | 4 1 3 -------------------------------------------------------------------------------- /src/Implementation/P11005/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-11005] 진법 변환 2 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/125201216-108da200-e2a9-11eb-8c6b-4fb590cf9b80.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/125201224-1a170a00-e2a9-11eb-9b8e-a81d40ec9ab6.png) 6 | -------------------------------------------------------------------------------- /src/Implementation/P11005/input.txt: -------------------------------------------------------------------------------- 1 | 10 2 -------------------------------------------------------------------------------- /src/Implementation/P12933/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-12933] 오리 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/122787353-364e0980-d2f0-11eb-9dc2-b1633fa622f3.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/122787405-449c2580-d2f0-11eb-85a6-1c02c00fe13c.png) 6 | -------------------------------------------------------------------------------- /src/Implementation/P12933/input.txt: -------------------------------------------------------------------------------- 1 | quackqauckquack -------------------------------------------------------------------------------- /src/Implementation/P15787/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-15787] 기차가 어둠을 헤치고 은하수를 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/117337491-6411f700-aed8-11eb-84d2-867467c05e87.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/117337518-6c6a3200-aed8-11eb-9d9a-380a36129f1b.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/117337545-755b0380-aed8-11eb-9576-e7098f5aded9.png) 7 | -------------------------------------------------------------------------------- /src/Implementation/P15787/input.txt: -------------------------------------------------------------------------------- 1 | 5 5 2 | 1 1 1 3 | 1 1 2 4 | 1 2 2 5 | 1 2 3 6 | 3 1 -------------------------------------------------------------------------------- /src/Implementation/P16463/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-16463] 13일의 금요일 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/116836819-f24d5b00-ac02-11eb-8b2d-3a645098f733.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/116836821-f8433c00-ac02-11eb-9eb4-5da91b8a5978.png) 6 | -------------------------------------------------------------------------------- /src/Implementation/P16463/input.txt: -------------------------------------------------------------------------------- 1 | 100000 -------------------------------------------------------------------------------- /src/Implementation/P16719/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-16719] ZOAC 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/117327661-cfa29700-aecd-11eb-9d58-7a65d01b42bf.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/117327708-de894980-aecd-11eb-8206-73d50ed989d8.png) 6 | -------------------------------------------------------------------------------- /src/Implementation/P16719/input.txt: -------------------------------------------------------------------------------- 1 | ZOAC -------------------------------------------------------------------------------- /src/Implementation/P20546/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-20546] 기적의 매매법 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/119229482-4210a980-bb53-11eb-8eb3-cd330d0f7ca3.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/119229492-4a68e480-bb53-11eb-9f86-97a42ff5c0fa.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/119229497-52288900-bb53-11eb-9011-bede31579d14.png) 7 | -------------------------------------------------------------------------------- /src/Implementation/P20546/input.txt: -------------------------------------------------------------------------------- 1 | 100 2 | 10 20 23 34 55 30 22 19 12 45 23 44 34 38 -------------------------------------------------------------------------------- /src/Implementation/P21608/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-21608] 상어 초등학교 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/116638010-502e3880-a9a0-11eb-8cbe-c1864d635d3d.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/116638037-5d4b2780-a9a0-11eb-9fc8-8acdf4b549f6.png) 5 | ![image](https://user-images.githubusercontent.com/22045163/116638051-66d48f80-a9a0-11eb-8066-a61bd54f6684.png) 6 | 7 | ![image](https://user-images.githubusercontent.com/22045163/116638061-70f68e00-a9a0-11eb-90db-e80207d7e18b.png) 8 | -------------------------------------------------------------------------------- /src/Implementation/P21608/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 4 2 5 1 7 3 | 2 1 9 4 5 4 | 5 8 1 4 3 5 | 1 2 9 3 4 6 | 7 2 3 4 8 7 | 9 8 4 5 7 8 | 6 5 2 3 4 9 | 8 4 9 2 1 10 | 3 9 2 1 4 -------------------------------------------------------------------------------- /src/Implementation/P2615/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2615] 오목 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/117129244-693c4c80-add9-11eb-8ad9-21daac7099d1.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/117129282-748f7800-add9-11eb-8387-a1d274a991a2.png) 5 | 6 | ### 세심하게 풀어야 한다 7 | 8 | 이 문제는 주의할 점이 많다 ! 이런 문제는 세심하게, 정확하게 ㅠㅠㅠ 풀자 ㅠㅠ !! 9 | 10 | - 바둑판을 순차적으로 순회하며 이미 6개라고 세고 지나온 후, 다시 세면 5개일 수 있다. 그러면 바로 버그 ~ 11 | - 만일 ↙ 이 방향으로 오목이라면 제일 왼쪽 인덱스를 계산해서 출력해줘야 한다. 12 | 13 | ![image](https://user-images.githubusercontent.com/22045163/117129369-8d982900-add9-11eb-9435-80b3bb13137c.png) 14 | -------------------------------------------------------------------------------- /src/Implementation/P2877/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2877] 4와 7 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/126055220-45580f39-7544-4f74-a181-12d97b7a80cc.png) 4 | 5 | ### 메모리 초과 6 | 7 | 처음엔 DP 문제인가 해서 DP로 풀었더니 메모리 초과 이슈가 발생했다. 8 | 잘 보고 더 효율적인 풀이를 생각하면서 풀자 !! 9 | 10 | ![image](https://user-images.githubusercontent.com/22045163/126055222-eaea2f54-947d-4e22-9733-fbf51a96d532.png) 11 | -------------------------------------------------------------------------------- /src/Implementation/P2877/input.txt: -------------------------------------------------------------------------------- 1 | 6 -------------------------------------------------------------------------------- /src/Implementation/P4396/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-4396] 지뢰 찾기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/119233171-9ec79080-bb62-11eb-88fe-1a95597dfbbd.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/119233174-a5ee9e80-bb62-11eb-8e9a-632a86b043f3.png) 6 | -------------------------------------------------------------------------------- /src/Implementation/P4396/input.txt: -------------------------------------------------------------------------------- 1 | 8 2 | ...**..* 3 | ......*. 4 | ....*... 5 | ........ 6 | ........ 7 | .....*.. 8 | ...**.*. 9 | .....*.. 10 | xxx..... 11 | xxxx.... 12 | xxxx.... 13 | xxxxx... 14 | xxxxx... 15 | xxxxx... 16 | xxx..... 17 | xxxxx... -------------------------------------------------------------------------------- /src/Implementation/prg70130/README.md: -------------------------------------------------------------------------------- 1 | ## [programmers - 월간 코드 챌린지 시즌1] 스타 수열 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/120893357-d861c680-c64d-11eb-9cd7-1dae1ef20106.png) 4 | -------------------------------------------------------------------------------- /src/Implementation/prg84512/README.md: -------------------------------------------------------------------------------- 1 | ## [programmers - 구현] 모음 사전 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/133930591-7d690c28-b5b8-4c36-9e7f-82cf1a600ef3.png) 4 | -------------------------------------------------------------------------------- /src/Implementation/prg85002/README.md: -------------------------------------------------------------------------------- 1 | ## [programmers - 구현] 복서 정렬하기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/133928178-aa478321-faf1-4297-9cba-341c793990d9.png) 4 | -------------------------------------------------------------------------------- /src/Implementation/prg86048/README.md: -------------------------------------------------------------------------------- 1 | ## [programmers - 구현] 입실 퇴실 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/133926682-1efe7717-8e21-4107-957d-1549c9f0ba1d.png) 4 | -------------------------------------------------------------------------------- /src/IndexedTree/P10868/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-10868] 최솟값 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/105010735-6febc180-5a7f-11eb-87dc-64100377dbf7.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/105010768-77ab6600-5a7f-11eb-9fc6-9442d6a7b7d3.png) 6 | -------------------------------------------------------------------------------- /src/IndexedTree/P10868/input.txt: -------------------------------------------------------------------------------- 1 | 10 4 2 | 75 3 | 30 4 | 100 5 | 38 6 | 50 7 | 51 8 | 52 9 | 20 10 | 81 11 | 5 12 | 1 10 13 | 3 5 14 | 6 9 15 | 8 10 -------------------------------------------------------------------------------- /src/IndexedTree/P11505/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 3 2 | 1000000 3 | 1000000 4 | 1000000 5 | 1000000 6 | 1000000 7 | 2 1 5 8 | 1 3 0 9 | 2 2 5 10 | 1 3 6 11 | 2 2 5 -------------------------------------------------------------------------------- /src/IndexedTree/P1275/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1275] 커피숍2 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/104669124-c4f4a400-571c-11eb-819c-09ec291c56fb.png) 4 | -------------------------------------------------------------------------------- /src/IndexedTree/P1275/input.txt: -------------------------------------------------------------------------------- 1 | 5 3 2 | 1 2 3 4 5 3 | 2 3 3 1 4 | 3 5 4 1 5 | 5 1 2 3 -------------------------------------------------------------------------------- /src/IndexedTree/P12837/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-12837] 가계부 (Hard) 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/104865813-5adc3900-5980-11eb-8391-dbde17af9525.png) 4 | 5 | ### 문제 이해 6 | 7 | 처음에 문제를 잘못 이해해서 문제를 틀리게 되었다. 8 | 해당 문제의 1번 쿼리는 **값을 변경하는 것이 아니라, 추가하는 것**이라고 나와있다. 9 | 문제를 잘 읽어야 한다. 10 | 11 | ![image](https://user-images.githubusercontent.com/22045163/104865962-b3133b00-5980-11eb-8aa2-88f70d0bcfb3.png) 12 | -------------------------------------------------------------------------------- /src/IndexedTree/P12837/input.txt: -------------------------------------------------------------------------------- 1 | 10 7 2 | 1 3 10000 3 | 1 4 -5000 4 | 1 7 -3000 5 | 2 4 7 6 | 1 6 35000 7 | 2 4 10 8 | 2 3 4 9 | 10 | 99 3 11 | 1 1 1 12 | 1 1 1 13 | 2 1 1 14 | 15 | 16 | 17 | //output 18 | 2000 19 | 27000 20 | 21 | 10 10 22 | 1 1 1 23 | 1 2 2 24 | 1 3 3 25 | 1 4 4 26 | 1 5 5 27 | 1 6 6 28 | 1 7 7 29 | 1 8 8 30 | 1 9 9 31 | 1 10 10 32 | 33 | -------------------------------------------------------------------------------- /src/IndexedTree/P2042/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 2 2 | 1 3 | 2 4 | 3 5 | 4 6 | 5 7 | 1 3 6 8 | 2 2 5 9 | 1 5 2 10 | 2 3 5 -------------------------------------------------------------------------------- /src/IndexedTree/P2243/input.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 2 1 2 3 | 2 3 3 4 | 1 2 5 | 1 2 6 | 2 1 -1 7 | 1 2 -------------------------------------------------------------------------------- /src/IndexedTree/P2268/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2268] 수들의 합 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/104674536-27eb3880-5727-11eb-8fbc-b7b6ca110e4a.png) 4 | -------------------------------------------------------------------------------- /src/IndexedTree/P2268/input.txt: -------------------------------------------------------------------------------- 1 | 3 5 2 | 0 1 3 3 | 1 1 2 4 | 1 2 3 5 | 0 2 3 6 | 0 1 3 -------------------------------------------------------------------------------- /src/IndexedTree/P2357/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2357] 최솟값과 최댓값 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/104977584-35fcca00-5a43-11eb-9741-0a468b3e6739.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/104977602-414ff580-5a43-11eb-839a-c60d3778b34c.png) 6 | -------------------------------------------------------------------------------- /src/IndexedTree/P2357/input.txt: -------------------------------------------------------------------------------- 1 | 10 4 2 | 75 3 | 30 4 | 100 5 | 38 6 | 50 7 | 51 8 | 52 9 | 20 10 | 81 11 | 5 12 | 1 10 13 | 3 5 14 | 6 9 15 | 8 10 -------------------------------------------------------------------------------- /src/IndexedTree/P5676/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 2 | 0 0 0 3 | C 3 1 4 | P 3 3 5 | 10 1 6 | 100 100 100 100 100 100 100 100 100 10 7 | P 1 10 8 | 4 6 9 | -2 6 0 -1 10 | C 1 10 11 | P 1 4 12 | C 3 7 13 | P 2 2 14 | C 4 -5 15 | P 1 4 16 | 5 9 17 | 1 5 -2 4 3 18 | P 1 2 19 | P 1 5 20 | C 4 -5 21 | P 1 5 22 | P 4 5 23 | C 3 0 24 | P 1 5 25 | C 4 -5 26 | C 4 -52 -------------------------------------------------------------------------------- /src/Iterations/BinaryGap/README.md: -------------------------------------------------------------------------------- 1 | ## [Codility - Lesson 1 Iterations] BinaryGap 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/101761832-f972b000-3b1f-11eb-80fd-7c05c6a919e2.png) 4 | -------------------------------------------------------------------------------- /src/Iterations/swea1289/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 1289] 원재의 메모리 복구하기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/106429941-7ed66900-64ae-11eb-89ca-e161485f6530.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/106429801-48005300-64ae-11eb-82d9-1076ad145137.png) 6 | -------------------------------------------------------------------------------- /src/Iterations/swea1289/input.txt: -------------------------------------------------------------------------------- 1 | 2 2 | 0011 3 | 100 -------------------------------------------------------------------------------- /src/Iterations/swea3499/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 3499] 퍼펙트 셔플 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/107465129-09048880-6ba5-11eb-8928-25db1d1a78aa.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/107465145-13268700-6ba5-11eb-86f6-9a258c6d4fa5.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/107465171-246f9380-6ba5-11eb-85bb-031f440e225f.png) 7 | -------------------------------------------------------------------------------- /src/Iterations/swea3499/sample_input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 6 3 | A B C D E F 4 | 4 5 | JACK QUEEN KING ACE 6 | 5 7 | ALAKIR ALEXSTRASZA DR-BOOM LORD-JARAXXUS AVIANA 8 | 9 | 2 10 | 8 11 | 1 2 3 4 5 6 7 8 12 | 9 13 | 1 2 3 4 5 6 7 8 9 -------------------------------------------------------------------------------- /src/Iterations/swea3499/sample_output.txt: -------------------------------------------------------------------------------- 1 | #1 A D B E C F 2 | #2 JACK KING QUEEN ACE 3 | #3 ALAKIR LORD-JARAXXUS ALEXSTRASZA AVIANA DR-BOOM 4 | -------------------------------------------------------------------------------- /src/Iterations/swea4789/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 4789] 성공적인 공연 기획 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/109184908-c95bb480-77d2-11eb-9f6d-735237c63e59.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/109185021-e98b7380-77d2-11eb-95fc-ccb601168612.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/109185064-f4460880-77d2-11eb-8803-f5a1ef411c76.png) 7 | -------------------------------------------------------------------------------- /src/Iterations/swea4789/sample_input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 11111 3 | 09 4 | 110011 5 | 1 -------------------------------------------------------------------------------- /src/Iterations/swea4789/sample_output.txt: -------------------------------------------------------------------------------- 1 | #1 0 2 | #2 1 3 | #3 2 4 | #4 0 -------------------------------------------------------------------------------- /src/Iterations/swea5356/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 5356] 의석이의 세로로 말해요 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/109176179-e344c980-77c9-11eb-8e2b-da16e09664d0.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/109176234-f061b880-77c9-11eb-816b-15e2ee25d51d.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/109176321-096a6980-77ca-11eb-9ed9-70477c8a62dd.png) 7 | -------------------------------------------------------------------------------- /src/Iterations/swea5356/sample_input.txt: -------------------------------------------------------------------------------- 1 | 2 2 | ABCDE 3 | abcde 4 | 01234 5 | FGHIJ 6 | fghij 7 | AABCDD 8 | afzz 9 | 09121 10 | a8EWg6 11 | P5h3kx -------------------------------------------------------------------------------- /src/Iterations/swea5356/sample_output.txt: -------------------------------------------------------------------------------- 1 | #1 Aa0FfBb1GgCc2HhDd3IiEe4Jj 2 | #2 Aa0aPAf985Bz1EhCz2W3D1gkD6x -------------------------------------------------------------------------------- /src/Iterations/swea6485/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 6485] 삼성시의 버스 노선 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/109165551-074edd80-77bf-11eb-8eda-47fbfa7434a9.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/109165606-15046300-77bf-11eb-9b08-ae41f4a2c08e.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/109165778-4c730f80-77bf-11eb-808c-f2e56848e859.png) 7 | -------------------------------------------------------------------------------- /src/Iterations/swea6485/s_input.txt: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 1 3 4 | 2 5 5 | 5 6 | 1 7 | 2 8 | 3 9 | 4 10 | 5 -------------------------------------------------------------------------------- /src/Iterations/swea6485/s_output.txt: -------------------------------------------------------------------------------- 1 | #1 1 2 2 1 1 -------------------------------------------------------------------------------- /src/Iterations/swea7964/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 7964] 부먹왕국의 차원 관문 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/109156080-c8675a80-77b3-11eb-8cd3-b342cc682bb5.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/109156125-d1f0c280-77b3-11eb-8ab6-e0078da11284.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/109156160-dcab5780-77b3-11eb-9ca6-c9d83bad3ca1.png) 7 | -------------------------------------------------------------------------------- /src/Iterations/swea7964/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 6 2 3 | 1 0 0 0 0 1 4 | 10 2 5 | 0 0 1 0 1 0 0 0 0 1 6 | 10 1 7 | 0 0 0 0 0 0 0 0 0 0 -------------------------------------------------------------------------------- /src/Iterations/swea7964/output.txt: -------------------------------------------------------------------------------- 1 | #1 2 2 | #2 3 3 | #3 10 -------------------------------------------------------------------------------- /src/List/P18115/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-18115] 카드 놓기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/121654383-a1216880-cad8-11eb-98a6-ad277dc1d137.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/121654451-b39ba200-cad8-11eb-9ec3-3cd0cea68e5a.png) 6 | -------------------------------------------------------------------------------- /src/List/P18115/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 2 3 3 2 1 -------------------------------------------------------------------------------- /src/Math/P13458/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-13458] 시험 감독 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/107942623-d73d5880-6fce-11eb-9800-bde8a37b040f.png) 4 | 5 | ### 주의해야 할 점 6 | 7 | - 문제의 범위를 고려했을 때 총 감독관 수를 담을 변수의 자료형은 `long`이어야 한다. 8 | - `A[i] - B`의 값이 음수일 경우 나눗셈을 했을 때 음수값이 나올 수 있으므로 해당 값이 0을 넘을 때만 계산하도록 조건을 추가해주어야 한다. 9 | 10 | ![image](https://user-images.githubusercontent.com/22045163/107942648-e3291a80-6fce-11eb-91e5-5a4deb939c0d.png) 11 | -------------------------------------------------------------------------------- /src/Math/P13458/input.txt: -------------------------------------------------------------------------------- 1 | 1 2 | 1 3 | 50 2 -------------------------------------------------------------------------------- /src/Math/P2108/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2108] 통계학 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/129475818-72afddae-5b97-4c8c-9f50-ac3471a65288.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/129475822-05dfdbc4-9ff5-44d7-9884-61227dfe0265.png) 6 | -------------------------------------------------------------------------------- /src/Math/P2108/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | -1 3 | -2 4 | -3 5 | -1 6 | -2 -------------------------------------------------------------------------------- /src/Math/P21275/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-21275] 폰 호석만 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/113019073-2b398080-91bc-11eb-9eae-a3a1001796d0.png) 4 | 5 | 주어진 범위를 놓고 계산해보면 완전 탐색으로 풀 수 있는 문제이니 겁먹을 필요 없다. 6 | 7 | ![image](https://user-images.githubusercontent.com/22045163/113019102-342a5200-91bc-11eb-9833-1f567cac7596.png) 8 | -------------------------------------------------------------------------------- /src/Math/P21275/input.txt: -------------------------------------------------------------------------------- 1 | 2222222222222222222222222222222222222222222222222222222222222222222222 8888888888888888888888888888888 -------------------------------------------------------------------------------- /src/Math/swea8382/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 8382] 방향 전환 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/115247366-b1b10480-a161-11eb-9888-43865cbb073a.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/115247421-bb3a6c80-a161-11eb-84f5-c9b286a24436.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/115247520-cf7e6980-a161-11eb-8ada-c49a9b06429b.png) 7 | -------------------------------------------------------------------------------- /src/Math/swea8382/sample_input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 0 0 1 0 3 | -1 -1 0 0 4 | 0 0 0 2 -------------------------------------------------------------------------------- /src/Math/swea8382/sample_output.txt: -------------------------------------------------------------------------------- 1 | #1 1 2 | #2 2 3 | #3 4 -------------------------------------------------------------------------------- /src/Permutation/P10972/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-10972] 다음 순열 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/94270585-3bf20b00-ff7b-11ea-8d3b-631446389a23.png) 4 | -------------------------------------------------------------------------------- /src/Permutation/P10972/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 1 2 3 4 -------------------------------------------------------------------------------- /src/Permutation/P10973/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-10973] 이전 순열 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/94273407-57f7ab80-ff7f-11ea-83c0-d09ab01ed3c1.png) 4 | -------------------------------------------------------------------------------- /src/Permutation/P10973/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 5 4 3 2 1 -------------------------------------------------------------------------------- /src/Permutation/P10974/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-10974] 모든 순열 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/94263708-70ac9500-ff70-11ea-9635-23718e9586ba.png) 4 | -------------------------------------------------------------------------------- /src/Permutation/P1722/README.md: -------------------------------------------------------------------------------- 1 | ### 범위 2 | 3 | > N(1≤N≤20), k(1≤k≤N!) 4 | 5 | 최대 범위 : 20! < long.Max -------------------------------------------------------------------------------- /src/Permutation/P1722/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 2 3 2 1 4 -------------------------------------------------------------------------------- /src/Permutation/P5568/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 2 3 | 1 4 | 2 5 | 12 6 | 1 -------------------------------------------------------------------------------- /src/Permutation/P9742/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-9742] 순열 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/106979827-73cb5380-67a2-11eb-94b7-549cafdb4865.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/106979878-8ba2d780-67a2-11eb-8231-cb33dfa3a189.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/106980001-c86ece80-67a2-11eb-8608-6a3654252a5a.png) 7 | -------------------------------------------------------------------------------- /src/Permutation/P9742/input.txt: -------------------------------------------------------------------------------- 1 | 235 4 2 | bein 20 3 | 123456 700 4 | mnpqr 130 5 | tuvwxyz 4000 -------------------------------------------------------------------------------- /src/Permutation/swea6808/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 6808] 규영이와 인영이의 카드게임 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/107907524-4b5c0a00-6f97-11eb-9199-21c58a642ae3.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/107907540-557e0880-6f97-11eb-8fea-5c0e545ac5d6.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/107907575-675fab80-6f97-11eb-8796-dca1fe2e5b9f.png) 7 | -------------------------------------------------------------------------------- /src/Permutation/swea6808/s_input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 1 3 5 7 9 11 13 15 17 3 | 18 16 14 12 10 8 6 4 2 4 | 13 17 9 5 18 7 11 1 15 5 | 1 6 7 9 12 13 15 17 18 -------------------------------------------------------------------------------- /src/Permutation/swea6808/s_output.txt: -------------------------------------------------------------------------------- 1 | #1 112097 250783 2 | #2 250783 112097 3 | #3 336560 26320 4 | #4 346656 16224 -------------------------------------------------------------------------------- /src/Prime/P1644/input.txt: -------------------------------------------------------------------------------- 1 | 53 -------------------------------------------------------------------------------- /src/Prime/P1929/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1929] 소수 구하기 2 | 3 | image 4 | 5 | image 6 | -------------------------------------------------------------------------------- /src/Prime/P1978/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1978] 소수 찾기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/93660931-bf4cc180-fa8e-11ea-883b-8e93d2465c4a.png) 4 | -------------------------------------------------------------------------------- /src/Prime/swea4698/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 4698] 테네스의 특별한 소수 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/109188527-623fff00-77d6-11eb-8ceb-ec66155a0e35.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/109188601-6f5cee00-77d6-11eb-97ad-b06c00d9a4f0.png) 6 | -------------------------------------------------------------------------------- /src/Prime/swea4698/sample_input.txt: -------------------------------------------------------------------------------- 1 | 2 2 | 3 10 30 3 | 7 1 1000000 -------------------------------------------------------------------------------- /src/Prime/swea4698/sample_output.txt: -------------------------------------------------------------------------------- 1 | #1 2 2 | #2 43506 -------------------------------------------------------------------------------- /src/Probability/P13251/input.txt: -------------------------------------------------------------------------------- 1 | 1 2 | 13 3 | 8 -------------------------------------------------------------------------------- /src/Queue/P10845/input.txt: -------------------------------------------------------------------------------- 1 | 15 2 | push 1 3 | push 2 4 | front 5 | back 6 | size 7 | empty 8 | pop 9 | pop 10 | pop 11 | size 12 | empty 13 | pop 14 | push 3 15 | empty 16 | front -------------------------------------------------------------------------------- /src/Queue/P1158/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1158] 요세푸스 문제 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/107318016-18210300-6adf-11eb-9edd-e33361c234e6.png) 4 | 5 | ### 다양한 자료구조를 이용한 풀이법 6 | 7 | - [Using Array (14672KB / 420ms)](Main.java) 8 | - [Using ArrayList (15044KB / 156ms)](Main2.java) 9 | - [Using Queue (295780KB / 540ms)](Main3.java) 10 | 11 | ![image](https://user-images.githubusercontent.com/22045163/107318059-325ae100-6adf-11eb-86c0-b82465a20f43.png) 12 | -------------------------------------------------------------------------------- /src/Queue/P1158/input.txt: -------------------------------------------------------------------------------- 1 | 7 3 -------------------------------------------------------------------------------- /src/Queue/P18258/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-18258] 큐 2 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/121133338-2b659480-c86d-11eb-9e35-7e06665d7223.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/121133391-3a4c4700-c86d-11eb-8efb-a805d4ff962f.png) 6 | -------------------------------------------------------------------------------- /src/Queue/P18258/input.txt: -------------------------------------------------------------------------------- 1 | 15 2 | push 1 3 | push 2 4 | front 5 | back 6 | size 7 | empty 8 | pop 9 | pop 10 | pop 11 | size 12 | empty 13 | pop 14 | push 3 15 | empty 16 | front -------------------------------------------------------------------------------- /src/Queue/P1966/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1966] 프린터 큐 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/122781888-339ce580-d2eb-11eb-8f7f-6cf828bc9bc0.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/122781944-40213e00-d2eb-11eb-85a5-764a0ae1fcf5.png) 6 | -------------------------------------------------------------------------------- /src/Queue/P1966/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 1 0 3 | 5 4 | 4 2 5 | 1 2 3 4 6 | 6 0 7 | 1 1 9 1 1 1 -------------------------------------------------------------------------------- /src/Queue/P3190/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-3190] 뱀 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/92230569-51c56080-eee6-11ea-9e66-2388b3e1dfcf.png) 4 | 5 | ### 내가 몰랐던 점 6 | 7 | 1. Deque 자료구조 8 | 9 | - 처음에 큐를 사용하려고 보니, 데이터를 뒤에서 빼야하는 경우가 필요해서 큐를 배제하고 head, tail을 만들어서 풀었다. 10 | 그런데 그 과정에서 tail 회전을 처리하면서 정확하지 않은, 알 수 없는 예외의 경우가 생겼고 **런타임 에러**, **틀렸습니다**의 결과를 볼 수 있었다. 11 | - Deque(Double-ended queue) 자료구조는 양 끝에서만 자료를 넣고 양 끝에서 뺄 수 있는 자료구조로, queue의 확장판이다. 12 | > 추후 note에 정리하겠다. 13 | - Deque를 사용하면 훨씬 편하게 문제를 풀 수 있었다. 14 | 15 | 2. HashMap 16 | 17 | - 처음에 괜히 클래스를 생성해서 time, direction 값을 저장했는데, 그럴 필요 없이 HashMap으로 저장하면 훨씬 간편했다. 18 | 19 | -------------------------------------------------------------------------------- /src/Queue/P3190/input.txt: -------------------------------------------------------------------------------- 1 | 10 2 | 5 3 | 1 5 4 | 1 3 5 | 1 2 6 | 1 6 7 | 1 7 8 | 4 9 | 8 D 10 | 10 D 11 | 11 D 12 | 13 L -------------------------------------------------------------------------------- /src/Queue/prg42583/README.md: -------------------------------------------------------------------------------- 1 | ## [programmers - 스택/큐] 다리를 지나는 트럭 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/115883352-a7a44400-a488-11eb-9b98-27c5c2d56cdd.png) 4 | -------------------------------------------------------------------------------- /src/Queue/prg42586/README.md: -------------------------------------------------------------------------------- 1 | ## [programmers - 스택/큐] 기능개발 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/115884403-d66eea00-a489-11eb-871c-a9b61c08bb68.png) 4 | -------------------------------------------------------------------------------- /src/Queue/prg42587/README.md: -------------------------------------------------------------------------------- 1 | ## [programmers - 스택/큐] 프린터 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/115884265-ab849600-a489-11eb-8f79-de2b0df65c66.png) 4 | -------------------------------------------------------------------------------- /src/Queue/swea1225/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 1225] 암호생성기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/106867099-89903880-6710-11eb-9352-ab82e0e7f03e.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/106867128-944acd80-6710-11eb-9ac3-c686b8ded54b.png) 5 | ![image](https://user-images.githubusercontent.com/22045163/106867164-9e6ccc00-6710-11eb-9d4a-1cdc5cb2288a.png) 6 | ![image](https://user-images.githubusercontent.com/22045163/106866980-71201e00-6710-11eb-8de9-5e5a3ebb2468.png) 7 | -------------------------------------------------------------------------------- /src/Queue/swea1225/input.txt: -------------------------------------------------------------------------------- 1 | 1 2 | 9550 9556 9550 9553 9558 9551 9551 9551 3 | 2 4 | 2419 2418 2423 2415 2422 2419 2420 2415 5 | 3 6 | 7834 7840 7840 7835 7841 7835 7835 7838 7 | 4 8 | 4088 4087 4090 4089 4093 4085 4090 4084 9 | 5 10 | 2945 2946 2950 2948 2942 2943 2948 2947 11 | 6 12 | 670 667 669 671 670 670 668 671 13 | 7 14 | 8869 8869 8873 8875 8870 8872 8871 8873 15 | 8 16 | 1709 1707 1712 1712 1714 1710 1706 1712 17 | 9 18 | 10239 10248 10242 10240 10242 10242 10245 10235 19 | 10 20 | 6580 6579 6574 6580 6583 6580 6577 6581 21 | -------------------------------------------------------------------------------- /src/Queue/swea1225/output.txt: -------------------------------------------------------------------------------- 1 | #1 6 2 2 9 4 1 3 0 2 | #2 9 7 9 5 4 3 8 0 3 | #3 8 7 1 6 4 3 5 0 4 | #4 7 5 8 4 8 1 3 0 5 | #5 3 8 7 4 4 7 4 0 6 | #6 6 7 5 9 6 8 5 0 7 | #7 7 6 8 3 2 5 6 0 8 | #8 9 2 1 7 3 6 3 0 9 | #9 4 7 8 1 2 8 4 0 10 | #10 6 8 9 5 8 5 2 0 11 | -------------------------------------------------------------------------------- /src/Recursion/P17478/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-17478] 재귀함수가 뭔가요? 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/106705862-157f6300-6632-11eb-9ddd-1d9f5750d5e1.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/106705826-06001a00-6632-11eb-91b1-bd517c846100.png) 6 | -------------------------------------------------------------------------------- /src/Recursion/P1914/input.txt: -------------------------------------------------------------------------------- 1 | 3 -------------------------------------------------------------------------------- /src/Series/NandM/input.txt: -------------------------------------------------------------------------------- 1 | 4 4 2 | 1 1 2 2 -------------------------------------------------------------------------------- /src/Series/수열과쿼리/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 5 1 2 3 4 3 | 3 4 | 2 4 1 5 | 6 6 6 6 | 1 5 2 -------------------------------------------------------------------------------- /src/Simulation/P10163/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-10163] 색종이 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/109001544-6a217580-76e8-11eb-9ecd-6c5e80c546fd.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/109001592-77d6fb00-76e8-11eb-927e-19f2225e123c.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/109001634-845b5380-76e8-11eb-823a-ce8d1629d0ee.png) 7 | -------------------------------------------------------------------------------- /src/Simulation/P10163/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 0 2 10 10 3 | 7 9 8 4 4 | 8 4 10 6 5 | 6 0 12 10 -------------------------------------------------------------------------------- /src/Simulation/P1022/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1022] 소용돌이 예쁘게 출력하기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/126056479-844b8c64-9ec6-4c9e-8453-b67b27e2d6bd.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/126056482-af9ad4b9-f429-4015-be3a-9d66b56597cc.png) 5 | 6 | ### 메모리 초과 7 | 8 | 정말 메모리 제한을 잘 확인해야 한다. 필요한 만큼 배열을 선언해서 푸는 문제가 아니라, 출력할 크기만큼만 배열을 선언해서 출력할 숫자만을 대입하는 문제이다. 9 | 메모리 제한을 잘 확인하고 문제를 풀자 !! 10 | 11 | ![image](https://user-images.githubusercontent.com/22045163/126056487-3be872c9-1393-46bb-bda3-da189ca08120.png) 12 | -------------------------------------------------------------------------------- /src/Simulation/P1022/input.txt: -------------------------------------------------------------------------------- 1 | -5 -4 2 0 -------------------------------------------------------------------------------- /src/Simulation/P12100/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-12100] 2048 (Easy) 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/105490673-75a00c00-5cf8-11eb-8a05-8c8ea67380f2.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/105490703-818bce00-5cf8-11eb-9aae-1a81bed73b37.png) 5 | ![image](https://user-images.githubusercontent.com/22045163/105490727-8e102680-5cf8-11eb-96d1-9d9c59878cdd.png) 6 | ![image](https://user-images.githubusercontent.com/22045163/105490750-9700f800-5cf8-11eb-935e-7ff7b396af96.png) 7 | 8 | 그냥 풀면 된다. 9 | 10 | ![image](https://user-images.githubusercontent.com/22045163/105490823-b435c680-5cf8-11eb-9ede-9bf6503a6221.png) 11 | -------------------------------------------------------------------------------- /src/Simulation/P1244/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1244] 스위치 켜고 끄기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/106439518-1e015d80-64bb-11eb-9f89-d91f1f8ed942.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/106439564-2e193d00-64bb-11eb-8edf-a7cb1803fd51.png) 5 | -------------------------------------------------------------------------------- /src/Simulation/P1244/input.txt: -------------------------------------------------------------------------------- 1 | 8 2 | 0 1 0 1 0 0 0 1 3 | 2 4 | 1 3 5 | 2 3 6 | 7 | //output 8 | 1 0 0 0 1 1 0 1 -------------------------------------------------------------------------------- /src/Simulation/P13300/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-13300] 방 배정 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/109003448-ce453900-76ea-11eb-93c7-eb970f532bb3.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/109003495-ddc48200-76ea-11eb-9e99-80f69701afbd.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/109003538-e917ad80-76ea-11eb-868f-fc99debf7de3.png) 7 | -------------------------------------------------------------------------------- /src/Simulation/P13300/input.txt: -------------------------------------------------------------------------------- 1 | 3 3 2 | 0 3 3 | 1 5 4 | 0 6 -------------------------------------------------------------------------------- /src/Simulation/P14499/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-14499] 주사위 굴리기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/107928146-5032b500-6fbb-11eb-90bf-d7dbcc5ff331.png) 4 | 5 | ### 풀이 과정 6 | 7 | 처음에 너무 어렵게 생각했었는데, 그냥 숫자대로 주사위를 돌리면 된다. 8 | 9 | ![image](https://user-images.githubusercontent.com/22045163/107930949-02b84700-6fbf-11eb-9b52-18ca66657206.png) 10 | 11 | ![image](https://user-images.githubusercontent.com/22045163/107928186-5cb70d80-6fbb-11eb-85d7-3109d27f0906.png) 12 | -------------------------------------------------------------------------------- /src/Simulation/P14499/input.txt: -------------------------------------------------------------------------------- 1 | 3 3 0 0 16 2 | 0 1 2 3 | 3 4 5 4 | 6 7 8 5 | 4 4 1 1 3 3 2 2 4 4 1 1 3 3 2 2 -------------------------------------------------------------------------------- /src/Simulation/P14503/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-14503] 로봇 청소기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/107954499-dcef6a00-6fdf-11eb-8845-4efc6ae799e0.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/107954534-e8db2c00-6fdf-11eb-9e13-77bef2db0510.png) 6 | -------------------------------------------------------------------------------- /src/Simulation/P14503/input.txt: -------------------------------------------------------------------------------- 1 | 11 10 2 | 7 4 0 3 | 1 1 1 1 1 1 1 1 1 1 4 | 1 0 0 0 0 0 0 0 0 1 5 | 1 0 0 0 1 1 1 1 0 1 6 | 1 0 0 1 1 0 0 0 0 1 7 | 1 0 1 1 0 0 0 0 0 1 8 | 1 0 0 0 0 0 0 0 0 1 9 | 1 0 0 0 0 0 0 1 0 1 10 | 1 0 0 0 0 0 1 1 0 1 11 | 1 0 0 0 0 0 1 1 0 1 12 | 1 0 0 0 0 0 0 0 0 1 13 | 1 1 1 1 1 1 1 1 1 1 -------------------------------------------------------------------------------- /src/Simulation/P14891/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-14891] 톱니바퀴 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/103648637-89314000-4fa0-11eb-992f-64688f64f873.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/103648684-95b59880-4fa0-11eb-8c50-9eaad3a976ec.png) 5 | ![image](https://user-images.githubusercontent.com/22045163/103648711-a1a15a80-4fa0-11eb-8812-f59e3e0fae82.png) 6 | -------------------------------------------------------------------------------- /src/Simulation/P14891/input.txt: -------------------------------------------------------------------------------- 1 | 10101111 2 | 01111101 3 | 11001110 4 | 00000010 5 | 2 6 | 3 -1 7 | 1 1 -------------------------------------------------------------------------------- /src/Simulation/P15662/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 10101111 3 | 01111101 4 | 11001110 5 | 00000010 6 | 2 7 | 3 -1 8 | 1 1 -------------------------------------------------------------------------------- /src/Simulation/P15683/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-15683] 감시 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/114293177-09e76700-9acf-11eb-8f03-2e73bab4d85c.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/114293186-1cfa3700-9acf-11eb-952a-035760ca3c21.png) 5 | ![image](https://user-images.githubusercontent.com/22045163/114293194-28e5f900-9acf-11eb-9084-f5dfdc33514e.png) 6 | 7 | ![image](https://user-images.githubusercontent.com/22045163/114293203-34392480-9acf-11eb-9499-44bacee511c9.png) 8 | -------------------------------------------------------------------------------- /src/Simulation/P15683/input.txt: -------------------------------------------------------------------------------- 1 | 3 7 2 | 4 0 0 0 0 0 0 3 | 0 0 0 2 0 0 0 4 | 0 0 0 0 0 0 4 -------------------------------------------------------------------------------- /src/Simulation/P15686/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-15686] 치킨 배달 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/115846031-76158380-a45c-11eb-838c-6db02c4c81ac.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/115846082-80d01880-a45c-11eb-8116-5da572d0c834.png) 6 | -------------------------------------------------------------------------------- /src/Simulation/P15686/input.txt: -------------------------------------------------------------------------------- 1 | 5 1 2 | 1 2 0 2 1 3 | 1 2 0 2 1 4 | 1 2 0 2 1 5 | 1 2 0 2 1 6 | 1 2 0 2 1 -------------------------------------------------------------------------------- /src/Simulation/P16927/input.txt: -------------------------------------------------------------------------------- 1 | 4 4 2 2 | 1 2 3 4 3 | 5 6 7 8 4 | 9 10 11 12 5 | 13 14 15 16 -------------------------------------------------------------------------------- /src/Simulation/P16935/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-16935] 배열 돌리기 3 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/107520871-38db7c80-6bf5-11eb-9657-2a39c2271314.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/107520910-43961180-6bf5-11eb-84c7-07fa99672d32.png) 5 | ![image](https://user-images.githubusercontent.com/22045163/107520951-4ee93d00-6bf5-11eb-933f-fe135c52e86c.png) 6 | 7 | ![image](https://user-images.githubusercontent.com/22045163/107520972-56a8e180-6bf5-11eb-934e-f09988e267a4.png) 8 | -------------------------------------------------------------------------------- /src/Simulation/P1713/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1713] 후보 추천하기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/91603898-bf363600-e9a8-11ea-911d-640f60f09dc0.png) 4 | -------------------------------------------------------------------------------- /src/Simulation/P1713/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 9 3 | 2 1 4 3 5 6 2 7 2 -------------------------------------------------------------------------------- /src/Simulation/P17135/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-17135] 캐슬 디펜스 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/108467191-25e93c00-72c8-11eb-863e-666fadeb5e91.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/108467209-2d104a00-72c8-11eb-9b5f-01b738170b68.png) 6 | -------------------------------------------------------------------------------- /src/Simulation/P17135/input.txt: -------------------------------------------------------------------------------- 1 | 6 5 2 2 | 1 0 1 0 1 3 | 0 1 0 1 0 4 | 1 1 0 0 0 5 | 0 0 0 1 1 6 | 1 1 0 1 1 7 | 0 0 1 0 0 -------------------------------------------------------------------------------- /src/Simulation/P17144/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-17144] 미세먼지 안녕! 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/114657665-85455480-9d2b-11eb-9f2b-5dd16189a1e2.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/114657691-91311680-9d2b-11eb-9f74-2f598bcc84dd.png) 5 | ![image](https://user-images.githubusercontent.com/22045163/114657715-9db56f00-9d2b-11eb-84af-72bd3a025560.png) 6 | 7 | ![image](https://user-images.githubusercontent.com/22045163/114657752-ac038b00-9d2b-11eb-865f-c6ce722ca877.png) 8 | -------------------------------------------------------------------------------- /src/Simulation/P17144/input.txt: -------------------------------------------------------------------------------- 1 | 7 8 50 2 | 0 0 0 0 0 0 0 9 3 | 0 0 0 0 3 0 0 8 4 | -1 0 5 0 0 0 22 0 5 | -1 8 0 0 0 0 0 0 6 | 0 0 0 0 0 10 43 0 7 | 0 0 5 0 15 0 0 0 8 | 0 0 40 0 0 0 20 0 -------------------------------------------------------------------------------- /src/Simulation/P17281/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-17281] ⚾ 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/108605767-a52a5d00-73f9-11eb-9f77-1132fc52efb6.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/108605779-b3787900-73f9-11eb-8361-54ea5f9b8658.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/108605787-bd01e100-73f9-11eb-9f42-4d171edf37a0.png) 7 | -------------------------------------------------------------------------------- /src/Simulation/P17281/input.txt: -------------------------------------------------------------------------------- 1 | 9 2 | 1 2 4 3 0 2 1 0 3 3 | 1 2 1 2 0 0 0 0 1 4 | 3 4 2 3 1 2 3 4 0 5 | 0 1 2 3 4 2 1 0 0 6 | 0 0 0 0 0 0 1 4 4 7 | 0 4 0 4 0 4 0 4 0 8 | 0 4 2 2 2 2 2 2 2 9 | 1 1 1 1 1 1 1 1 0 10 | 0 2 0 3 0 1 0 2 0 -------------------------------------------------------------------------------- /src/Simulation/P17406/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-17406] 배열 돌리기 4 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/115139037-b646c180-a06a-11eb-993f-b51133c83359.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/115139045-c1015680-a06a-11eb-83c2-aaeb96861a7c.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/115139050-c9f22800-a06a-11eb-9fcf-9d029fcfe068.png) 7 | -------------------------------------------------------------------------------- /src/Simulation/P17406/input.txt: -------------------------------------------------------------------------------- 1 | 5 6 2 2 | 1 2 3 2 5 6 3 | 3 8 7 2 1 3 4 | 8 2 3 1 4 5 5 | 3 4 5 1 1 1 6 | 9 3 2 1 4 3 7 | 3 4 2 8 | 4 2 1 -------------------------------------------------------------------------------- /src/Simulation/P17779/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-17779] 게리맨더링 2 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/114568901-80db5600-9caf-11eb-9398-7af27367ede4.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/114568979-918bcc00-9caf-11eb-8196-13a2b30c5eed.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/114569021-994b7080-9caf-11eb-9a7f-1b328c08f3a3.png) 7 | 8 | 별로 좋은 성능을 내지 못한 것 같지만, 오늘은 여기까지 하기로 했다. 9 | -------------------------------------------------------------------------------- /src/Simulation/P17779/input.txt: -------------------------------------------------------------------------------- 1 | 8 2 | 1 2 3 4 5 6 7 8 3 | 2 3 4 5 6 7 8 9 4 | 3 4 5 6 7 8 9 1 5 | 4 5 6 7 8 9 1 2 6 | 5 6 7 8 9 1 2 3 7 | 6 7 8 9 1 2 3 4 8 | 7 8 9 1 2 3 4 5 9 | 8 9 1 2 3 4 5 6 -------------------------------------------------------------------------------- /src/Simulation/P19236/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-19236] 청소년 상어 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/116815435-82a28600-ab98-11eb-92c7-8049676c3670.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/116815464-a6fe6280-ab98-11eb-9ee3-453c3dd290a3.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/116815479-b1b8f780-ab98-11eb-8ff3-cc02f868ab95.png) 7 | -------------------------------------------------------------------------------- /src/Simulation/P2174/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2174] 로봇 시뮬레이션 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/118084703-1d525e80-b3fc-11eb-837a-40b3a1499739.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/118084732-27745d00-b3fc-11eb-926a-39f8e391ec57.png) 5 | 6 | ### 주의할 점 7 | 8 | (x, y) 좌표에 따라 동서남북으로 이동하는 방향이 이 문제에서는 일반적인 경우와 다르게 제시되었으므로 그 방향 처리에 유의해야 한다. 9 | 10 | ![image](https://user-images.githubusercontent.com/22045163/118084747-2e02d480-b3fc-11eb-9db8-b0b5dc14321b.png) 11 | -------------------------------------------------------------------------------- /src/Simulation/P2174/input.txt: -------------------------------------------------------------------------------- 1 | 3 3 2 | 1 9 3 | 2 2 W 4 | 1 F 1 5 | 1 L 1 6 | 1 F 1 7 | 1 L 1 8 | 1 F 2 9 | 1 L 5 10 | 1 F 2 11 | 1 R 3 12 | 1 F 2 -------------------------------------------------------------------------------- /src/Simulation/P2477/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2477] 참외밭 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/109010761-88d93980-76f3-11eb-9a0f-8d925c84077c.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/109010800-94c4fb80-76f3-11eb-9bca-7f70644aa6ee.png) 6 | -------------------------------------------------------------------------------- /src/Simulation/P2477/input.txt: -------------------------------------------------------------------------------- 1 | 7 2 | 1 160 3 | 3 50 4 | 2 100 5 | 4 20 6 | 2 60 7 | 4 30 8 | 9 | 3 160 10 | 1 30 11 | 4 60 12 | 1 20 13 | 4 100 14 | 2 50 15 | 16 | 3 20 17 | 1 100 18 | 4 50 19 | 2 160 20 | 3 30 21 | 1 60 22 | 23 | 3 30 24 | 1 60 25 | 3 20 26 | 1 100 27 | 4 50 28 | 2 160 29 | 30 | 1 160 31 | 3 50 32 | 2 100 33 | 4 20 34 | 2 60 35 | 4 30 -------------------------------------------------------------------------------- /src/Simulation/P2563/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2563] 색종이 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/107379160-00259f80-6b30-11eb-9c15-7af71bb0cc8c.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/107379196-09167100-6b30-11eb-9b80-83ee21fc8dea.png) 6 | -------------------------------------------------------------------------------- /src/Simulation/P2563/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 3 7 3 | 15 7 4 | 5 2 5 | 6 | // output 7 | 260 -------------------------------------------------------------------------------- /src/Simulation/P2564/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2564] 경비원 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/114589793-fa307400-9cc2-11eb-886f-2d3a39ab8772.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/114589833-03214580-9cc3-11eb-93b0-27e94d169894.png) 6 | -------------------------------------------------------------------------------- /src/Simulation/P2564/input.txt: -------------------------------------------------------------------------------- 1 | 10 5 2 | 3 3 | 1 4 4 | 3 2 5 | 2 8 6 | 2 3 -------------------------------------------------------------------------------- /src/Simulation/P2571/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2571] 색종이 - 3 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/126888231-f8c98689-7550-4b1e-a2e3-51d20bdc7e1f.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/126888238-a142f61a-2981-42e0-bb52-6903958bcc27.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/126888240-da85c24c-9390-4fe4-9799-3fbb6e03c0fa.png) 7 | -------------------------------------------------------------------------------- /src/Simulation/P2571/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 3 7 3 | 15 7 4 | 5 2 5 | 6 | 4 7 | 1 1 8 | 1 10 9 | 10 1 10 | 10 10 11 | -------------------------------------------------------------------------------- /src/Simulation/P2636/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2636] 치즈 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/112263513-c610f700-8cb2-11eb-8d80-01e84e3278fb.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/112263652-ff496700-8cb2-11eb-9452-7bbb8325a011.png) 5 | 6 | ### 풀이 과정 7 | 8 | 어떻게 풀이해야 할지 몰라 한참을 생각했다. 그 이유는 초점을 치즈에 맞추고 있었기 때문이다. 풀이법이 생각나지 않는다면 초점을 바꿔서 생각해보자. 이 문제는 `뭉치를 둘러싸고 있는 것들`에 관심이 있기 때문에, 치즈가 아닌 `공기`에 초점을 맞춰 문제를 풀어나가야 한다. 공기의 입장에서 BFS를 수행하면 쉽게 풀어나갈 수 있다. 9 | 10 | ![image](https://user-images.githubusercontent.com/22045163/112263564-dcb74e00-8cb2-11eb-8b67-b125390f4bc0.png) 11 | -------------------------------------------------------------------------------- /src/Simulation/P2636/input.txt: -------------------------------------------------------------------------------- 1 | 13 12 2 | 0 0 0 0 0 0 0 0 0 0 0 0 3 | 0 0 0 0 0 0 0 0 0 0 0 0 4 | 0 0 0 0 0 0 0 1 1 0 0 0 5 | 0 1 1 1 0 0 0 1 1 0 0 0 6 | 0 1 1 1 1 1 1 0 0 0 0 0 7 | 0 1 1 1 1 1 0 1 1 0 0 0 8 | 0 1 1 1 1 0 0 1 1 0 0 0 9 | 0 0 1 1 0 0 0 1 1 0 0 0 10 | 0 0 1 1 1 1 1 1 1 0 0 0 11 | 0 0 1 1 1 1 1 1 1 0 0 0 12 | 0 0 1 1 1 1 1 1 1 0 0 0 13 | 0 0 1 1 1 1 1 1 1 0 0 0 14 | 0 0 0 0 0 0 0 0 0 0 0 0 -------------------------------------------------------------------------------- /src/Simulation/P2931/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2931] 가스관 2 | 3 | 이런 문제가 쉽게 슥슥 풀리는 날이 올까... 다시는 풀고 싶지 않다...!! 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/110344170-933ef000-8070-11eb-87fe-8a59306b2095.png) 6 | 7 | ![image](https://user-images.githubusercontent.com/22045163/110344252-a5b92980-8070-11eb-9fd2-65b24b775f18.png) 8 | -------------------------------------------------------------------------------- /src/Simulation/P2931/input.txt: -------------------------------------------------------------------------------- 1 | 3 7 2 | .14.... 3 | .M.Z... 4 | ..23... 5 | // 2 3 | 6 | 7 | 3 7 8 | ....... 9 | .M-.-Z. 10 | ....... -------------------------------------------------------------------------------- /src/Simulation/P3954/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-3954] Brainf**k 인터프리터 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/108668812-35ae8d80-751f-11eb-92cd-622d6e632f92.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/108668853-4828c700-751f-11eb-8e83-c628ac6e5fd6.png) 5 | 6 | ### 문제 풀이 Point 7 | 8 | 풀면서 좀 너무한 것 같다 !! 라는 생각이 드는 문제였다. 휴... 😭😭😭 9 | 10 | - 문제의 핵심 : Loop에서 괄호 짝을 구하는 것, 이 과정에서 발생할 수 있는 다양한 테스트케이스들을 생각해봐야 한다. 11 | - 문제 속에 알고리즘에 대한 모든 힌트를 담고 있다. 12 | - 해당 프로그램이 무한 루프라고 판단되었을 때, 정확한 괄호의 짝을 찾아내는 과정에 대한 고찰이 필요하다. 13 | 14 | ![image](https://user-images.githubusercontent.com/22045163/108668881-5545b600-751f-11eb-941a-7a00b5101544.png) 15 | -------------------------------------------------------------------------------- /src/Simulation/jo1037/README.md: -------------------------------------------------------------------------------- 1 | ## [JUNGOL-1037] 오류교정 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/109013023-056d1780-76f6-11eb-8a23-d7968c6d2a8e.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/109013099-187fe780-76f6-11eb-8a48-cc6ce41d762e.png) 6 | -------------------------------------------------------------------------------- /src/Simulation/jo1037/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 1 0 1 0 3 | 0 0 1 0 4 | 1 1 1 1 5 | 0 1 0 1 -------------------------------------------------------------------------------- /src/Simulation/jo1205/README.md: -------------------------------------------------------------------------------- 1 | ## [JUNGOL-1205] 조커 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/111467327-a8e6a080-8767-11eb-9a9e-f072495bdca3.png) 4 | 5 | ### 풀이과정 6 | 7 | 이 문제를 드디어 풀었다. 완전탐색이라고 해서 너무 어렵게만 생각했을 때 그 풀이를 너무 빙빙 돌아가는 것 같다. 좀 더 단순히, 단순히 생각하여 문제 있는 그대로 풀어내는 것이 중요한 것 같다. 8 | 9 | ![image](https://user-images.githubusercontent.com/22045163/111467365-b439cc00-8767-11eb-8e34-c407ef175e88.png) 10 | -------------------------------------------------------------------------------- /src/Simulation/jo1205/input.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 100 100 100 99 97 103 3 | // 2 4 | 5 | 8 6 | 0 0 0 1 2 6 8 1000 7 | // 6 8 | 9 | 21 10 | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 | // 21 12 | 13 | 7 14 | 0 6 5 10 3 0 11 15 | // 5 16 | -------------------------------------------------------------------------------- /src/Simulation/swea1767/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 1767] 프로세서 연결하기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/111667707-53d68780-8858-11eb-93c7-be68cc9545c7.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/111667751-605ae000-8858-11eb-94b8-07ad34ec4bcc.png) 5 | ![image](https://user-images.githubusercontent.com/22045163/111667797-6a7cde80-8858-11eb-94e2-99ae4b3f649a.png) 6 | ![image](https://user-images.githubusercontent.com/22045163/111667886-7ec0db80-8858-11eb-89ce-ad6cf2c3b0cb.png) 7 | 8 | ![image](https://user-images.githubusercontent.com/22045163/111667380-ffcba300-8857-11eb-81f8-35a911b61164.png) 9 | -------------------------------------------------------------------------------- /src/Simulation/swea1767/sample_output.txt: -------------------------------------------------------------------------------- 1 | #1 12 2 | #2 10 3 | #3 24 4 | -------------------------------------------------------------------------------- /src/Simulation/swea1873/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 1873] 상호의 배틀필드 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/106717486-25537300-6643-11eb-9d19-2f0c7b437f71.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/106717556-3bf9ca00-6643-11eb-836b-c1cfd1add657.png) 5 | ![image](https://user-images.githubusercontent.com/22045163/106717429-11a80c80-6643-11eb-9ece-86ba7046881a.png) 6 | -------------------------------------------------------------------------------- /src/Simulation/swea2115/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 2115] 벌꿀채취 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/115662923-a8e74b00-a37a-11eb-8543-5e7fe9010a9d.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/115662963-b3094980-a37a-11eb-89c3-16c47c470ebc.png) 5 | ![image](https://user-images.githubusercontent.com/22045163/115662989-bdc3de80-a37a-11eb-91b0-a1dcf8031160.png) 6 | 7 | ![image](https://user-images.githubusercontent.com/22045163/115663026-cae0cd80-a37a-11eb-9c9e-3d275d11c79d.png) 8 | -------------------------------------------------------------------------------- /src/Simulation/swea2115/sample_output.txt: -------------------------------------------------------------------------------- 1 | #1 174 2 | #2 131 3 | #3 145 4 | #4 155 5 | #5 166 6 | #6 239 7 | #7 166 8 | #8 172 9 | #9 291 10 | #10 464 11 | -------------------------------------------------------------------------------- /src/Simulation/swea4014/sample_output.txt: -------------------------------------------------------------------------------- 1 | #1 7 2 | #2 4 3 | #3 11 4 | #4 11 5 | #5 15 6 | #6 4 7 | #7 4 8 | #8 1 9 | #9 5 10 | #10 8 11 | -------------------------------------------------------------------------------- /src/Simulation/swea5656/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 5656] 벽돌 깨기 2 | 3 | ![1](https://user-images.githubusercontent.com/22045163/114741910-31b42480-9d86-11eb-8383-03266eb936a8.jpg) 4 | ![2](https://user-images.githubusercontent.com/22045163/114741905-311b8e00-9d86-11eb-8638-16fbb2319616.jpg) 5 | ![3](https://user-images.githubusercontent.com/22045163/114741900-2fea6100-9d86-11eb-957b-d110d95d36ea.jpg) 6 | ![4](https://user-images.githubusercontent.com/22045163/114741876-2a8d1680-9d86-11eb-9aaf-35800c9a7c6a.jpg) 7 | 8 | ![image](https://user-images.githubusercontent.com/22045163/114741252-899e5b80-9d85-11eb-9e43-38674cd79077.png) 9 | 10 | 오우 진짜 어렵다 ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ 11 | -------------------------------------------------------------------------------- /src/Simulation/swea5656/sample_output.txt: -------------------------------------------------------------------------------- 1 | #1 12 2 | #2 27 3 | #3 4 4 | #4 8 5 | #5 0 6 | -------------------------------------------------------------------------------- /src/Simulation/swea9760/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 9760] Poker Game 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/115338702-5bce7200-a1de-11eb-8c61-91c0ffae2f81.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/115338727-66890700-a1de-11eb-917d-b9e74103d7e9.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/115338609-1dd14e00-a1de-11eb-95ac-dfb2fe5ea66c.png) 7 | -------------------------------------------------------------------------------- /src/Simulation/swea9760/output.txt: -------------------------------------------------------------------------------- 1 | #1 Straight Flush 2 | #2 Four of a Kind 3 | #3 Flush 4 | #4 One pair -------------------------------------------------------------------------------- /src/Sort/P10989/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-10989] 수 정렬하기 3 2 | 3 | > **Counting Sort** | Time complexity : **O(N)** 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/107228540-1ebc6580-6a60-11eb-9fb2-f34b6a29c2c6.png) 6 | 7 | 메모리 제한 조건 때문에 수의 개수(범위 : `1 ≤ N ≤ 10,000,000`)만큼 배열에 넣을 수 없어 8 | 수의 최대 크기 조건(`10,000보다 작거나 같은 자연수`)을 활용해 계수 정렬을 구현한다. 9 | 10 | ![image](https://user-images.githubusercontent.com/22045163/107228478-0f3d1c80-6a60-11eb-90a8-69279eb565e8.png) 11 | -------------------------------------------------------------------------------- /src/Sort/P11931/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-11931] 수 정렬하기 4 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/107252564-d2c9ea80-6a78-11eb-9e38-d339bbe5d6c8.png) 4 | 5 | 처음에 퀵소트로 풀어보려 했는데, 시간 제한과 숫자 범위를 생각했을 때 퀵소트의 Worst Case 시간복잡도가 O(N^2)이기 때문에 6 | 옳지 않다. 그래서 내림차순으로 merge sort를 구현해 풀었다. 7 | 8 | ![image](https://user-images.githubusercontent.com/22045163/107252610-df4e4300-6a78-11eb-88ae-2bf7d5d720fa.png) 9 | -------------------------------------------------------------------------------- /src/Sort/P15688/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-15688] 수 정렬하기 5 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/107252304-8ed6e580-6a78-11eb-953f-96e8703c8363.png) 4 | 5 | 아.. 진짜 이상한 문제다. Java 11 -> Java 8 로 바꾸어 채점하니까 맞았다. 아, 진짜 이상하다. 아... 6 | 7 | ![image](https://user-images.githubusercontent.com/22045163/107252372-a01ff200-6a78-11eb-9d27-2abcb49faa45.png) 8 | 9 | 진짜 이거 안 풀면 오늘 안 잔다는 마음으로 풀었는데 허무해서 화가난다. 10 | -------------------------------------------------------------------------------- /src/Sort/P2750/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2750] 수 정렬하기 2 | 3 | > **Selection Sort** | Time complexity : **O(N^2)** 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/107226991-2da21880-6a5e-11eb-9dd8-31bb72745d0c.png) 6 | 7 | ![image](https://user-images.githubusercontent.com/22045163/107227042-414d7f00-6a5e-11eb-977e-3cf2125b6d65.png) 8 | -------------------------------------------------------------------------------- /src/Sort/P2751/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2751] 수 정렬하기 2 2 | 3 | > **Merge Sort** | Time complexity : **O(NlogN)** 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/107227678-08fa7080-6a5f-11eb-92b3-ff6d07ee63dd.png) 6 | 7 | ![image](https://user-images.githubusercontent.com/22045163/107227711-157ec900-6a5f-11eb-8a33-02e0ff73ed3b.png) 8 | -------------------------------------------------------------------------------- /src/Sort/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | -3 3 | -4 4 | -10000 5 | 2 6 | 1 -------------------------------------------------------------------------------- /src/Sort/prg42747/README.md: -------------------------------------------------------------------------------- 1 | ## [programmers - 정렬] H-Index 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/105315667-01377100-5c03-11eb-864d-b5f935b086e7.png) 4 | 5 | 이분 탐색 upper-bound를 이용해 풀었다. 6 | -------------------------------------------------------------------------------- /src/Sort/prg42748/README.md: -------------------------------------------------------------------------------- 1 | ## [programmers - 정렬] K번째수 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/105129709-00321100-5b29-11eb-89e3-f1b4fddcf6fb.png) 4 | -------------------------------------------------------------------------------- /src/Stack/P10799/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-10799] 쇠막대기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/122012754-7a28a680-cdf8-11eb-9a27-1437e6c2e052.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/122012801-87459580-cdf8-11eb-92ee-48e0dce579f2.png) 6 | -------------------------------------------------------------------------------- /src/Stack/P10799/input.txt: -------------------------------------------------------------------------------- 1 | (((()(()()))(())()))(()()) -------------------------------------------------------------------------------- /src/Stack/P10828/input.txt: -------------------------------------------------------------------------------- 1 | 14 2 | push 1 3 | push 2 4 | top 5 | size 6 | empty 7 | pop 8 | pop 9 | pop 10 | size 11 | empty 12 | pop 13 | push 3 14 | empty 15 | top -------------------------------------------------------------------------------- /src/Stack/P17298/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-17298] 오큰수 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/116771094-b344cb80-aa83-11eb-8f5d-8c75f8596e22.png) 4 | 5 | ### 시간초과 이슈 6 | 7 | 앞으로 이 정도의 큰 범위는 `StringBuilder`를 사용해 출력하는 것으로 약속 !!! 8 | 9 | ![image](https://user-images.githubusercontent.com/22045163/116771101-c22b7e00-aa83-11eb-8232-f0011115ac4b.png) 10 | -------------------------------------------------------------------------------- /src/Stack/P17298/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 9 5 4 8 -------------------------------------------------------------------------------- /src/Stack/P1863/input.txt: -------------------------------------------------------------------------------- 1 | 10 2 | 1 1 3 | 2 2 4 | 5 1 5 | 6 3 6 | 8 1 7 | 11 0 8 | 15 2 9 | 17 3 10 | 20 2 11 | 22 1 -------------------------------------------------------------------------------- /src/Stack/P1918/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1918] 후위 표기식 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/121150451-8358c700-c87e-11eb-8d07-71e94c8db90a.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/121150495-8f448900-c87e-11eb-8fce-636e92d9e4b3.png) 6 | -------------------------------------------------------------------------------- /src/Stack/P1918/input.txt: -------------------------------------------------------------------------------- 1 | A+B*(C-(D+E))/F -------------------------------------------------------------------------------- /src/Stack/P2493/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2493] 탑 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/91897357-199b0380-ecd5-11ea-99d8-dd5215e6bff5.png) 4 | 5 | ### 2021.02.04 - 두번째 풀이 6 | 7 | - [Main2.java](Main2.java) 8 | 9 | ![image](https://user-images.githubusercontent.com/22045163/106866505-e3443300-670f-11eb-9b6d-015ab30a787d.png) 10 | -------------------------------------------------------------------------------- /src/Stack/P2493/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 6 9 5 7 4 -------------------------------------------------------------------------------- /src/Stack/P2504/input.txt: -------------------------------------------------------------------------------- 1 | ()[[] -------------------------------------------------------------------------------- /src/Stack/P2800/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2800] 괄호 제거 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/119235741-fe2b9d80-bb6e-11eb-8984-3c94d52eddfe.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/119235750-071c6f00-bb6f-11eb-8f18-6aab914897e4.png) 6 | -------------------------------------------------------------------------------- /src/Stack/P2800/input.txt: -------------------------------------------------------------------------------- 1 | (0/(0)) -------------------------------------------------------------------------------- /src/Stack/P2867/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2867] 수열의 값 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/93620960-cbe10380-fa15-11ea-8e01-6a4ad07d2633.png) 4 | -------------------------------------------------------------------------------- /src/Stack/P2867/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 3 3 | 1 4 | 7 5 | 2 -------------------------------------------------------------------------------- /src/Stack/P3425/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-3425] 고스택 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/91573791-f513f400-e981-11ea-89a1-aa0f67ac797e.png) 4 | -------------------------------------------------------------------------------- /src/Stack/prg42584/README.md: -------------------------------------------------------------------------------- 1 | ## [programmers - 스택/큐] 주식가격 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/115883783-2600e600-a489-11eb-86ed-42fb02091879.png) 4 | -------------------------------------------------------------------------------- /src/Stack/swea1218/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 1218] 괄호 짝짓기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/106844140-1b854a80-66eb-11eb-8ea2-4f632a2a14ca.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/106844163-29d36680-66eb-11eb-811e-4b25d47a1686.png) 5 | ![image](https://user-images.githubusercontent.com/22045163/106844102-ff81a900-66ea-11eb-9026-b62ac3800577.png) 6 | -------------------------------------------------------------------------------- /src/Stack/swea1218/output.txt: -------------------------------------------------------------------------------- 1 | #1 1 2 | #2 0 3 | #3 1 4 | #4 1 5 | #5 1 6 | #6 0 7 | #7 0 8 | #8 1 9 | #9 0 10 | #10 1 11 | -------------------------------------------------------------------------------- /src/Stack/swea1223/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 1223] 계산기2 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/107012757-c75a9300-67dc-11eb-8576-89ec26d2ba8b.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/107012696-b4e05980-67dc-11eb-9468-d4647666e2a9.png) 6 | -------------------------------------------------------------------------------- /src/Stack/swea1223/output.txt: -------------------------------------------------------------------------------- 1 | #1 28134 2 | #2 195767 3 | #3 4293 4 | #4 1592 5 | #5 477326 6 | #6 45647 7 | #7 102951 8 | #8 6548 9 | #9 1394 10 | #10 4285 11 | -------------------------------------------------------------------------------- /src/String/P10256/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-10256] 돌연변이 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/104025854-918bb400-5208-11eb-9879-6d3e8486db44.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/104025903-9b151c00-5208-11eb-9531-5d335ede2a93.png) 5 | 6 | [문자열 집합 판별](../P9250) 문제에 이어서 아호-코라식을 연습할 수 있는 문제이다 !! 7 | 트라이처럼 연습하다보면 늘겠지 !!! 재밌다 ㅎㅎ 8 | 9 | ![image](https://user-images.githubusercontent.com/22045163/104025954-ab2cfb80-5208-11eb-85ce-0ac9d80a27f0.png) 10 | 11 | ![image](https://user-images.githubusercontent.com/22045163/104026164-e92a1f80-5208-11eb-948a-e97e2d392cbe.png) 12 | -------------------------------------------------------------------------------- /src/String/P10256/input.txt: -------------------------------------------------------------------------------- 1 | 2 2 | 6 4 3 | ATGGAT 4 | AGGT 5 | 6 4 6 | ATGGAT 7 | AGCT -------------------------------------------------------------------------------- /src/String/P1213/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1213] 팰린드롬 만들기 2 | 3 | image 4 | 5 | image 6 | -------------------------------------------------------------------------------- /src/String/P1213/input.txt: -------------------------------------------------------------------------------- 1 | ABACABA -------------------------------------------------------------------------------- /src/String/P1305/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | aaaaa 3 | output 1 4 | 5 | 11 6 | aabaaabaaab 7 | output 4 8 | 9 | 6 10 | aabaaa 11 | output 4 -------------------------------------------------------------------------------- /src/String/P13505/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-13505] 두 수 XOR 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/103462635-f1e2a780-4d69-11eb-81dc-046de3907843.png) 4 | 5 | ### 풀이 과정 6 | 7 | XOR 연산은 0과 1, 1과 0처럼 두 수가 다를 때 1을 반환한다. 이러한 특성을 생각해봤을 때 8 | 주어진 수에 대해 XOR한 값이 최대가 되려면 각 자리의 수가 서로 최대한 달라야 한다. 9 | 이를 효율적으로 해결하기 위해서는 트라이를 이용할 수 있다. 각 수를 이진수로 바꿔 트라이에 넣고, 10 | XOR한 값이 최대가 될 수 있는 수를 찾아나가는 것이다. 11 | 12 | 이진수와 XOR연산 문제인데, 트라이를 써서 풀 수 있는 신기하고 재밌는 문제였다 !! 13 | 14 | ![image](https://user-images.githubusercontent.com/22045163/103462660-163e8400-4d6a-11eb-8ca6-54962c87ca0b.png) 15 | -------------------------------------------------------------------------------- /src/String/P13505/input.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 1 2 4 8 16 32 3 | 4 | 5 5 | 0 1 0 1 0 6 | 7 | 5 8 | 1 2 3 4 5 9 | -------------------------------------------------------------------------------- /src/String/P14425/input.txt: -------------------------------------------------------------------------------- 1 | 5 11 2 | baekjoononlinejudge 3 | startlink 4 | codeplus 5 | sundaycoding 6 | codingsh 7 | baekjoon 8 | codeplus 9 | codeminus 10 | startlink 11 | starlink 12 | sundaycoding 13 | codingsh 14 | codinghs 15 | sondaycoding 16 | startrink 17 | icerink -------------------------------------------------------------------------------- /src/String/P14426/input.txt: -------------------------------------------------------------------------------- 1 | 5 10 2 | baekjoononlinejudge 3 | startlink 4 | codeplus 5 | sundaycoding 6 | codingsh 7 | baekjoon 8 | star 9 | start 10 | code 11 | sunday 12 | coding 13 | cod 14 | online 15 | judge 16 | plus 17 | 18 | output 7 19 | baekjoon 20 | star 21 | start 22 | code 23 | sunday 24 | coding 25 | cod -------------------------------------------------------------------------------- /src/String/P15740/input.txt: -------------------------------------------------------------------------------- 1 | 123456789123456789123456789 -987654321987654321987654321 2 | 3 | 4 | 50430451 5 | 12345456 6 | 7 | -60 60 8 | 9 | 120 10 | 060 11 | 12 | 1000000000 13 | 0999999999 14 | 15 | 987654321987654321987654321 16 | 123456789123456789123456789 -------------------------------------------------------------------------------- /src/String/P17413/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-17413] 단어 뒤집기 2 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/109246325-647d7a00-7825-11eb-9fef-5b0a1e3ad25f.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/109246346-6fd0a580-7825-11eb-9258-fecb2663898b.png) 6 | -------------------------------------------------------------------------------- /src/String/P17413/input.txt: -------------------------------------------------------------------------------- 1 | noojkeab enilno egduj -------------------------------------------------------------------------------- /src/String/P1786/input.txt: -------------------------------------------------------------------------------- 1 | ABC ABCDAB ABCDABCDABDEABCDABD 2 | ABCDABD 3 | 4 | ABABABABBABABABABC 5 | ABABABC 6 | 7 | ABC ABCDAB ABCDABCDABDEABCDABD 8 | ABCDABD 9 | 10 | ABCDABCDABDE 11 | ABCDAB 12 | 13 | ABABABABBABABABABC 14 | 012345678901234567 15 | ABABABABC 16 | 012345678 17 | 18 | ABCDABCDABDE 19 | ABCDAB 20 | 21 | -------------------------------------------------------------------------------- /src/String/P5052/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-5052] 전화번호 목록 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/107534932-a68ea500-6c03-11eb-9487-3d0180734baa.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/107535120-cd4cdb80-6c03-11eb-90a8-8db6f753bf8a.png) 6 | -------------------------------------------------------------------------------- /src/String/P5052/input.txt: -------------------------------------------------------------------------------- 1 | 2 2 | 3 3 | 911 4 | 97625999 5 | 91125426 6 | 5 7 | 113 8 | 12340 9 | 123440 10 | 12345 11 | 98346 -------------------------------------------------------------------------------- /src/String/P6503/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-6503] 망가진 키보드 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/123613388-5759b180-d83e-11eb-89c4-c8a6bf347333.png) 4 | 5 | ### 풀이 과정 6 | 7 | 서로 다른 문자의 개수를 구하는 과정에서 처음에 해시맵을 사용했는데, 실행 시간이 너무 높게 나와서 알고 보니 `m` 범위를 `128`까지 준 이유가 있었다. 아스키코드가 `0~127` 범위라는 것. 그래서 `128` 사이즈의 배열을 선언해서 카운트하는 식으로 바꿔줬더니 실행 시간이 개선되었다. 8 | 9 | ![image](https://user-images.githubusercontent.com/22045163/123613441-62144680-d83e-11eb-8aeb-a4bef1fa2191.png) 10 | -------------------------------------------------------------------------------- /src/String/P6503/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | This can't be solved by brute force. 3 | 1 4 | Mississippi 5 | 0 -------------------------------------------------------------------------------- /src/String/P9093/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-9093] 단어 뒤집기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/106906619-b5c3ad80-6740-11eb-8aa2-7dc86e9c8e96.png) 4 | 5 | ### 문자열 뒤집는 방법 - Java 6 | 7 | ```java 8 | StringBuffer buffer = new StringBuffer(); 9 | String s = "Hello"; 10 | buffer.append(s).reverse(); 11 | System.out.println(buffer.toString()); // olleH 12 | ``` 13 | -------------------------------------------------------------------------------- /src/String/P9093/input.txt: -------------------------------------------------------------------------------- 1 | 2 2 | I am happy today 3 | We want to win the first prize -------------------------------------------------------------------------------- /src/String/P9250/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | he 3 | his 4 | shes 5 | 1 6 | she 7 | 8 | 3 9 | he 10 | his 11 | she 12 | 1 13 | shis -------------------------------------------------------------------------------- /src/String/P9252/input.txt: -------------------------------------------------------------------------------- 1 | ACAYKP 2 | CAPCAK -------------------------------------------------------------------------------- /src/String/P9342/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-9342] 염색체 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/121890610-80197b80-cd55-11eb-8f8d-6030ea7ef9df.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/121890664-8f98c480-cd55-11eb-8db6-1c25909d1111.png) 6 | -------------------------------------------------------------------------------- /src/String/P9342/input.txt: -------------------------------------------------------------------------------- 1 | 15 2 | AFC 3 | AAFC 4 | AAAFFCC 5 | AAFCC 6 | BAFC 7 | QWEDFGHJMNB 8 | DFAFCB 9 | ABCDEFC 10 | DADC 11 | SDFGHJKLQWERTYU 12 | AAAAAAAAAAAAABBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCDDDDDDDDDDDEEEEEEEEEEEEEEEFFFFFFFFC 13 | AAAFFFFFBBBBCCCAAAFFFF 14 | ABCDEFAAAFFFCCCABCDEF 15 | AFCP 16 | AAFFCPP -------------------------------------------------------------------------------- /src/TimeComplexity/FrogJmp/Main.java: -------------------------------------------------------------------------------- 1 | package TimeComplexity.FrogJmp; 2 | 3 | public class Main { 4 | public static void main(String[] args) { 5 | Solution sol = new Solution(); 6 | System.out.println(sol.solution(10, 10, 30)); 7 | System.out.println(sol.solution(10, 85, 30)); 8 | } 9 | } 10 | 11 | class Solution { 12 | public int solution(int X, int Y, int D) { 13 | Y -= X; 14 | return (int) Math.ceil((double) Y / (double) D); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/TimeComplexity/FrogJmp/README.md: -------------------------------------------------------------------------------- 1 | ## [Codility - Lesson 3 Time Complexity] FrogJmp 2 | 3 | > Detected time complexity : **O(1)** 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/101915925-9c532900-3c09-11eb-9997-0cde24f0c5a4.png) 6 | -------------------------------------------------------------------------------- /src/TimeComplexity/P12015/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-12015] 가장 긴 증가하는 부분 수열 2 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/107511185-7f76aa00-6be8-11eb-899e-c537dad90a69.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/107511204-869db800-6be8-11eb-8d16-7fba4ec44ff5.png) 6 | -------------------------------------------------------------------------------- /src/TimeComplexity/P12015/input.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 10 20 10 30 20 50 3 | 4 | 6 5 | 10 5 10 20 30 50 6 | 7 | 10 8 | 1 100 2 50 60 3 5 6 7 8 9 | -------------------------------------------------------------------------------- /src/TimeComplexity/P12738/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-12738] 가장 긴 증가하는 부분 수열 3 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/107525901-a4741880-6bfa-11eb-950d-8330f768de93.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/107525940-afc74400-6bfa-11eb-991c-e7b5b5654dad.png) 6 | -------------------------------------------------------------------------------- /src/TimeComplexity/P12738/input.txt: -------------------------------------------------------------------------------- 1 | 8 2 | -10 -20 -10 30 20 25 50 60 -------------------------------------------------------------------------------- /src/TimeComplexity/P14003/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-14003] 가장 긴 증가하는 부분 수열 5 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/107529400-2ca7ed00-6bfe-11eb-8310-9dd6a7fd19ea.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/107529432-35002800-6bfe-11eb-9000-17eb2782782b.png) 6 | -------------------------------------------------------------------------------- /src/TimeComplexity/P14003/input.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 10 20 10 30 20 50 3 | 4 | 8 5 | 3 2 5 2 3 1 4 1 6 | 7 | -------------------------------------------------------------------------------- /src/TimeComplexity/P15961/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-15961] 회전 초밥 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/108622160-3b9e6300-747a-11eb-9432-c4f73acb043b.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/108622169-46f18e80-747a-11eb-8860-d326c703788a.png) 5 | 6 | ### HashMap vs Array 7 | 8 | 처음에 선택한 초밥에 대한 정보를 HashMap에 저장해가면서 풀었는데, 이보다 `d`의 크기만큼 Array를 선언하여 9 | 구현하는 것이 메모리/시간복잡도 측면에서 훨씬 좋다. 10 | 11 | ![image](https://user-images.githubusercontent.com/22045163/108622175-5375e700-747a-11eb-95b0-a28e53317d05.png) 12 | -------------------------------------------------------------------------------- /src/TimeComplexity/P15961/input.txt: -------------------------------------------------------------------------------- 1 | 2 2 2 2 2 | 1 3 | 1 4 | 5 | 8 30 4 30 6 | 7 7 | 9 8 | 7 9 | 30 10 | 2 11 | 7 12 | 9 13 | 25 14 | -------------------------------------------------------------------------------- /src/TimeComplexity/P16566/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-16566] 카드 게임 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/115140537-ce224380-a072-11eb-8b71-5aa068bde6df.png) 4 | 5 | ### Array vs ArrayList 6 | 7 | ArrayList에서 remove하는 식으로 구현한다면 생각해보라. remove하는데 비용이 얼마나 들지. 당연히 시간초과가 났고 visited 배열을 선언해 구현하는 식으로 바꾸니 성공할 수 있었다. 8 | 9 | ![image](https://user-images.githubusercontent.com/22045163/115140549-d67a7e80-a072-11eb-90ae-731899f0f4db.png) 10 | -------------------------------------------------------------------------------- /src/TimeComplexity/P16566/input.txt: -------------------------------------------------------------------------------- 1 | 10 7 5 2 | 2 5 3 7 8 4 9 3 | 4 1 1 3 8 -------------------------------------------------------------------------------- /src/TimeComplexity/P1806/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1806] 부분합 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/107124083-01af5780-68e5-11eb-9511-aae420c76c28.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/107124091-0aa02900-68e5-11eb-890e-5ec10681feb6.png) 6 | -------------------------------------------------------------------------------- /src/TimeComplexity/P1806/input.txt: -------------------------------------------------------------------------------- 1 | 10 15 2 | 5 1 3 5 10 7 4 9 2 8 -------------------------------------------------------------------------------- /src/TimeComplexity/P2003/input.txt: -------------------------------------------------------------------------------- 1 | 10 5 2 | 1 2 3 4 2 5 3 1 1 2 -------------------------------------------------------------------------------- /src/TimeComplexity/P2143/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 4 3 | 1 3 1 2 4 | 3 5 | 1 3 2 -------------------------------------------------------------------------------- /src/TimeComplexity/P2805/input.txt: -------------------------------------------------------------------------------- 1 | 4 7 2 | 20 15 10 17 -------------------------------------------------------------------------------- /src/TimeComplexity/PermMissingElem/README.md: -------------------------------------------------------------------------------- 1 | ## [Codility - Lesson 3 Time Complexity] PermMissingElem 2 | 3 | > Detected time complexity : **O(N) or O(N * log(N))** 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/101918025-361bd580-3c0c-11eb-96f3-7626764d8ece.png) 6 | -------------------------------------------------------------------------------- /src/TimeComplexity/TapeEquilibrium/README.md: -------------------------------------------------------------------------------- 1 | ## [Codility - Lesson 3 Time Complexity] TapeEquilibrium 2 | 3 | > Detected time complexity : **O(N)** 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/101920230-e7bc0600-3c0e-11eb-8d04-7d38cc34f1b7.png) 6 | ![image](https://user-images.githubusercontent.com/22045163/101920286-f6a2b880-3c0e-11eb-9354-efcd279939f8.png) 7 | -------------------------------------------------------------------------------- /src/TimeComplexity/prg43238/README.md: -------------------------------------------------------------------------------- 1 | ## [programmers - 이분탐색] 입국심사 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/120892186-f1677900-c647-11eb-8c8f-c875eefb2410.png) 4 | -------------------------------------------------------------------------------- /src/TimeComplexity/swea3307/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 3307] 최장 증가 부분 수열 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/112497712-34e07400-8dc9-11eb-9fa7-df6ff5cdcf9b.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/112497800-46298080-8dc9-11eb-999d-6bc063883d16.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/112497897-5f323180-8dc9-11eb-9a15-82b144e1cb55.png) 7 | -------------------------------------------------------------------------------- /src/TimeComplexity/swea3307/sample_input.txt: -------------------------------------------------------------------------------- 1 | 2 2 | 5 3 | 1 3 2 5 4 4 | 6 5 | 4 2 3 1 5 6 6 | -------------------------------------------------------------------------------- /src/TimeComplexity/swea3307/sample_output.txt: -------------------------------------------------------------------------------- 1 | #1 3 2 | #2 4 3 | -------------------------------------------------------------------------------- /src/Tree/P1068/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1068] 트리 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/107122553-a75dc900-68db-11eb-814b-39ca7a174675.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/107122567-b93f6c00-68db-11eb-86e1-7379ea90fd22.png) 5 | 6 | ![image](https://user-images.githubusercontent.com/22045163/107122584-d83dfe00-68db-11eb-9890-58a05fb1b215.png) 7 | -------------------------------------------------------------------------------- /src/Tree/P1068/input.txt: -------------------------------------------------------------------------------- 1 | 9 2 | -1 0 0 2 2 4 4 6 6 3 | 4 -------------------------------------------------------------------------------- /src/Tree/P1167/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 5 4 6 -1 3 | 4 2 4 3 3 5 6 -1 4 | 3 1 2 4 3 -1 5 | 2 4 4 -1 6 | 1 3 2 -1 -------------------------------------------------------------------------------- /src/Tree/P11725/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-11725] 트리의 부모 찾기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/108373876-b6ca0400-7243-11eb-9cc2-f36377d877aa.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/108373917-bfbad580-7243-11eb-898b-72bfee6cab19.png) 6 | -------------------------------------------------------------------------------- /src/Tree/P11725/input.txt: -------------------------------------------------------------------------------- 1 | 7 2 | 1 6 3 | 6 3 4 | 3 5 5 | 4 1 6 | 2 4 7 | 4 7 -------------------------------------------------------------------------------- /src/Tree/P1991/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-1991] 트리 순회 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/92608570-82473900-f2f0-11ea-8fed-b231553c768e.png) 4 | -------------------------------------------------------------------------------- /src/Tree/P1991/input.txt: -------------------------------------------------------------------------------- 1 | 7 2 | A B C 3 | B D . 4 | C E F 5 | E . . 6 | F . G 7 | D . . 8 | G . . -------------------------------------------------------------------------------- /src/Tree/P2263/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-2263] 트리의 순회 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/108312939-c3763a00-71fa-11eb-8836-289469ba1438.png) 4 | 5 | ### 풀이 과정 6 | 7 | - postorder의 가장 오른쪽은 부모 노드 8 | - inorder는 부모 노드를 중간에 두고 좌, 우로 자식 노드를 가짐 9 | 10 | ![image](https://user-images.githubusercontent.com/22045163/108312825-a3df1180-71fa-11eb-9c10-dd790fa2602d.png) 11 | 12 | ![image](https://user-images.githubusercontent.com/22045163/108312955-cec96580-71fa-11eb-868f-6e6e993ddc9e.png) 13 | -------------------------------------------------------------------------------- /src/Tree/P2263/input.txt: -------------------------------------------------------------------------------- 1 | 7 2 | 4 2 1 5 3 6 7 3 | 4 2 5 7 6 3 1 4 | //1243567 5 | 6 | 7 7 | 6 2 5 3 1 4 7 8 | 6 5 2 1 7 4 3 9 | //3265417 10 | 11 | 3 12 | 1 2 3 13 | 1 3 2 -------------------------------------------------------------------------------- /src/Tree/swea1233/README.md: -------------------------------------------------------------------------------- 1 | ## [SW Expert Academy - 1233] 사칙연산 유효성 검사 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/107380320-1d0ea280-6b31-11eb-866b-9d02ebab4dd6.png) 4 | ![image](https://user-images.githubusercontent.com/22045163/107380367-2730a100-6b31-11eb-84a0-1cd5f6509ec0.png) 5 | ![image](https://user-images.githubusercontent.com/22045163/107380434-37488080-6b31-11eb-8701-eaba37554c75.png) 6 | ![image](https://user-images.githubusercontent.com/22045163/107380499-45969c80-6b31-11eb-809f-7c51a437e9be.png) 7 | 8 | ![image](https://user-images.githubusercontent.com/22045163/107333250-8b833e80-6af8-11eb-9b8b-316199109c4c.png) 9 | -------------------------------------------------------------------------------- /src/Tree/swea1233/output.txt: -------------------------------------------------------------------------------- 1 | #1 0 2 | #2 0 3 | #3 0 4 | #4 1 5 | #5 0 6 | #6 1 7 | #7 1 8 | #8 0 9 | #9 0 10 | #10 0 11 | -------------------------------------------------------------------------------- /src/Trie/P5670/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-5670] 휴대폰 자판 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/124380805-d006b500-dcf9-11eb-8cc3-b7a58131dc96.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/124380817-ec0a5680-dcf9-11eb-9a91-454a9ca6e600.png) 6 | -------------------------------------------------------------------------------- /src/Trie/P5670/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | hello 3 | hell 4 | heaven 5 | goodbye 6 | 3 7 | hi 8 | he 9 | h 10 | 7 11 | structure 12 | structures 13 | ride 14 | riders 15 | stress 16 | solstice 17 | ridiculous -------------------------------------------------------------------------------- /src/Trie/P9202/README.md: -------------------------------------------------------------------------------- 1 | ## [baekjoon-9202] Boggle 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/91184357-8176aa80-e727-11ea-8b7d-8eafd712cd76.png) 4 | -------------------------------------------------------------------------------- /src/Trie/P9202/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | ICPC 3 | ACM 4 | CONTEST 5 | GCPC 6 | PROGRAMM 7 | 8 | 3 9 | ACMA 10 | APCA 11 | TOGI 12 | NEST 13 | 14 | PCMM 15 | RXAI 16 | ORCN 17 | GPCG 18 | 19 | ICPC 20 | GCPC 21 | ICPC 22 | GCPC -------------------------------------------------------------------------------- /src/_2019_KAKAO_BLIND_RECRUITMENT/P1/README.md: -------------------------------------------------------------------------------- 1 | ## [2019 KAKAO BLIND RECRUITMENT - 1] 오픈채팅방 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/92515762-19f44b00-f24f-11ea-8e51-4533e5278f34.png) 4 | -------------------------------------------------------------------------------- /src/_2019_KAKAO_BLIND_RECRUITMENT/P2/README.md: -------------------------------------------------------------------------------- 1 | ## [2019 KAKAO BLIND RECRUITMENT - 2] 실패율 2 | 3 | ### 처음에 틀렸던 이유 4 | 5 | 나눗셈을 해줄 때 0인 경우를 처리해주어야 한다. 0으로 나누면 NaN 값이 들어가더라. 6 | **나눗셈이 들어가는 문제일 때는 늘 생각해주기 !!!** 7 | 8 | ![image](https://user-images.githubusercontent.com/22045163/92521498-49f41c00-f258-11ea-843b-6ff4ff5f410c.png) 9 | -------------------------------------------------------------------------------- /src/_2019_KAKAO_BLIND_RECRUITMENT/P6/README.md: -------------------------------------------------------------------------------- 1 | ## [2019 KAKAO BLIND RECRUITMENT - 6] 매칭 점수 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/103168140-fd1e6a80-4873-11eb-9d0e-a19039399782.png) 4 | 5 | 죽는 줄 6 | -------------------------------------------------------------------------------- /src/_2020_KAKAO_BLIND_RECRUITMENT/P1/README.md: -------------------------------------------------------------------------------- 1 | ## [2020 KAKAO BLIND RECRUITMENT - 1] 문자열 압축 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/91018024-fb286e80-e629-11ea-9cab-8e232831403f.png) 4 | 5 | ### 2021.01.03 - using JavaScript 6 | 7 | - [210103.js](210103.js) 8 | 9 | ![image](https://user-images.githubusercontent.com/22045163/103463414-8e5b7880-4d6f-11eb-80e0-83b59cf053a8.png) 10 | -------------------------------------------------------------------------------- /src/_2020_KAKAO_BLIND_RECRUITMENT/P2/README.md: -------------------------------------------------------------------------------- 1 | ## [2020 KAKAO BLIND RECRUITMENT - 2] 괄호 변환 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/91028764-e30c1b80-e638-11ea-856b-ae6787b5eb97.png) 4 | 5 | ### 2021.01.09 - using JavaScript 6 | 7 | - [210109.js](210109.js) 8 | 9 | ![image](https://user-images.githubusercontent.com/22045163/104094576-0fb58c80-52d5-11eb-8c38-ea1fc048c3f5.png) 10 | -------------------------------------------------------------------------------- /src/_2020_KAKAO_BLIND_RECRUITMENT/P3/README.md: -------------------------------------------------------------------------------- 1 | ## [2020 KAKAO BLIND RECRUITMENT - 3] 자물쇠와 열쇠 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/91055004-0649c180-e65f-11ea-93fb-3cb55ea4bab4.png) 4 | 5 | ![IMG_4789](https://user-images.githubusercontent.com/22045163/91053986-9804ff00-e65e-11ea-9f9a-49e9449ce4dc.jpg) -------------------------------------------------------------------------------- /src/_2020_KAKAO_BLIND_RECRUITMENT/P4/README.md: -------------------------------------------------------------------------------- 1 | ## [2020 KAKAO BLIND RECRUITMENT - 4] 가사 검색 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/91196833-978b6780-e735-11ea-8dd5-19b22bb77bee.png) 4 | 5 | ![IMG_4796](https://user-images.githubusercontent.com/22045163/91197148-fd77ef00-e735-11ea-9bd9-e67b88d86179.jpg) -------------------------------------------------------------------------------- /src/_2020_KAKAO_BLIND_RECRUITMENT/P5/README.md: -------------------------------------------------------------------------------- 1 | ## [2020 KAKAO BLIND RECRUITMENT - 5] 기둥과 보 설치 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/91212370-1343df00-e74b-11ea-9c4c-fd04401726e9.png) 4 | 5 | ![P5](https://user-images.githubusercontent.com/22045163/91212618-6cac0e00-e74b-11ea-9ccd-de80dfa437ae.jpg) 6 | -------------------------------------------------------------------------------- /src/_2020_KAKAO_BLIND_RECRUITMENT/P6/README.md: -------------------------------------------------------------------------------- 1 | ## [2020 KAKAO BLIND RECRUITMENT - 6] 외벽 점검 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/91275848-a9afe900-e7bb-11ea-8d9c-c59bc332587b.png) 4 | 5 | ![p6](https://user-images.githubusercontent.com/22045163/91276113-07dccc00-e7bc-11ea-8b62-20364a87b736.jpg) 6 | -------------------------------------------------------------------------------- /src/_2020_KAKAO_BLIND_RECRUITMENT/P7/README.md: -------------------------------------------------------------------------------- 1 | ## [2020 KAKAO BLIND RECRUITMENT - 7] 블록 이동하기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/98828902-f1214980-247b-11eb-937a-55bae38413f1.png) 4 | 5 | 진짜... 정말... 진짜로... 정말 몇 번을 제출했는지 모르겠다... 이런 문제는 진짜... 실제로 나와도 못 풀거야.... 어후 ... 6 | 7 | ![IMG_20F2B961C534-1](https://user-images.githubusercontent.com/22045163/98829120-2d54aa00-247c-11eb-8a39-fbb65d576b3e.jpeg) 8 | -------------------------------------------------------------------------------- /src/_2020_카카오_인턴십/P1/README.md: -------------------------------------------------------------------------------- 1 | ## [2020 카카오 인턴십] 키패드 누르기 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/98970782-ae32a500-2553-11eb-82f5-10130c078791.png) 4 | 5 | ![image](https://user-images.githubusercontent.com/22045163/98971284-47fa5200-2554-11eb-9d28-a3b634d11e77.png) 6 | -------------------------------------------------------------------------------- /src/_2020_카카오_인턴십/P2/README.md: -------------------------------------------------------------------------------- 1 | ## [2020 카카오 인턴십] 수식 최대화 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/116247404-c74bad00-a7a5-11eb-8f81-d1931eae7898.png) 4 | -------------------------------------------------------------------------------- /src/_2020_카카오_인턴십/P3/README.md: -------------------------------------------------------------------------------- 1 | ## [2020 카카오 인턴십] 보석 쇼핑 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/116556898-eb8bc300-a938-11eb-80f8-648894529e70.png) 4 | -------------------------------------------------------------------------------- /src/_2020_카카오_인턴십/P4/README.md: -------------------------------------------------------------------------------- 1 | ## [2020 카카오 인턴십] 경주로 건설 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/116574247-82ac4700-a948-11eb-81a2-3873eb8e1ba7.png) 4 | -------------------------------------------------------------------------------- /src/_2021_KAKAO_BLIND_RECRUITMENT/P1/README.md: -------------------------------------------------------------------------------- 1 | ## [2021 KAKAO BLIND RECRUITMENT - 1] 신규 아이디 추천 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/111249808-a2650580-864f-11eb-85ba-9fdfbd0ab36e.png) 4 | 5 | 카카오엔 이런 문제가 한 문제씩 나오는 것 같다. 주어진 알고리즘을 **있는 그대로** 푸는 것이 중요하다. 6 | -------------------------------------------------------------------------------- /src/_2021_KAKAO_BLIND_RECRUITMENT/P2/README.md: -------------------------------------------------------------------------------- 1 | ## [2021 KAKAO BLIND RECRUITMENT - 2] 메뉴 리뉴얼 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/111250043-012a7f00-8650-11eb-98c6-19eae31292dc.png) 4 | 5 | 디테일함을 요구하는 완전탐색, 그 중에서도 조합 문제이다. 중복 데이터를 걸러주는 것, "WX"와 "XW"는 같다는 점을 주의하기 위해 정렬을 해주는 등 디테일함이 있어야 풀 수 있는 문제였다. 6 | -------------------------------------------------------------------------------- /src/_2021_KAKAO_BLIND_RECRUITMENT/P3/README.md: -------------------------------------------------------------------------------- 1 | ## [2021 KAKAO BLIND RECRUITMENT - 3] 순위 검색 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/111254624-ced14f80-8658-11eb-875c-c1f4c818d7d6.png) 4 | 5 | 언뜻 보기에 쉬워보이는 문제이지만 효율성 점수가 있기에 다른 방법의 접근이 필요하다. 쿼리를 수행할 때마다 데이터를 일일이 돌지 않고, 필요한 데이터에 바로 접근할 수 있어야 효율성을 높일 수 있다. 그러기 위해 key 값을 만들어 활용, 이분 탐색 등의 개념이 들어간 문제였다. 6 | -------------------------------------------------------------------------------- /src/_2021_KAKAO_BLIND_RECRUITMENT/P4/README.md: -------------------------------------------------------------------------------- 1 | ## [2021 KAKAO BLIND RECRUITMENT - 4] 합승 택시 요금 2 | 3 | ![image](https://user-images.githubusercontent.com/22045163/106773278-3d97b200-6684-11eb-983b-7ec540c30b44.png) 4 | 5 | 문제를 읽어보면 최단 경로 문제이며, 경유지 K를 탐색하며 n의 크기가 작으므로 플로이드-워셜 알고리즘 문제임을 알 수 있다. 6 | --------------------------------------------------------------------------------