Skip to content

Instantly share code, notes, and snippets.

/*=============================================================================
# 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: kuoe0.tw@gmail.com
# HomePage: http://kuoe0.ch/
# Version: 0.0.1
@kuoe0
kuoe0 / insertionSort.cpp
Created March 3, 2013 16:42
Insertion Sort
/*=============================================================================
# FileName: insertionSort.cpp
# Desc: Insertion Sort
# Author: KuoE0
# Email: kuoe0.tw@gmail.com
# HomePage: http://kuoe0.ch/
# Version: 0.0.1
# LastChange: 2013-03-04 00:42:04
# History:
=============================================================================*/
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
using namespace std;
int main() {
int n;
while ( ~scanf( "%d", &n ) ) {
/*=============================================================================
# FileName: 2766_Laserbox.cpp
# Desc: POJ 2766 - http://poj.org/problem?id=2766
# Author: KuoE0
# Email: kuoe0.tw@gmail.com
# HomePage: http://kuoe0.ch/
# Version: 0.0.1
# LastChange: 2012-11-04 21:35:23
# History:
=============================================================================*/
@kuoe0
kuoe0 / GT-TSP-DP.cpp
Last active June 26, 2018 15:13
[Algorithm] Traveling Salesman's Problem - DP solution - http://kuoe0.ch/1878/algorithm-traveling-salesman-s-problem-dp-solution
/*=============================================================================
# FileName: GT-TSP-DP.cpp
# Desc: Traveling Salesman Problem - DP solution
# Author: KuoE0
# Email: kuoe0.tw@gmail.com
# HomePage: http://kuoe0.ch/
# Version: 0.0.1
# LastChange: 2012-10-11 20:59:01
# History:
=============================================================================*/
@kuoe0
kuoe0 / a542-detA.cpp
Created October 2, 2012 19:33
[ZJ] a542 - 行列式 det(A) - http://kuoe0.ch/1852/zj-a542-det-a/
#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 ) {
#include <iostream>
#include <queue>
using namespace std;
#define MAXN 1010
struct EDGE {
int v, w, next;
};
EDGE edge[ 3000010 ];
/*
* =====================================================================================
*
* Filename: 3723 - Conscription.cpp
*
* Description: http://poj.org/problem?id=3723
*
*
* Version: 1.0
* Created: 2012/02/16 14時59分31秒
/*
* =====================================================================================
*
* Filename: 2431 - Expedition.cpp
*
* Description: http://poj.org/problem?id=2431
*
* Version: 1.0
* Created: 2012/02/08 18時46分09秒
* Revision: none
#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;