import java.util.* ;
import java.util.regex.* ;
import java.text.* ;
import java.math.* ;
class Arrfix
{
public int mindiff( int [ ] A, int [ ] B, int [ ] F)
{
int [ ] c = new int [ 1010 ] ;
for ( int x: F) c[ x] ++;
int ret = 0 ;
boolean [ ] d = new boolean [ A.length ] ;
for ( int i = 0 ; i < A.length ; i++ ) {
if ( A[ i] == B[ i] ) {
//A[i] = B[i];
continue ;
}
if ( c[ B[ i] ] > 0 ) {
d[ i] = true ;
A[ i] = B[ i] ;
c[ B[ i] ] --;
}
}
for ( int i = 0 ; i < A.length ; i++ )
//System.out.println(ret);
for ( int i = 0 ; i < F.length ; i++ ) {
if ( c[ F[ i] ] == 0 ) continue ;
boolean found = false ;
int indx = - 1 ;
for ( int j = 0 ; j < A.length ; j++ ) {
if ( ! d[ j] && B[ j] == F[ i] && A[ j] != B[ j] ) {
found = true ;
indx = j;
break ;
}
}
if ( found) {
A[ indx] = B[ indx] ;
d[ indx] = true ;
c[ F[ i] ] --;
continue ;
}
else {
for ( int j = 0 ; j < A.length ; j++ ) {
if ( ! d[ j] && B[ j] == F[ i] ) {
found = true ;
indx = j;
break ;
}
}
if ( found) {
A[ indx] = B[ indx] ;
d[ indx] = true ;
c[ F[ i] ] --;
continue ;
}
int j = 0 ;
while ( j < A.length && ( d[ j] || c[ B[ j] ] > 0 || A[ j] == B[ j] ) ) j++;
if ( j == A.length ) {
j = 0 ;
//while(j < A.length && (d[j] || c[B[j]] > 0)) j++;
while ( j < A.length && d[ j] ) j++;
}
if ( j == A.length ) {
j = 0 ;
while ( j < A.length && d[ j] ) j++;
}
System .
out .
println ( "Filling " + F
[ i
] + " at " + A
[ j
] ) ;
A[ j] = F[ i] ;
d[ j] = true ;
c[ F[ i] ] --;
}
}
for ( int i = 0 ; i < A.length ; i++ )
if ( A[ i] != B[ i] ) ret++;
for ( int i = 0 ; i < A.length ; i++ )
return ret;
}
//<%:testing-code%>
// BEGIN KAWIGIEDIT TESTING
// Generated by KawigiEdit-pf 2.3.0
private static boolean KawigiEdit_RunTest( int testNum, int [ ] p0, int [ ] p1, int [ ] p2, boolean hasAnswer, int p3) {
System .
out .
print ( "Test " + testNum
+ ": [" + "{" ) ; for ( int i = 0 ; p0.length > i; ++ i) {
if ( i > 0 ) {
}
}
System .
out .
print ( "}" + "," + "{" ) ; for ( int i = 0 ; p1.length > i; ++ i) {
if ( i > 0 ) {
}
}
System .
out .
print ( "}" + "," + "{" ) ; for ( int i = 0 ; p2.length > i; ++ i) {
if ( i > 0 ) {
}
}
Arrfix obj;
int answer;
obj = new Arrfix( ) ;
long startTime
= System .
currentTimeMillis ( ) ; answer = obj.mindiff ( p0, p1, p2) ;
long endTime
= System .
currentTimeMillis ( ) ; boolean res;
res = true ;
System .
out .
println ( "Time: " + ( endTime
- startTime
) / 1000.0 + " seconds" ) ; if ( hasAnswer) {
System .
out .
println ( "Desired answer:" ) ; System .
out .
println ( "\t " + p3
) ; }
System .
out .
println ( "Your answer:" ) ; System .
out .
println ( "\t " + answer
) ; if ( hasAnswer) {
res = answer == p3;
}
if ( ! res) {
System .
out .
println ( "DOESN'T MATCH!!!!" ) ; } else if ( ( endTime - startTime) / 1000.0 >= 2 ) {
System .
out .
println ( "FAIL the timeout" ) ; res = false ;
} else if ( hasAnswer) {
System .
out .
println ( "Match :-)" ) ; } else {
System .
out .
println ( "OK, but is it right?" ) ; }
return res;
}
public static void main
( String [ ] args
) { boolean all_right;
boolean disabled;
boolean tests_disabled;
all_right = true ;
tests_disabled = false ;
int [ ] p0;
int [ ] p1;
int [ ] p2;
int p3;
// ----- test 0 -----
disabled = false ;
p0 = new int [ ] { 1 ,1 ,1 } ;
p1 = new int [ ] { 2 ,2 ,2 } ;
p2 = new int [ ] { 2 } ;
p3 = 2 ;
all_right = ( disabled || KawigiEdit_RunTest( 0 , p0, p1, p2, true , p3) ) && all_right;
tests_disabled = tests_disabled || disabled;
// ------------------
// ----- test 1 -----
disabled = false ;
p0 = new int [ ] { 1 ,1 ,1 } ;
p1 = new int [ ] { 2 ,2 ,1 } ;
p2 = new int [ ] { 2 ,2 } ;
p3 = 0 ;
all_right = ( disabled || KawigiEdit_RunTest( 1 , p0, p1, p2, true , p3) ) && all_right;
tests_disabled = tests_disabled || disabled;
// ------------------
// ----- test 2 -----
disabled = false ;
p0 = new int [ ] { 1 ,2 ,3 } ;
p1 = new int [ ] { 3 ,2 ,1 } ;
p2 = new int [ ] { } ;
p3 = 2 ;
all_right = ( disabled || KawigiEdit_RunTest( 2 , p0, p1, p2, true , p3) ) && all_right;
tests_disabled = tests_disabled || disabled;
// ------------------
// ----- test 3 -----
disabled = false ;
p0 = new int [ ] { 2 ,2 ,2 } ;
p1 = new int [ ] { 2 ,2 ,2 } ;
p2 = new int [ ] { 1 ,2 ,3 } ;
p3 = 2 ;
all_right = ( disabled || KawigiEdit_RunTest( 3 , p0, p1, p2, true , p3) ) && all_right;
tests_disabled = tests_disabled || disabled;
// ------------------
// ----- test 4 -----
disabled = false ;
p0 = new int [ ] { 1 ,3 ,3 ,3 } ;
p1 = new int [ ] { 2 ,3 ,3 ,3 } ;
p2 = new int [ ] { 2 ,2 } ;
p3 = 1 ;
all_right = ( disabled || KawigiEdit_RunTest( 4 , p0, p1, p2, true , p3) ) && all_right;
tests_disabled = tests_disabled || disabled;
// ------------------
// ----- test 4 -----
disabled = false ;
p0 = new int [ ] { 3 ,5 ,7 } ;
p1 = new int [ ] { 3 ,5 ,7 } ;
p2 = new int [ ] { 2 ,3 } ;
p3 = 1 ;
all_right = ( disabled || KawigiEdit_RunTest( 4 , p0, p1, p2, true , p3) ) && all_right;
tests_disabled = tests_disabled || disabled;
// ------------------
if ( all_right) {
if ( tests_disabled) {
System .
out .
println ( "You're a stud (but some test cases were disabled)!" ) ; } else {
System .
out .
println ( "You're a stud (at least on given cases)!" ) ; }
} else {
System .
out .
println ( "Some of the test cases had errors." ) ; }
}
// END KAWIGIEDIT TESTING
}
//Powered by KawigiEdit-pf 2.3.0!
aW1wb3J0IGphdmEudXRpbC4qOwppb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1,1,
Time: 0.0 seconds
Desired answer:
2
Your answer:
2
Match :-)
Test 1: [{1,1,1},{2,2,1},{2,2}]
2,2,1,
2,2,1,
Time: 0.001 seconds
Desired answer:
0
Your answer:
0
Match :-)
Test 2: [{1,2,3},{3,2,1},{}]
1,2,3,
1,2,3,
Time: 0.0 seconds
Desired answer:
2
Your answer:
2
Match :-)
Test 3: [{2,2,2},{2,2,2},{1,2,3}]
2,2,2,
Filling 1 at 2
Filling 3 at 2
1,2,3,
Time: 0.0 seconds
Desired answer:
2
Your answer:
2
Match :-)
Test 4: [{1,3,3,3},{2,3,3,3},{2,2}]
2,3,3,3,
Filling 2 at 3
2,2,3,3,
Time: 0.001 seconds
Desired answer:
1
Your answer:
1
Match :-)
Test 4: [{3,5,7},{3,5,7},{2,3}]
3,5,7,
Filling 2 at 3
Filling 3 at 5
2,3,7,
Time: 0.001 seconds
Desired answer:
1
Your answer:
2
DOESN'T MATCH!!!!
Some of the test cases had errors.