Instantly share code, notes, and snippets.

# Chih-Hsuan Kuokuoe0

• Sort options
Last active Apr 27, 2019
Data Mining - Association Rule - Apriori Implementation
View DataMining-AssociationRule-Apriori.cpp
 /* * ===================================================================================== * * Filename: Data_Mining-Association_Rule-Apriori.cpp * * Description: Data Mining - Association Rule * Apriori C++ Implementation * * Compiler: g++ * Platform: OS X 10.7
Created Dec 8, 2011
d151 - Break Up is Hard to Do (http://140.122.185.166/ZeroJudge/ShowProblem?problemid=d151)
View d151.cpp
 bool DFS( int now, int cnt ) { visit[ now ] = 1; bool ret = 0; if ( now == tgA ) ret = BFS( 1 ); if ( !cnt || ret ) { visit[ now ] = 0; return ret; }
Last active Sep 29, 2015
[Prime] Sieve of Eratosthenes - http://kuoe0.ch/1209/prime-sieve-of-eratosthenes/
View sieve.cpp
 #include #include using namespace std; #define MAX 1000000 bool isNotPrime[ MAX + 1 ]; void sieve() { memset( isNotPrime, 0, sizeof( isNotPrime ) ); isNotPrime[ 0 ] = isNotPrime[ 1 ] = 1; for ( int i = 2; i <= MAX; i += 2 ) isNotPrime[ i ] = 1;
Created Jan 11, 2012
[UVa] 100 – The 3n+1 Problem - http://kuoe0.ch/18/uva-100-the-3n-plus-1-problem/
View The 3n + 1 Problem.cpp
 #include #include #include using namespace std; long long int MAX; long long int count( int x ) { if ( x == 1 ) return 0;
Created Jan 11, 2012
View toExcelColumnName.cpp
 const char* toExcelColumnName( int n ) { string ret = ""; while ( n ) { int x = n % 26; if ( x ) ret += 'A' + x - 1; else ret += 'Z', n -= 26; n /= 26; }
Created Jan 13, 2012
[UVa] 501 - Black Box - http://kuoe0.ch/362/uva-501-black-box/
View 501 - Black Box.cpp
 #include #include #include #include #include using namespace std; int main() {
Created Jan 14, 2012
 #include #include #include #include #include #include #include #include using namespace std; #define MAXN 110
Created Jan 14, 2012
[UVa] 837 - Light and Transparencies - http://kuoe0.ch/377/uva-837-light-and-transparencies/
View 837 - Light and Transparencies.cpp
 #include #include #include #include using namespace std; struct POINT { int x; bool end; double c;
Created Jan 14, 2012
[POJ] 2231 - Moo Volume - http://kuoe0.ch/379/poj-2231-moo-volume/
View 2231 - Moo Volume.cpp
 #include #include #include #include using namespace std; int pos[ 10010 ]; int main() { int n;
Created Jan 14, 2012
[POJ] 1971 - Parallelogram Counting - http://kuoe0.ch/386/poj-1971-parallelogram-counting/
View 1971 - Parallelogram Counting.cpp
 #include #include #include #include #include using namespace std; struct POINT { int x, y; bool operator< ( const POINT r ) const { return ( x < r.x ) || ( x == r.x && y < r.y );
You can’t perform that action at this time.