Cody

Solution 1310978

Submitted on 23 Oct 2017 by LY Cao
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
x = 1; y1 = fifth_times_a_charm(x); assert(~isequal(y1,x)) y2 = fifth_times_a_charm(x); assert(~isequal(y2,x)) assert(abs(x-y2)<abs(x-y1)) y3 = fifth_times_a_charm(x); assert(~isequal(y3,x)) assert(abs(x-y3)<abs(x-y2)) y4 = fifth_times_a_charm(x); assert(~isequal(y4,x)) assert(abs(x-y4)<abs(x-y3)) y5 = fifth_times_a_charm(x); assert(isequal(y5,x))

Png;base64,ivborw0kggoaaaansuheugaaakcaaag1caiaaab8k8cvaaafjuleqvr42u3vmq0aaazdspin3alym9kq8iqfgc8iaqcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboargyargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboauboargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubgcubocraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4maqcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboargyargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboauboargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubgcubocraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4maqcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboargyargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboauboargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubgcubocraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4maqcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboargyargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagbwaguanaogdp84aaaaaelftksuqmcc"}]
2   Pass
x = -1; y1 = fifth_times_a_charm(x); assert(~isequal(y1,x)) y2 = fifth_times_a_charm(x); assert(~isequal(y2,x)) assert(abs(x-y2)<abs(x-y1)) y3 = fifth_times_a_charm(x); assert(~isequal(y3,x)) assert(abs(x-y3)<abs(x-y2)) y4 = fifth_times_a_charm(x); assert(~isequal(y4,x)) assert(abs(x-y4)<abs(x-y3)) y5 = fifth_times_a_charm(x); assert(isequal(y5,x))

Png;base64,ivborw0kggoaaaansuheugaaakcaaag1caiaaab8k8cvaaafjuleqvr42u3vmq0aaazdspin3alym9kq8iqfgc8iaqcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboargyargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboauboargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubgcubocraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4maqcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboargyargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboauboargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubgcubocraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4maqcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboargyargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboauboargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubgcubocraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4maqcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboargyargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagbwaguanaogdp84aaaaaelftksuqmcc"}]
3   Pass
x = 42; y1 = fifth_times_a_charm(x); assert(~isequal(y1,x)) y2 = fifth_times_a_charm(x); assert(~isequal(y2,x)) assert(abs(x-y2)<abs(x-y1)) y3 = fifth_times_a_charm(x); assert(~isequal(y3,x)) assert(abs(x-y3)<abs(x-y2)) y4 = fifth_times_a_charm(x); assert(~isequal(y4,x)) assert(abs(x-y4)<abs(x-y3)) y5 = fifth_times_a_charm(x); assert(isequal(y5,x))

4   Pass
x = i; y1 = fifth_times_a_charm(x); assert(~isequal(y1,x)) y2 = fifth_times_a_charm(x); assert(~isequal(y2,x)) assert(abs(x-y2)<abs(x-y1)) y3 = fifth_times_a_charm(x); assert(~isequal(y3,x)) assert(abs(x-y3)<abs(x-y2)) y4 = fifth_times_a_charm(x); assert(~isequal(y4,x)) assert(abs(x-y4)<abs(x-y3)) y5 = fifth_times_a_charm(x); assert(isequal(y5,x))

Suggested Problems

More from this Author161