This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://algospot.com/judge/problem/read/ENCRYPT | |
#include <string> | |
#include <vector> | |
#include <iostream> | |
using namespace std; | |
string encryptString(const string &str) { | |
int length = str.length(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://algospot.com/judge/problem/read/DIAMONDPATH | |
#include <iostream> | |
#include <memory.h> | |
#include <algorithm> | |
using namespace std; | |
int diamond[201][101]; | |
int cache[201][101]; | |
int N; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://algospot.com/judge/problem/read/TRIANGLEPATH | |
#include <iostream> | |
#include <memory.h> | |
#include <algorithm> | |
using namespace std; | |
int triangle[101][101]; | |
int cache[101][101]; | |
int N; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://algospot.com/judge/problem/read/SNAIL | |
//timecomplexity : O(2m-n) | |
#include <stdio.h> | |
#include <math.h> | |
/* | |
int factorial(int a) { | |
int result = 1; | |
for (int i = a; i >= 1; i--) { | |
result *= i; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://www.acmicpc.net/problem/1009 | |
#include <stdio.h> | |
int cache[8][4] = { | |
{2,4,8,6}, | |
{3,9,7,1}, | |
{4,6,4,6}, | |
{5,5,5,5}, | |
{6,6,6,6}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://www.acmicpc.net/problem/3059 | |
#include <stdio.h> | |
#define TOTAL_UPPER_ASCI 2015 | |
int getSumOfNoneChar(void) { | |
int data[26] = { 0 }; | |
int sum = TOTAL_UPPER_ASCI; | |
char temp[1000] = { 0 }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://www.acmicpc.net/problem/1004 | |
#include <stdio.h> | |
#define SQUARE(X) (X)*(X) | |
typedef struct{ | |
int x; | |
int y; | |
int r; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://www.acmicpc.net/problem/1003 | |
#include<stdio.h> | |
typedef struct CACHE{ | |
unsigned long long zero; | |
unsigned long long one; | |
} CACHE_T; | |
static CACHE_T cache[41] = {0}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://www.acmicpc.net/problem/1010 | |
//time complexity : O(N) | |
//space complexity : O(1) | |
#include <stdio.h> | |
int combination(int west, int east) { | |
if (west >= 30 || east >= 30 || west > east) | |
return -1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://algospot.com/judge/problem/read/COINS | |
#include <stdio.h> | |
#include <string.h> | |
#include <algorithm> | |
#include <vector> | |
#define MAX_COINS 100 | |
#define MAX_EXCHANGE 5000 | |
#define OVER_CASE 1000000007 |
NewerOlder