Skip to content

Instantly share code, notes, and snippets.

View liyong3forever's full-sized avatar

Yong Li liyong3forever

View GitHub Profile
@bittib
bittib / gist:5449327
Last active December 9, 2016 07:08
N Queen Problem. Print all solutions for N queen based on either row first order or column first. http://poj.grids.cn/practice/2698/
import java.io.*;
public class Main{
static PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));
static int N = 8;
static int cnt = 0;
public static void main(String[] args){
int[] array = new int[N];
cnt = 0;