public class FinalTest
{
private static int[] Tedg = new int[12];
private static int[] Ttri = new int[8];
private static int[] cub = new int[4];
private static int Ttotal;
private static int[] TedgTotal = new int[13];
private static int Tcount;
private static int[][] Tworks = new int[77][12];
private static int[] T = new int[12];
private static int[] Oedg = new int[12];
private static int[] Otri = new int[8];
private static int[] quar = new int[3];
private static int Ototal;
private static int[] OedgTotal = new int[13];
private static int Ocount;
private static int[][] Oworks = new int[153][12];
private static int[] O = new int[12];
private static int Ftotal;
private static int[] quad = new int[24];
private static int[] FedgTotal = new int[25];
private static int[][] Fworks = new int[166][24];
private static int[][] sharp = new int[166][48];
private static int a2init;
private static int b2init;
private static int c2init;
private static int[] orbits = new int[100];
private static int[] tempFworks = new int[24];
private static int[] FworksUsed = new int[166];
private static int orbitCount;
public static void main(String [] args)
{
Ttotal = 0;
Ototal = 0;
Tcount = 0;
Ocount = 0;
Ftotal = 0;
for(int i = 0; i < 12; i++)
{
TedgTotal[i] = 0;
OedgTotal[i] = 0;
}
for(int i = 0; i < 12; i++)
{
Tedg[i] = 0;
Oedg[i] = 0;
}
for(int i = 0; i < 4096; i++)
{
Ttotal = Ttotal + Tcheck();
addModTwo(Tedg,0);
}
for(int i = 0; i < 4096; i++)
{
Ototal = Ototal + Ocheck();
addModTwo(Oedg,0);
}
for(int i = 0; i < 153; i++)
{
for(int j = 0; j < 77; j++)
{
Ftotal = Ftotal + checkQuadric(i,j);
}
}
for(int i = 0; i < 166; i++)
{
for(int j = 0; j < 48; j++) sharp[i][j] = 1;
checkSharp(Fworks[i][5], Fworks[i][4], Fworks[i][1], 9, 10, 11, i);
checkSharp(Fworks[i][2], Fworks[i][3], Fworks[i][5], 0, 2, 1, i);
checkSharp(Fworks[i][0], Fworks[i][3], Fworks[i][4], 4, 3, 5, i);
checkSharp(Fworks[i][2], Fworks[i][0], Fworks[i][1], 6, 7, 8, i);
checkSharp(Fworks[i][10], Fworks[i][7], Fworks[i][6], 36, 37, 38, i);
checkSharp(Fworks[i][7], Fworks[i][11], Fworks[i][8], 44, 43, 42, i);
checkSharp(Fworks[i][6], Fworks[i][8], Fworks[i][9], 47, 46, 45, i);
checkSharp(Fworks[i][10], Fworks[i][11], Fworks[i][9], 39, 40, 41, i);
checkSharp(Fworks[i][19], Fworks[i][15], Fworks[i][14], 21, 22, 23, i);
checkSharp(Fworks[i][17], Fworks[i][16], Fworks[i][20], 12, 13, 14, i);
checkSharp(Fworks[i][12], Fworks[i][13], Fworks[i][18], 15, 17, 16, i);
checkSharp(Fworks[i][21], Fworks[i][22], Fworks[i][23], 27, 29, 28, i);
checkSharp(Fworks[i][17], Fworks[i][12], Fworks[i][21], 24, 25, 26, i);
checkSharp(Fworks[i][23], Fworks[i][16], Fworks[i][15], 31, 30, 32, i);
checkSharp(Fworks[i][22], Fworks[i][13], Fworks[i][14], 33, 34, 35, i);
checkSharp(Fworks[i][18], Fworks[i][19], Fworks[i][20], 19, 20, 18, i);
boolean changed = true;
while(changed == true)
{
changed = false;
changed = checkSharp2(sharp[i][0], sharp[i][1], sharp[i][2], 14, 12, 13, i);
changed = checkSharp2(sharp[i][14], sharp[i][12], sharp[i][13], 0, 1, 2, i);
changed = checkSharp2(sharp[i][3], sharp[i][4], sharp[i][5], 17, 16, 15, i);
changed = checkSharp2(sharp[i][17], sharp[i][16], sharp[i][15], 3, 4, 5, i);
changed = checkSharp2(sharp[i][6], sharp[i][7], sharp[i][8], 29, 28, 27, i);
changed = checkSharp2(sharp[i][29], sharp[i][28], sharp[i][27], 6, 7, 8, i);
changed = checkSharp2(sharp[i][9], sharp[i][10], sharp[i][11], 23, 22, 21, i);
changed = checkSharp2(sharp[i][23], sharp[i][22], sharp[i][21], 9, 10, 11, i);
changed = checkSharp2(sharp[i][36], sharp[i][37], sharp[i][38], 26, 25, 24, i);
changed = checkSharp2(sharp[i][26], sharp[i][25], sharp[i][24], 36, 37, 38, i);
changed = checkSharp2(sharp[i][39], sharp[i][40], sharp[i][41], 20, 19, 18, i);
changed = checkSharp2(sharp[i][20], sharp[i][19], sharp[i][18], 39, 40, 41, i);
changed = checkSharp2(sharp[i][42], sharp[i][43], sharp[i][44], 30, 31, 32, i);
changed = checkSharp2(sharp[i][30], sharp[i][31], sharp[i][32], 42, 43, 44, i);
changed = checkSharp2(sharp[i][45], sharp[i][46], sharp[i][47], 33, 34, 35, i);
changed = checkSharp2(sharp[i][33], sharp[i][34], sharp[i][35], 45, 46, 47, i);
}
}
for(int i = 0; i < 100; i++)
{
orbits[i] = 0;
}
for(int i = 0; i < 166; i++)
FworksUsed[i] = 1;
orbitCount = 0;
for(int i = 0; i < 24; i++)
{
System.out.println(i + " = " + Fworks[100][i]);
}
c(100);
System.out.println();
for(int i = 0; i < 24; i++)
{
System.out.println(i + " = " + Fworks[100][i]);
}
a(100);
System.out.println();
for(int i = 0; i < 24; i++)
{
System.out.println(i + " = " + Fworks[100][i]);
}
for(int i = 100; i < 101; i++)
{
if(FworksUsed[i] == 1)
{
orbitCount++;
orbits[orbitCount] = 1;
FworksUsed[i] = 0;
for(int j = 0; j < 24; j++)
tempFworks[j] = Fworks[i][j];
c(i);
b(i);
a(i);
checkPerm(i);
for(int j = 0; j < 24; j++)
Fworks[i][j] = tempFworks[j];
b(i);
c(i);
a(i);
checkPerm(i);
for(int j = 0; j < 24; j++)
Fworks[i][j] = tempFworks[j];
f(i);
b(i);
e(i);
checkPerm(i);
for(int j = 0; j < 24; j++)
Fworks[i][j] = tempFworks[j];
f(i);
c(i);
e(i);
checkPerm(i);
for(int j = 0; j < 24; j++)
Fworks[i][j] = tempFworks[j];
b(i);
f(i);
d(i);
checkPerm(i);
for(int j = 0; j < 24; j++)
Fworks[i][j] = tempFworks[j];
b(i);
c(i);
d(i);
checkPerm(i);
for(int j = 0; j < 24; j++)
Fworks[i][j] = tempFworks[j];
b(i);
a(i);
checkPerm(i);
for(int j = 0; j < 24; j++)
Fworks[i][j] = tempFworks[j];
a(i);
b(i);
checkPerm(i);
for(int j = 0; j < 24; j++)
Fworks[i][j] = tempFworks[j];
f(i);
a(i);
checkPerm(i);
for(int j = 0; j < 24; j++)
Fworks[i][j] = tempFworks[j];
f(i);
d(i);
checkPerm(i);
for(int j = 0; j < 24; j++)
Fworks[i][j] = tempFworks[j];
c(i);
e(i);
checkPerm(i);
for(int j = 0; j < 24; j++)
Fworks[i][j] = tempFworks[j];
c(i);
d(i);
checkPerm(i);
for(int j = 0; j < 24; j++)
Fworks[i][j] = tempFworks[j];
c(i);
b(i);
checkPerm(i);
for(int j = 0; j < 24; j++)
Fworks[i][j] = tempFworks[j];
c(i);
f(i);
checkPerm(i);
for(int j = 0; j < 24; j++)
Fworks[i][j] = tempFworks[j];
a(i);
checkPerm(i);
for(int j = 0; j < 24; j++)
Fworks[i][j] = tempFworks[j];
e(i);
checkPerm(i);
for(int j = 0; j < 24; j++)
Fworks[i][j] = tempFworks[j];
d(i);
checkPerm(i);
for(int j = 0; j < 24; j++)
Fworks[i][j] = tempFworks[j];
b(i);
checkPerm(i);
for(int j = 0; j < 24; j++)
Fworks[i][j] = tempFworks[j];
f(i);
checkPerm(i);
for(int j = 0; j < 24; j++)
Fworks[i][j] = tempFworks[j];
c(i);
checkPerm(i);
for(int j = 0; j < 24; j++)
Fworks[i][j] = tempFworks[j];
c(i);
a(i);
checkPerm(i);
for(int j = 0; j < 24; j++)
Fworks[i][j] = tempFworks[j];
f(i);
e(i);
checkPerm(i);
for(int j = 0; j < 24; j++)
Fworks[i][j] = tempFworks[j];
b(i);
d(i);
checkPerm(i);
for(int j = 0; j < 24; j++)
Fworks[i][j] = tempFworks[j];
}
}
/** for(int i = 0; i < 166; i++)
{
int zeroEdges = 24;
for(int j = 0; j < 24; j++)
{
zeroEdges = zeroEdges - Fworks[i][j];
}
if(zeroEdges == 4)
{
System.out.println(i);
for(int p = 0; p < 24; p++)
{
System.out.println("Fworks[ " + i + " ][ " + p + " ] = " + Fworks[i][p]);
}
System.out.println();
}
}
for(int i = 1; i < orbitCount + 1; i++)
{
System.out.println("The size of orbit, '" + i + "', is " + orbits[i]);
}
int j = 0;
for(int i = 0; i < 24; i++)
{
System.out.println("Fworks[ " + j + " ][ " + i + " ] = " + Fworks[j][i]);
}
System.out.println();
for(int i = 0; i < 48; i++)
{
System.out.println("sharp[ " + j + " ][ " + i + " ] = " + sharp[j][i]);
}
System.out.println("Total possibilities for Triangle Two: " + Ttotal);
for(int i = 0; i < 13; i++)
System.out.println("Possibilities with " + i + " 'zero' edges: " + TedgTotal[i]);
System.out.println();
System.out.println("Total possibilities for Triangles One, Three: " + Ototal);
for(int i = 0; i < 13; i++)
System.out.println("Possibilities with " + i + " 'zero' edges: " + OedgTotal[i]);
System.out.println();
System.out.println("Total possibilities: " + Ftotal);
for(int i = 0; i < 25; i++)
System.out.println("Possibilities with " + i + " 'zero' edges: " + FedgTotal[i]);
**/
}
public static void addModTwo(int[] a, int i)
{
if(a[i] == 0)
{
a[i] = 1;
return;
}
else if(i > 10) return;
else
{
a[i] = 0;
addModTwo(a,i+1);
}
}
public static int Tcheck()
{
Ttri[0] = Tedg[4] + Tedg[5] + Tedg[8];
Ttri[1] = Tedg[0] + Tedg[1] + Tedg[6];
Ttri[2] = Tedg[6] + Tedg[7] + Tedg[8];
Ttri[3] = Tedg[2] + Tedg[3] + Tedg[7];
Ttri[4] = Tedg[3] + Tedg[4] + Tedg[11];
Ttri[5] = Tedg[1] + Tedg[2] + Tedg[10];
Ttri[6] = Tedg[9] + Tedg[10] + Tedg[11];
Ttri[7] = Tedg[0] + Tedg[5] + Tedg[9];
for(int i = 0; i < 8; i++)
if(Ttri[i] == 1) return 0;
if(!checkCubic()) return 0;
int Tedges = 12;
for(int i = 0; i < 12; i++)
Tedges = Tedges - Tedg[i];
TedgTotal[Tedges]++;
for(int i = 0; i < 12; i++)
Tworks[Tcount][i] = Tedg[i];
Tcount++;
return 1;
}
public static boolean checkCubic()
{
cub[0] = (Tedg[5] * Tedg[1] * Tedg[3]) - (Tedg[2] * Tedg[4] * Tedg[0]);
cub[1] = (Tedg[6] * Tedg[4] * Tedg[10]) - (Tedg[11] * Tedg[1] * Tedg[8]);
cub[2] = (Tedg[5] * Tedg[10] * Tedg[7]) - (Tedg[2] * Tedg[8] * Tedg[9]);
cub[3] = (Tedg[6] * Tedg[3] * Tedg[9]) - (Tedg[11] * Tedg[0] * Tedg[7]);
for(int i = 0; i < 4; i++)
if(cub[i] != 0)
return false;
return true;
}
public static int Ocheck()
{
Otri[0] = Oedg[0] + Oedg[1] + Oedg[2];
Otri[1] = Oedg[2] + Oedg[3] + Oedg[5];
Otri[2] = Oedg[0] + Oedg[3] + Oedg[4];
Otri[3] = Oedg[1] + Oedg[4] + Oedg[5];
Otri[4] = Oedg[9] + Oedg[10] + Oedg[11];
Otri[5] = Oedg[7] + Oedg[8] + Oedg[11];
Otri[6] = Oedg[6] + Oedg[8] + Oedg[9];
Otri[7] = Oedg[6] + Oedg[7] + Oedg[10];
for(int i = 0; i < 8; i++)
if(Otri[i] == 1) return 0;
if(!checkQuartic()) return 0;
int Oedges = 12;
for(int i = 0; i < 12; i++)
Oedges = Oedges - Oedg[i];
OedgTotal[Oedges]++;
for(int i = 0; i < 12; i++)
Oworks[Ocount][i] = Oedg[i];
Ocount++;
return 1;
}
public static boolean checkQuartic()
{
quar[0] = (Oedg[0] * Oedg[5] * Oedg[9] * Oedg[7]) - (Oedg[2] * Oedg[4] * Oedg[6] * Oedg[11]);
quar[1] = (Oedg[0] * Oedg[5] * Oedg[10] * Oedg[8]) - (Oedg[1] * Oedg[3] * Oedg[6] * Oedg[11]);
quar[2] = (Oedg[1] * Oedg[3] * Oedg[9] * Oedg[7]) - (Oedg[2] * Oedg[4] * Oedg[10] * Oedg[8]);
for(int i = 0; i < 3; i++)
if(quar[i] != 0)
return false;
return true;
}
public static int checkQuadric(int i, int j)
{
for(int k = 0; k < 12; k++)
O[k] = Oworks[i][k];
for(int l = 0; l < 12; l++)
T[l] = Tworks[j][l];
quad[0] = (O[5] * T[7]) - (O[1] * T[2]);
quad[1] = (O[5] * T[3]) - (O[4] * T[2]);
quad[2] = (O[1] * T[3]) - (O[4] * T[7]);
quad[3] = (O[2] * T[4]) - (O[3] * T[8]);
quad[4] = (O[2] * T[5]) - (O[5] * T[8]);
quad[5] = (O[3] * T[5]) - (O[5] * T[4]);
quad[6] = (O[3] * T[6]) - (O[0] * T[1]);
quad[7] = (O[3] * T[0]) - (O[4] * T[1]);
quad[8] = (O[0] * T[0]) - (O[4] * T[6]);
quad[9] = (O[0] * T[9]) - (O[1] * T[11]);
quad[10] = (O[0] * T[10]) - (O[2] * T[11]);
quad[11] = (O[1] * T[10]) - (O[2] * T[9]);
quad[12] = (O[6] * T[0]) - (O[7] * T[5]);
quad[13] = (O[6] * T[9]) - (O[10] * T[5]);
quad[14] = (O[7] * T[9]) - (O[10] * T[0]);
quad[15] = (O[7] * T[4]) - (O[8] * T[3]);
quad[16] = (O[7] * T[11]) - (O[11] * T[3]);
quad[17] = (O[8] * T[11]) - (O[11] * T[4]);
quad[18] = (O[6] * T[1]) - (O[8] * T[2]);
quad[19] = (O[6] * T[10]) - (O[9] * T[2]);
quad[20] = (O[8] * T[10]) - (O[9] * T[1]);
quad[21] = (O[9] * T[7]) - (O[10] * T[8]);
quad[22] = (O[9] * T[6]) - (O[11] * T[8]);
quad[23] = (O[10] * T[6]) - (O[11] * T[7]);
for(int m = 0; m < 24; m++)
if(quad[m] != 0)
return 0;
int countOne = 0;
int countTwo = 0;
int countThree = 0;
for(int n = 0; n < 12; n++)
countTwo = countTwo + T[n];
for(int p = 0; p < 6; p++)
{
countOne = countOne + O[p];
countThree = countThree + O[p+6];
}
if(countOne == 0 || countTwo == 0 || countThree == 0)
return 0;
int edges = 24;
for(int x = 0; x < 12; x++)
edges = edges - O[x] - T[x];
FedgTotal[edges]++;
for(int z = 0; z < 24; z++)
{
if(z < 12) Fworks[Ftotal][z] = O[z];
else Fworks[Ftotal][z] = T[z-12];
}
return 1;
}
public static void checkSharp(int a1, int b1, int c1, int a, int b, int c, int i)
{
if(a1 + b1 + c1 == 3) return;
if(a1 == 0 && b1 == 1 && c1 == 1)
{
sharp[i][a] = 0;
sharp[i][b] = 1;
sharp[i][c] = 1;
return;
}
else if(a1 == 1 && b1 == 0 && c1 == 1)
{
sharp[i][a] = 1;
sharp[i][b] = 0;
sharp[i][c] = 1;
return;
}
else if(a1 == 1 && b1 == 1 && c1 == 0)
{
sharp[i][a] = 1;
sharp[i][b] = 1;
sharp[i][c] = 0;
return;
}
}
public static boolean checkSharp2(int a1, int b1, int c1, int a, int b, int c, int i)
{
a2init = sharp[i][a];
b2init = sharp[i][b];
c2init = sharp[i][c];
if(a1 + b1 + c1 == 3 ) return false;
if(a1 == 0 && b1 == 1 && c1 == 1)
{
int a2 = sharp[i][a] = 0;
int b2 = sharp[i][b] = 1;
int c2 = sharp[i][c] = 1;
return changed(a2, b2, c2);
}
else if(a1 == 1 && b1 == 0 && c1 == 1)
{
int a2 = sharp[i][a] = 1;
int b2 = sharp[i][b] = 0;
int c2 = sharp[i][c] = 1;
return changed(a2, b2, c2);
}
else if(a1 == 1 && b1 == 1 && c1 == 0)
{
int a2 = sharp[i][a] = 1;
int b2 = sharp[i][b] = 1;
int c2 = sharp[i][c] = 0;
return changed(a2, b2, c2);
}
else return false;
}
public static boolean changed(int a2, int b2, int c2)
{
if(a2init == a2 && b2init == b2 && c2init == c2) return false;
else return true;
}
public static void a(int i)
{
int[] temp = new int[24];
for(int j = 0; j < 24; j++) temp[j] = Fworks[i][j];
Fworks[i][0] = temp[1];
Fworks[i][1] = temp[0];
Fworks[i][3] = temp[5];
Fworks[i][5] = temp[3];
Fworks[i][21] = temp[23];
Fworks[i][23] = temp[21];
Fworks[i][17] = temp[16];
Fworks[i][16] = temp[17];
Fworks[i][12] = temp[15];
Fworks[i][15] = temp[12];
Fworks[i][13] = temp[14];
Fworks[i][14] = temp[13];
Fworks[i][18] = temp[19];
Fworks[i][19] = temp[18];
Fworks[i][10] = temp[11];
Fworks[i][11] = temp[10];
Fworks[i][6] = temp[8];
Fworks[i][8] = temp[6];
}
public static void b(int i)
{
int[] temp = new int[24];
for(int j = 0; j < 24; j++) temp[j] = Fworks[i][j];
Fworks[i][0] = temp[2];
Fworks[i][2] = temp[0];
Fworks[i][4] = temp[5];
Fworks[i][5] = temp[4];
Fworks[i][14] = temp[15];
Fworks[i][15] = temp[14];
Fworks[i][13] = temp[16];
Fworks[i][16] = temp[13];
Fworks[i][12] = temp[17];
Fworks[i][17] = temp[12];
Fworks[i][23] = temp[22];
Fworks[i][22] = temp[23];
Fworks[i][18] = temp[20];
Fworks[i][20] = temp[18];
Fworks[i][9] = temp[11];
Fworks[i][11] = temp[9];
Fworks[i][6] = temp[7];
Fworks[i][7] = temp[6];
}
public static void c(int i)
{
int[] temp = new int[24];
for(int j = 0; j < 24; j++) temp[j] = Fworks[i][j];
Fworks[i][0] = temp[3];
Fworks[i][3] = temp[0];
Fworks[i][1] = temp[5];
Fworks[i][5] = temp[1];
Fworks[i][13] = temp[18];
Fworks[i][18] = temp[13];
Fworks[i][14] = temp[19];
Fworks[i][19] = temp[14];
Fworks[i][17] = temp[21];
Fworks[i][21] = temp[17];
Fworks[i][16] = temp[23];
Fworks[i][23] = temp[16];
Fworks[i][20] = temp[22];
Fworks[i][22] = temp[20];
Fworks[i][10] = temp[6];
Fworks[i][6] = temp[10];
Fworks[i][11] = temp[8];
Fworks[i][8] = temp[11];
}
public static void d(int i)
{
int[] temp = new int[24];
for(int j = 0; j < 24; j++) temp[j] = Fworks[i][j];
Fworks[i][0] = temp[4];
Fworks[i][4] = temp[0];
Fworks[i][2] = temp[5];
Fworks[i][5] = temp[2];
Fworks[i][12] = temp[18];
Fworks[i][18] = temp[12];
Fworks[i][17] = temp[20];
Fworks[i][20] = temp[17];
Fworks[i][14] = temp[22];
Fworks[i][22] = temp[14];
Fworks[i][15] = temp[23];
Fworks[i][23] = temp[15];
Fworks[i][19] = temp[21];
Fworks[i][21] = temp[19];
Fworks[i][7] = temp[11];
Fworks[i][11] = temp[7];
Fworks[i][6] = temp[9];
Fworks[i][9] = temp[6];
}
public static void e(int i)
{
int[] temp = new int[24];
for(int j = 0; j < 24; j++) temp[j] = Fworks[i][j];
Fworks[i][3] = temp[4];
Fworks[i][4] = temp[3];
Fworks[i][2] = temp[1];
Fworks[i][1] = temp[2];
Fworks[i][12] = temp[13];
Fworks[i][13] = temp[12];
Fworks[i][17] = temp[14];
Fworks[i][14] = temp[17];
Fworks[i][15] = temp[16];
Fworks[i][16] = temp[15];
Fworks[i][19] = temp[20];
Fworks[i][20] = temp[19];
Fworks[i][22] = temp[21];
Fworks[i][21] = temp[22];
Fworks[i][7] = temp[8];
Fworks[i][8] = temp[7];
Fworks[i][10] = temp[9];
Fworks[i][9] = temp[10];
}
public static void f(int i)
{
int[] temp = new int[24];
for(int j = 0; j < 24; j++) temp[j] = Fworks[i][j];
Fworks[i][1] = temp[4];
Fworks[i][4] = temp[1];
Fworks[i][2] = temp[3];
Fworks[i][3] = temp[2];
Fworks[i][15] = temp[19];
Fworks[i][19] = temp[15];
Fworks[i][16] = temp[20];
Fworks[i][20] = temp[16];
Fworks[i][12] = temp[21];
Fworks[i][21] = temp[12];
Fworks[i][13] = temp[22];
Fworks[i][22] = temp[13];
Fworks[i][23] = temp[18];
Fworks[i][18] = temp[23];
Fworks[i][9] = temp[8];
Fworks[i][8] = temp[9];
Fworks[i][10] = temp[7];
Fworks[i][7] = temp[10];
}
public static void checkPerm(int i)
{
for(int j = 0; j < 166; j++)
{
if(FworksUsed[j] == 1)
{
boolean okay = true;
for(int k = 0; k < 24; k++)
{
if(Fworks[i][k] != Fworks[j][k])
{
okay = false;
}
}
if(okay == true)
{
// System.out.println(j);
orbits[orbitCount]++;
FworksUsed[j] = 0;
}
}
}
}
}
Notice: (null)(): [ALERT] Mailbox is over quota in Unknown on line 0