/* * The Computer Language Benchmarks Game * http://shootout.alioth.debian.org/ * * Contributed by Oleg Mazurov, June 2010 * */ import java.util.concurrent.atomic.AtomicInteger; public final class fannkuchredux implements Runnable { private static final int NCHUNKS = 150; private static int CHUNKSZ; private static int NTASKS; private static int n; private static int[] Fact; private static int[] maxFlips; private static int[] chkSums; private static AtomicInteger taskId; int[] p, pp, count; void print() { for ( int i = 0; i < p.length; i++ ) { System.out.print( p[i] + 1 ); } System.out.println(); } void firstPermutation( int idx ) { for ( int i=0; i