This file contains 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
/*============================================================================= | |
# FileName: selectionSort.cpp | |
# Desc: Selecetion Sort | |
# 1. find minimum element in unsorted part | |
# 2. put minimum element at end of sorted part | |
# 3. repeat above steps until unsorted part is empty | |
# Author: KuoE0 | |
# Email: [email protected] | |
# HomePage: http://kuoe0.ch/ | |
# Version: 0.0.1 |
This file contains 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
/*============================================================================= | |
# FileName: insertionSort.cpp | |
# Desc: Insertion Sort | |
# Author: KuoE0 | |
# Email: [email protected] | |
# HomePage: http://kuoe0.ch/ | |
# Version: 0.0.1 | |
# LastChange: 2013-03-04 00:42:04 | |
# History: | |
=============================================================================*/ |
This file contains 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
#include <iostream> | |
#include <cstdio> | |
#include <cstdlib> | |
#include <vector> | |
using namespace std; | |
int main() { | |
int n; | |
while ( ~scanf( "%d", &n ) ) { |
This file contains 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
/*============================================================================= | |
# FileName: 2766_Laserbox.cpp | |
# Desc: POJ 2766 - http://poj.org/problem?id=2766 | |
# Author: KuoE0 | |
# Email: [email protected] | |
# HomePage: http://kuoe0.ch/ | |
# Version: 0.0.1 | |
# LastChange: 2012-11-04 21:35:23 | |
# History: | |
=============================================================================*/ |
This file contains 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
/*============================================================================= | |
# FileName: GT-TSP-DP.cpp | |
# Desc: Traveling Salesman Problem - DP solution | |
# Author: KuoE0 | |
# Email: [email protected] | |
# HomePage: http://kuoe0.ch/ | |
# Version: 0.0.1 | |
# LastChange: 2012-10-11 20:59:01 | |
# History: | |
=============================================================================*/ |
This file contains 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
#include <iostream> | |
#include <cstdio> | |
#include <cmath> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
#define mod 100000007 | |
long long int gcd( long long int a, long long int b, long long int &x, long long int &y ) { |
This file contains 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
#include <iostream> | |
#include <queue> | |
using namespace std; | |
#define MAXN 1010 | |
struct EDGE { | |
int v, w, next; | |
}; | |
EDGE edge[ 3000010 ]; |
This file contains 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
/* | |
* ===================================================================================== | |
* | |
* Filename: 3723 - Conscription.cpp | |
* | |
* Description: http://poj.org/problem?id=3723 | |
* | |
* | |
* Version: 1.0 | |
* Created: 2012/02/16 14時59分31秒 |
This file contains 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
/* | |
* ===================================================================================== | |
* | |
* Filename: 2431 - Expedition.cpp | |
* | |
* Description: http://poj.org/problem?id=2431 | |
* | |
* Version: 1.0 | |
* Created: 2012/02/08 18時46分09秒 | |
* Revision: none |
This file contains 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
#include <iostream> | |
#include <cstdio> | |
#include <queue> | |
#include <algorithm> | |
#include <vector> | |
using namespace std; | |
vector< vector< pair< int, int > > > vertex; | |
vector< int > dist, cnt; | |
vector< bool > inque; | |
int n, k, m; |