Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int[] simpleMathGame(int[] A) {
- int a[] = {1,0}, i = 1, l, m, j, c[] = new int[l = 99999];
- for(int u : A){
- for(j = 1; j*++j < u; )
- for( ; u%j<1 ; c[j]++ )
- u /= j;
- c[u]++;
- }
- for( ; ++i < l ; ){
- a[0] *= Math.pow(i, c[i]/=A.length);
- for(int u : A){
- for(m = 0 ;u%i < 1;m++)
- u/=i;
- a[1] += m<c[i]?c[i]-m:0;
- }
- }
- return a;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement