Skip to content

Instantly share code, notes, and snippets.

//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();
//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;
@luckypapa
luckypapa / trianglepath.cpp
Created September 20, 2015 07:41
solution of TRIANGLEPATH
//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;
//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;
//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},
//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 };
//https://www.acmicpc.net/problem/1004
#include <stdio.h>
#define SQUARE(X) (X)*(X)
typedef struct{
int x;
int y;
int r;
@luckypapa
luckypapa / fibonacci.cpp
Created August 20, 2015 15:13
fibonacci_get_zero_one
//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};
@luckypapa
luckypapa / bridge_link.cpp
Created August 6, 2015 07:14
Bridge Link solution
@luckypapa
luckypapa / coins.cpp
Created August 3, 2015 14:15
COINS SOLUTION
//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