Algorithm (49) 썸네일형 리스트형 POLY #include using namespace std; const int MAX_N = 101; const int MOD = 10000000; int cache[MAX_N][MAX_N]; int n; int getTotPoly(int n); int poly(int n, int top); int main() { int caseNum = 0; cin >> caseNum; for (int cIter = 0; cIter > n; // Initialize for (int i = 1; i ASYMTILING #include using namespace std; const int MAX_N = 101; const int MOD = 1000000007; int n; int cache[MAX_N]; int tiling(int n); int main() { int caseNum = 0; cin >> caseNum; for (int cIter = 0; cIter > n; // Initialize for (int i = 0; i QUANTIZATION #include #include #include #include using namespace std; const int MAX_ERROR = 999999; const int MAX_N = 100; const int MAX_S = 10; int cache[MAX_N][MAX_S]; int sum[MAX_N]; int sumSquare[MAX_N]; vector quants; int n = 0, s = 0; int quantize(int from, int parts); int minError(int start, int end); int main() { int caseNum = 0; cin >> caseNum; for (int cIter = 0; cIter > .. PI #include #include using namespace std; const int MAX_BUFFER_SIZE = 10001; const int MAX_INPUT_SIZE = 10001; const int MAX_DIFFICULTY = 99999; char input[MAX_BUFFER_SIZE]; int cache[MAX_INPUT_SIZE + 1]; int getMinDiff(int start); int calcMinDiff(int start, int end); int main() { int caseNum = 0; cin >> caseNum; cin.ignore(); for (int cIter = 0; cIter < caseNum; cIter++) { cin.getline(input, MAX_B.. WILDCARD #include #include #include #include using namespace std; const int MAX_BUFFER_SIZE = 1024; const int MAX_TEXT_LENGTH = 100; char input[MAX_BUFFER_SIZE]; string src, dest; int cache[MAX_TEXT_LENGTH][MAX_TEXT_LENGTH] = {-1, }; vector results; bool IsMatched(int srcIdx, int destIdx); int main() { int caseNum = 0; cin >> caseNum; cin.ignore(); for (int cIter = 0; cIter < caseNum; cIter++) { // initi.. BINOMIAL COEFFICIENT #include #include using namespace std; const int MAX_NUM = 1024; int cache[MAX_NUM][MAX_NUM]; void initCache(); int binomial(int n, int r); int main() { int caseNum = 0; int n = 0, r = 0; cin >> caseNum; for (int cIter = 0; cIter > n >> r; cout FANMEETING #include using namespace std; int getHugCnt(int start, int end); int getCenterHugCnt(int start, int end, int headPersonStart, int headPersonEnd); bool IsAllHugged(int headPersonIdx); const int MAX_PEOPLE_SIZE = 200001; char inputBuffer[MAX_PEOPLE_SIZE]; char member[MAX_PEOPLE_SIZE]; char fan[MAX_PEOPLE_SIZE]; int main() { int caseNum = 0; cin >> caseNum; cin.ignore(); for (int cIter = 0; cIter <.. FENCE 구현 소스 #include #include #include #include using namespace std; const int MAX_BUFFER_SIZE = 1024; vector fenceHeights; int getMaxArea(int start, int end); int getCenterMax(int start, int end, int mid); void splitStringWithDelim(char* source, vector &result, char delim, int maxSize); int main() { int caseNum = 0, elNum = 0; char inputBuffer[MAX_BUFFER_SIZE]; cin >> caseNum; for (int cIter = 0; cIt.. 이전 1 2 3 4 5 6 7 다음